<?xml version="1.0"?>
<!DOCTYPE texinfo PUBLIC "-//GNU//DTD TexinfoML V6.8//EN" "http://www.gnu.org/software/texinfo/dtd/6.8/texinfo.dtd">
<texinfo xml:lang="en">
<filename file="latex2e.xml"></filename>
<preamble>\input texinfo
</preamble><!-- c $Id: latex2e.texi 1079 2022-01-26 18:15:20Z karl $ -->
<!-- comment %**start of header (This is for running Texinfo on a region.) -->
<setfilename file="latex2e.info" spaces=" ">latex2e.info</setfilename>
<set name="UPDATED" line=" UPDATED January 2022">January 2022</set>
<!-- c $Id: common.texi 1031 2021-09-01 17:02:05Z vincentb1 $ -->
<!-- c Public domain. -->
<set name="LTXREFMAN_HOME_PAGE" line=" LTXREFMAN_HOME_PAGE https://latexref.xyz">https://latexref.xyz</set>
<set name="LTXREFMAN_BUGS" line=" LTXREFMAN_BUGS latexrefman@@tug.org">latexrefman@@tug.org</set>
<clear name="HAS-MATH" line=" HAS-MATH "></clear>
<macro name="iftexthenelse" line=" iftexthenelse {then,else}"><formalarg>then</formalarg><formalarg>else</formalarg>\else\@c
</macro>
<macro name="package" line=" package {packagename}"><formalarg>packagename</formalarg>@code{\packagename\}
</macro>

<tex endspaces=" ">
</tex>
<settitle spaces=" ">&latex;2e unofficial reference manual (January 2022)</settitle>
<!-- comment %**end of header (This is for running Texinfo on a region.) -->

<!-- c latex 2.09 commands should all be present now, -->
<!-- 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 xx read through latex2e news for things to update. -->
<!-- c -->
<!-- c xx ctan, distributions, components of TeX -->
<!-- c xx classes and packages: required, additional, useful; oberdiek; fonts -->
<!-- c xx merge permuted-index -->
<!-- c xx merge latex-manual from savannah -->
<!-- c xx merge display style math -->
<!-- c xx check recent ltnews for (lots of) changes -->
<!-- c xx \write of non-ASCII chars (vincent mail of 14 Mar 2020 21:39:41) -->
<!-- c xx \nonstopmode etc., if they are officially supported by LaTeX? -->
<!-- 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 -->
<!-- c xx \NewCommandCopy et al. (Brian Dunn, 21 Dec 2021 06:50:17). -->
<!-- c -->
<!-- c xx The typeset source2e has an index with all kernel -->
<!-- c xx commands, though some are internal and shouldn't be included. -->
<!-- c xx classes.dtx et al. define additional commands. -->
<!-- c xx See also http://ctan.org/pkg/macros2e. -->
<!-- c  -->
<!-- c xx All the special characters should be definitively described. -->

<copying endspaces=" ">
<para>This document is an unofficial reference manual for &latex;, a
document preparation system, version of January 2022.
</para>
<para>This manual was originally translated from <file>LATEX.HLP</file> v1.0a in the
VMS Help Library.  The pre-translation version was written by
George&nbsp;D. Greenwade of Sam Houston State University.  The
&latex;&nbsp;2.09 version was written by Stephen Gilmore.  The
&latex;2e version was adapted from this by Torsten Martinsen.  Karl
Berry made further updates and additions, and gratefully acknowledges
using <cite>Hypertext Help with &latex;</cite>, by Sheldon Green, and
<cite>&latex; Command Summary</cite> (for &latex;&nbsp;2.09) by
L.&nbsp;Botway and C.&nbsp;Biemesderfer (published by the &tex; Users
Group as <cite>&tex;niques</cite> number 10), as reference material.  We also
gratefully acknowledge additional material appearing in
latex2e-reference by Martin Herbert Dietze.  (From these references no
text was directly copied.)
</para>
<para>Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2013,
2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 Karl Berry.&linebreak;
Copyright 1988, 1994, 2007 Stephen Gilmore.&linebreak;
Copyright 1994, 1995, 1996 Torsten Martinsen.
</para>
<!-- comment start of License -->
<para>Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
</para>
<ignore>
Permission is granted to process this file through TeX and print the
results, provided the printed document carries copying permission
notice identical to this one except for the removal of this paragraph
(this paragraph not being relevant to the printed manual).
</ignore>

<para>Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.
</para>
<para>Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions.
<!-- comment end of License -->
</para></copying>

<!-- c Merge into one index (arbitrarily chosen to be the concept index). -->
<syncodeindex from="fn" to="cp" line="fn cp"></syncodeindex>

<dircategory spaces=" ">TeX</dircategory>
<direntry endspaces=" ">
<menuentry leadingtext="* "><menutitle separator=": ">LaTeX2e</menutitle><menunode separator=".              ">(latex2e)</menunode><menudescription><pre xml:space="preserve">Unofficial LaTeX reference manual.
</pre></menudescription></menuentry></direntry>

<tex endspaces=" ">
</tex>

<html endspaces=" ">
</html>

<titlepage endspaces=" ">
<title spaces=" ">&latex;2e: An unofficial reference manual</title>
<subtitle spaces=" ">January 2022</subtitle>
<author spaces=" "><url><urefurl>https://latexref.xyz</urefurl></url></author>
<page></page>
<vskip> 0pt plus 1filll</vskip>
<insertcopying></insertcopying>
</titlepage>

<shortcontents></shortcontents>
<contents></contents>

<!-- c Best Effort Symbol -->
<macro name="visiblespace" line=" visiblespace">@w{ }
</macro>
<macro name="BES" line=" BES {utf8,math}"><formalarg>utf8</formalarg><formalarg>math</formalarg>@U{\utf8\}
</macro>
<macro name="BESU" line=" BESU {utf8,math}"><formalarg>utf8</formalarg><formalarg>math</formalarg>@U{\utf8\}
</macro>
<macro name="EnvIndex" line=" EnvIndex {env}"><formalarg>env</formalarg>@findex @r{environment}, @code{\env\}
@findex @code{\env\} @r{environment}
        
</macro>
<macro name="PkgIndex" line=" PkgIndex {pkg}"><formalarg>pkg</formalarg>@cindex @r{package}, @code{\pkg\}
@cindex @code{\pkg\} @r{package}

</macro>

<set name="NotInPlainTeX" line=" NotInPlainTeX Not available in plain @TeX{}.">Not available in plain @TeX{}.</set>
<set name="NeedsAMSSymb" line=" NeedsAMSSymb @value{NotInPlainTeX} In @LaTeX{} you need to load the @package{amssymb} package.">@value{NotInPlainTeX} In @LaTeX{} you need to load the @package{amssymb} package.</set>
<set name="NeedsSTIX" line=" NeedsSTIX @value{NotInPlainTeX} In @LaTeX{} you need to load the @file{stix} package.">@value{NotInPlainTeX} In @LaTeX{} you need to load the @file{stix} package.</set>

<node name="Top" spaces=" "><nodename>Top</nodename><nodenext automatic="on">About this document</nodenext></node>
<top spaces=" "><sectiontitle>&latex;2e: An unofficial reference manual</sectiontitle>

<para>This document is an unofficial reference manual (version of
January 2022) for &latex;2e, a document preparation system.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::         ">About this document</menunode><menudescription><pre xml:space="preserve">Bug reporting, etc.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                    ">Overview</menunode><menudescription><pre xml:space="preserve">What is &latex;?
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::		">Document classes</menunode><menudescription><pre xml:space="preserve">Some of the various classes available.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::			">Fonts</menunode><menudescription><pre xml:space="preserve">Italic, bold, typewriter, etc.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::			">Layout</menunode><menudescription><pre xml:space="preserve">Controlling the page layout.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::			">Sectioning</menunode><menudescription><pre xml:space="preserve">Parts, Chapters, Sections, etc.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::		">Cross references</menunode><menudescription><pre xml:space="preserve">Automatic referencing.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::		">Environments</menunode><menudescription><pre xml:space="preserve">Such as enumerate &amp; itemize.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::	        ">Line breaking</menunode><menudescription><pre xml:space="preserve">Influencing line breaks.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::	        ">Page breaking</menunode><menudescription><pre xml:space="preserve">Influencing page breaks.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::			">Footnotes</menunode><menudescription><pre xml:space="preserve">How to produce footnotes.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::			">Definitions</menunode><menudescription><pre xml:space="preserve">Define your own commands, etc.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::			">Counters</menunode><menudescription><pre xml:space="preserve">Internal counters used by &latex;.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::			">Lengths</menunode><menudescription><pre xml:space="preserve">The length commands.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::		">Making paragraphs</menunode><menudescription><pre xml:space="preserve">Paragraph commands.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::		">Math formulas</menunode><menudescription><pre xml:space="preserve">How to create mathematical formulas.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::			">Modes</menunode><menudescription><pre xml:space="preserve">Paragraph, Math or LR modes.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::			">Page styles</menunode><menudescription><pre xml:space="preserve">Various styles of page layout.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::		        ">Spaces</menunode><menudescription><pre xml:space="preserve">Horizontal and vertical space.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                       ">Boxes</menunode><menudescription><pre xml:space="preserve">Making boxes.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                       ">Color</menunode><menudescription><pre xml:space="preserve">Defining and using colors.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                    ">Graphics</menunode><menudescription><pre xml:space="preserve">Importing graphics from outside &latex;.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::		">Special insertions</menunode><menudescription><pre xml:space="preserve">Inserting reserved and special characters.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::		">Splitting the input</menunode><menudescription><pre xml:space="preserve">Dealing with big files by splitting.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::		">Front/back matter</menunode><menudescription><pre xml:space="preserve">Tables of contents, glossaries, indexes.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::			">Letters</menunode><menudescription><pre xml:space="preserve">The <code>letter</code> class.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::        	">Input/output</menunode><menudescription><pre xml:space="preserve">User interaction.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::      ">Command line interface</menunode><menudescription><pre xml:space="preserve">Common command-line options.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::          ">Document templates</menunode><menudescription><pre xml:space="preserve">Starter templates for various document classes.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::		        ">Index</menunode><menudescription><pre xml:space="preserve">General index.
</pre></menudescription></menuentry></menu>

</top>
<node name="About-this-document" spaces=" "><nodename>About this document</nodename><nodenext automatic="on">Overview</nodenext><nodeprev automatic="on">Top</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>About this document</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1">home page for manual</indexterm></cindex>
<para>This is an unofficial reference manual for the &latex;2e document
preparation system, which is a macro package for the &tex;
typesetting program (<pxref label="Overview"><xrefnodename>Overview</xrefnodename></pxref>).
</para>
<para>This document&textrsquo;s home page is <url><urefurl>https://latexref.xyz</urefurl></url>; it has
separate web pages for each topic.  Alternatively.
<url><urefurl>https://latexref.xyz/dev/latex2e.html</urefurl></url> has the entire document on
a single page.  For other output formats, the sources, and plenty more
information, see <url><urefurl>https://latexref.xyz/dev/</urefurl></url>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="2">&latex; vs.&noeos; &latex;2e</indexterm></cindex>
<para>In this document, we will mostly just use &textlsquo;&latex;&textrsquo; rather than
&textlsquo;&latex;2e&textrsquo;, since the previous version of &latex;&nbsp;(2.09) was
frozen decades ago.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="3">unofficial nature of this manual</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="4">&latex; Project team</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1" mergedindex="cp"><email><emailaddress>latexrefman&arobase;tug.org</emailaddress></email> <r>email address</r></indexterm></findex>
<para>&latex; is maintained by a group of volunteers
(<url><urefurl>https://latex-project.org</urefurl></url>).  The official documentation written
by the &latex; project is available from their web site.  The present
document is completely unofficial and has not been written or reviewed
by the &latex; maintainers.
<cindex index="cp" spaces=" "><indexterm index="cp" number="5">bug reporting</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="6">reporting bugs</indexterm></cindex>
Do not send bug reports or anything else about this document to them.
Instead, please send all comments to <email><emailaddress>latexrefman&arobase;tug.org</emailaddress></email>.
</para>
<para>This document is a reference, not a tutorial.  There is a vast array
of other information available about &latex;, at all levels.  Here
are a few introductions.
</para>
<table commandarg="url" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="url">https://ctan.org/pkg/latex-doc-ptr</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="2" mergedindex="cp">latex-doc-ptr <r>document</r></indexterm></findex>
<para>Two pages of recommended references to &latex; documentation.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="url">https://ctan.org/pkg/first-latex-doc</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="3" mergedindex="cp">first-latex-doc <r>document</r></indexterm></findex>
<para>Writing your first document, with a bit of both text and math.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="url">https://ctan.org/pkg/lshort</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="4" mergedindex="cp">lshort <r>document</r></indexterm></findex>
<para>A longer introduction to &latex;, translated to many languages.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="url">https://tug.org/begin.html</itemformat></item>
</tableterm><tableitem><para>Introduction to the &tex; system, including &latex;, with further
references.
</para>
</tableitem></tableentry></table>


</chapter>
<node name="Overview" spaces=" "><nodename>Overview</nodename><nodenext automatic="on">Document classes</nodenext><nodeprev automatic="on">About this document</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Overview of &latex;</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="7">overview of &latex;</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="8">basics of &latex;</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="9">Knuth, Donald E.</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="10">Lamport, Leslie</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="11">&latex; overview</indexterm></cindex>

<para>&latex; is a system for typesetting documents.  It was originally
created by Leslie Lamport in 1984, but has been maintained by a group
of volunteers for many years now (<url><urefurl>https://latex-project.org</urefurl></url>).
It is widely used, particularly but not exclusively for mathematical
and technical documents.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="12">UTF-8, default &latex; input encoding</indexterm></cindex>
<para>A &latex; user writes an input file containing text to be typeset
along with interspersed commands. The default encoding for the text is
UTF-8 (as of 2018). The commands specify, for example, how the text
should be formatted. 
</para>
<para>&latex; is implemented as a set of related so-called &textldquo;macros&textrdquo; which
use Donald&nbsp;E. Knuth&textrsquo;s &tex; typesetting program or one of its
derivatives, collectively known as &textldquo;engines&textrdquo;. Thus, the user
produces output, typically PDF, by giving the input file to a &tex;
engine. (The following sections describe all this in more detail.)
</para>
<para>The term &latex; is also sometimes used to mean the language in which
the input document is marked up, that is, to mean the set of commands
available to a &latex; user.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="13">Lamport &tex;</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="14">pronunciation</indexterm></cindex>
<para>The name &latex; is short for &textldquo;Lamport &tex;&textrdquo;.  It is pronounced
LAH-teck or LAY-teck, or sometimes LAY-tecks.  Inside a document,
produce the logo with <code>\LaTeX</code>.  Where use of the logo is not
sensible, such as in plain text, write it as <samp>LaTeX</samp>.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::     ">Starting and ending</menunode><menudescription><pre xml:space="preserve">The standard beginning and end of a document.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::            ">Output files</menunode><menudescription><pre xml:space="preserve">Files produced.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::          ">&tex; engines</menunode><menudescription><pre xml:space="preserve">Programs that can compile &tex; and &latex;.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator=":: ">&latex; command syntax</menunode><menudescription><pre xml:space="preserve">General syntax of &latex; commands.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::             ">Environment</menunode><menudescription><pre xml:space="preserve">An area of the source with distinct behavior.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                    ">CTAN</menunode><menudescription><pre xml:space="preserve">Our repository.
</pre></menudescription></menuentry></menu>


<node name="Starting-and-ending" spaces=" "><nodename>Starting and ending</nodename><nodenext automatic="on">Output files</nodenext><nodeup automatic="on">Overview</nodeup></node>
<section spaces=" "><sectiontitle>Starting and ending</sectiontitle>

<anchor name="Starting-_0026-ending">Starting &amp; ending</anchor><!-- c old name -->
<cindex index="cp" spaces=" "><indexterm index="cp" number="15">starting and ending</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="16">ending and starting</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="17">hello, world</indexterm></cindex>

<para>&latex; files have a simple global structure, with a standard beginning
and ending.  This is a small example.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\documentclass&lbrace;article&rbrace;
\begin&lbrace;document&rbrace;
Hello, \LaTeX\ world.
\end&lbrace;document&rbrace;
</pre></example>

<noindent></noindent>
<para>Every &latex; document has a <code>\begin&lbrace;document&rbrace;</code> line and an
<code>\end&lbrace;document&rbrace;</code> line.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="18">document class, defined</indexterm></cindex>
<noindent></noindent>
<para>Here, the <samp>article</samp> is the <dfn>document class</dfn>.  It is implemented
in a file <file>article.cls</file>.  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 label="Document-classes"><xrefnodename>Document classes</xrefnodename></xref>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="19">preamble, defined</indexterm></cindex>
<para>You can include other &latex; commands between the
<code>\documentclass</code> and the <code>\begin&lbrace;document&rbrace;</code> commands.
This area is called the <dfn>preamble</dfn>.
</para>
<para>The <code>\begin&lbrace;document&rbrace;</code>, <code>\end&lbrace;document&rbrace;</code> pair defines an
<cindex index="cp" spaces=" "><indexterm index="cp" number="20">environment</indexterm></cindex>
<dfn>environment</dfn>; the <samp>document</samp> environment (and no others) is
required in all &latex; documents (<pxref label="document"><xrefnodename>document</xrefnodename></pxref>).  &latex; make
available to you many environments that are documented here
(<pxref label="Environments"><xrefnodename>Environments</xrefnodename></pxref>).  Many more are available to you from external
packages, most importantly those available at CTAN (<pxref label="CTAN"><xrefnodename>CTAN</xrefnodename></pxref>).
</para>
<para>The following sections discuss how to produce PDF or other output from
a &latex; input file.
</para>

</section>
<node name="Output-files" spaces=" "><nodename>Output files</nodename><nodenext automatic="on">&tex; engines</nodenext><nodeprev automatic="on">Starting and ending</nodeprev><nodeup automatic="on">Overview</nodeup></node>
<section spaces=" "><sectiontitle>Output files</sectiontitle>

<para>&latex; produces a main output file and at least two auxiliary files.
The main output file&textrsquo;s name ends in either <file>.dvi</file> or <file>.pdf</file>.
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">.dvi</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="5" mergedindex="cp">.dvi <r>file</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="6" mergedindex="cp">latex <r>command</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="7" mergedindex="cp">xdvi <r>command</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="8" mergedindex="cp">dvips <r>command</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="9" mergedindex="cp">dvipdfmx <r>command</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="10" mergedindex="cp">dvitype <r>command</r></indexterm></findex>
<anchor name="output-files-dvi">output files dvi</anchor>
<para>If &latex; is invoked with the system command <command>latex</command> then it
produces a DeVice Independent file, with extension <file>.dvi</file>.  You
can view this file with a command such as <command>xdvi</command>, or convert
it to a PostScript <code>.ps</code> file with <command>dvips</command> or to a
Portable Document Format <code>.pdf</code> file with <command>dvipdfmx</command>.
The contents of the file can be dumped in human-readable form with
<command>dvitype</command>.  A vast array of other DVI utility programs are
available (<url><urefurl>https://mirror.ctan.org/dviware</urefurl></url>).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">.pdf</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="11" mergedindex="cp">.pdf <r>file</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="21">pdf&tex;</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="12" mergedindex="cp">pdflatex <r>command</r></indexterm></findex>
<anchor name="output-files-pdf">output files pdf</anchor>
<para>If &latex; is invoked via the system command <command>pdflatex</command>,
among other commands (<pxref label="TeX-engines"><xrefnodename>&tex; engines</xrefnodename></pxref>), then the main output is
a Portable Document Format (PDF) file.  Typically this is a
self-contained file, with all fonts and images included.
</para>
</tableitem></tableentry></table>

<para>&latex; always produces at least two additional files.
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">.log</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="22">transcript file</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="23">log file</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="13" mergedindex="cp">.log <r>file</r></indexterm></findex>
<anchor name="output-files-log">output files log</anchor>
<para>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.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">.aux</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="24">auxiliary file</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="14" mergedindex="cp">.aux <r>file</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="25">cross references, resolving</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="26">forward references, resolving</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="27">references, resolving forward</indexterm></cindex>
<anchor name="output-files-aux">output files aux</anchor>
<para>Auxiliary information is used by &latex; for things such as
cross references.  For example, the first time that &latex; finds a
forward reference&textmdash;a cross reference to something that has not yet
appeared in the source&textmdash;it will appear in the output as a doubled
question mark <code>??</code>.  When the referred-to spot does eventually
appear in the source then &latex; writes its location information to
this <code>.aux</code> file.  On the next invocation, &latex; reads the
location information from this file and uses it to resolve the
reference, replacing the double question mark with the remembered
location.
</para>
</tableitem></tableentry></table>

<findex index="fn" spaces=" "><indexterm index="fn" number="15" mergedindex="cp">.lof <r>file</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="28">list of figures file</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="16" mergedindex="cp">.lot <r>file</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="29">list of tables file</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="17" mergedindex="cp">.toc <r>file</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="30">table of contents file</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="31">contents file</indexterm></cindex>
<para>&latex; may produce yet more files, characterized by the filename
ending.  These include a <code>.lof</code> file that is used to make a list of
figures, a <code>.lot</code> file used to make a list of tables, and a
<code>.toc</code> file used to make a table of contents (<pxref label="Table-of-contents-etc_002e"><xrefnodename>Table of
contents etc.</xrefnodename></pxref>).  A particular class may create others; the list is
open-ended.
</para>

</section>
<node name="TeX-engines" spaces=" "><nodename>&tex; engines</nodename><nodenext automatic="on">&latex; command syntax</nodenext><nodeprev automatic="on">Output files</nodeprev><nodeup automatic="on">Overview</nodeup></node>
<section spaces=" "><sectiontitle>&tex; engines</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="32">engines, &tex;</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="33">implementations of &tex;</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="34">UTF-8, engine support for</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="35">Unicode input, native</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="36">TrueType fonts</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="37">OpenType fonts</indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="38">&tex; format (<code>.fmt</code>) files</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="39">&latex; format (<code>.fmt</code>) files</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="40">format files, &tex;</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="18" mergedindex="cp">.fmt <r>file</r></indexterm></findex>
<para>&latex; is a large set of commands that is executed by a &tex;
program (<pxref label="Overview"><xrefnodename>Overview</xrefnodename></pxref>). Such a set of commands is called a
<dfn>format</dfn>, and is embodied in a binary <code>.fmt</code> file, which can
be read much more quickly than the corresponding &tex; source.
</para>
<para>This section gives a terse overview of the &tex; programs that are
commonly available (see also <ref label="Command-line-interface"><xrefnodename>Command line interface</xrefnodename></ref>).
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="19" mergedindex="cp">latex</indexterm>latex</itemformat></item>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="20" mergedindex="cp">pdflatex</indexterm>pdflatex</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="21" mergedindex="cp">etex <r>command</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="41">pdf&tex; engine</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="42">e-&tex;</indexterm></cindex>
<anchor name="tex-engines-latex">tex engines latex</anchor>
<para>In &tex; Live (<url><urefurl>https://tug.org/texlive</urefurl></url>), if &latex; is invoked
via either the system command <command>latex</command> or <command>pdflatex</command>,
then the pdf&tex; engine is run (<url><urefurl>https://ctan.org/pkg/pdftex</urefurl></url>).
When invoked as <command>latex</command>, the main output is a <file>.dvi</file>
file; as <command>pdflatex</command>, the main output is a <file>.pdf</file> file.
</para>
<para>pdf&tex; incorporates the e-&tex; extensions to Knuth&textrsquo;s original
program (<url><urefurl>https://ctan.org/pkg/etex</urefurl></url>), including additional
programming features and bi-directional typesetting, and has plenty of
extensions of its own.  e-&tex; is available on its own as the system
command <command>etex</command>, but this is plain &tex; (and produces
<file>.dvi</file>).
</para>
<para>In other &tex; distributions, <command>latex</command> may invoke e-&tex;
rather than pdf&tex;.  In any case, the e-&tex; extensions can be
assumed to be available in &latex;.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="22" mergedindex="cp">lualatex</indexterm>lualatex</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="43">Lua&tex;</indexterm></cindex>
<anchor name="tex-engines-lualatex">tex engines lualatex</anchor>
<para>If &latex; is invoked via the system command <command>lualatex</command>, the
Lua&tex; engine is run (<url><urefurl>https://ctan.org/pkg/luatex</urefurl></url>).  This
program allows code written in the scripting language Lua
(<url><urefurl>http://luatex.org</urefurl></url>) to interact with &tex;&textrsquo;s typesetting.
Lua&tex; handles UTF-8 Unicode input natively, can handle OpenType
and TrueType fonts, and produces a <file>.pdf</file> file by default.
There is also <command>dvilualatex</command> to produce a <file>.dvi</file> file.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="23" mergedindex="cp">xelatex</indexterm>xelatex</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="44">Xe&tex;</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="24" mergedindex="cp">.xdv <r>file</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="25" mergedindex="cp">xdvipdfmx</indexterm></findex>
<anchor name="tex-engines-xelatex">tex engines xelatex</anchor>
<para>If &latex; is invoked with the system command <command>xelatex</command>, the
Xe&tex; engine is run (<url><urefurl>https://tug.org/xetex</urefurl></url>).  Like Lua&tex;,
Xe&tex; natively supports UTF-8 Unicode and TrueType and OpenType
fonts, though the implementation is completely different, mainly using
external libraries instead of internal code.  Xe&tex; produces a
<file>.pdf</file> file as output; it does not support DVI output.
</para>
<para>Internally, Xe&tex; creates an <code>.xdv</code> file, a variant of DVI,
and translates that to PDF using the (<code>x</code>)<code>dvipdfmx</code>
program, but this process is automatic.  The <code>.xdv</code> file is only
useful for debugging.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="26" mergedindex="cp">platex</indexterm>platex</itemformat></item>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="27" mergedindex="cp">uplatex</indexterm>uplatex</itemformat></itemx>
</tableterm><tableitem><para>These commands provide significant additional support for Japanese and
other languages; the <code>u</code> variant supports Unicode.  See
<url><urefurl>https://ctan.org/pkg/ptex</urefurl></url> and <url><urefurl>https://ctan.org/pkg/uptex</urefurl></url>.
</para></tableitem></tableentry></ftable>

<para>As of 2019, there is a companion <code>-dev</code> command and format for
all of the above:
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="28" mergedindex="cp">dvilualatex-dev</indexterm>dvilualatex-dev</itemformat></item>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="29" mergedindex="cp">latex-dev</indexterm>latex-dev</itemformat></itemx>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="30" mergedindex="cp">lualatex-dev</indexterm>lualatex-dev</itemformat></itemx>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="31" mergedindex="cp">pdflatex-dev</indexterm>pdflatex-dev</itemformat></itemx>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="32" mergedindex="cp">platex-dev</indexterm>platex-dev</itemformat></itemx>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="33" mergedindex="cp">uplatex-dev</indexterm>uplatex-dev</itemformat></itemx>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="34" mergedindex="cp">xelatex-dev</indexterm>xelatex-dev</itemformat></itemx>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="45">release candidates</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="46">prerelease testing</indexterm></cindex>
<para>These are candidates for an upcoming &latex; release. The main
purpose is to find and address compatibility problems before an
official release.
</para>
<para>These <code>-dev</code> formats make it easy for anyone to help test
documents and code: you can run, say, <code>pdflatex-dev</code> instead of
<code>pdflatex</code>, without changing anything else in your environment.
Indeed, it is easiest and most helpful to always run the <code>-dev</code>
versions instead of bothering to switch back and forth. During quiet
times after a release, the commands will be equivalent.
</para>
<para>These are not daily snapshots or untested development code. They
undergo the same extensive regression testing by the &latex; team
before being released.
</para>
<para>For more information, see &textldquo;The &latex; release workflow and the
&latex; <code>dev</code> formats&textrdquo; by Frank Mittelbach, <cite>TUGboat</cite> 40:2,
<url><urefurl>https://tug.org/TUGboat/tb40-2/tb125mitt-dev.pdf</urefurl></url>.
</para>
</tableitem></tableentry></ftable>

</section>
<node name="LaTeX-command-syntax" spaces=" "><nodename>&latex; command syntax</nodename><nodenext automatic="on">Environment</nodenext><nodeprev automatic="on">&tex; engines</nodeprev><nodeup automatic="on">Overview</nodeup></node>
<section spaces=" "><sectiontitle>&latex; command syntax</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="47">command syntax</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="35" mergedindex="cp">\ <r>character starting commands</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="36" mergedindex="cp">[...] <r>for optional arguments</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="37" mergedindex="cp">&lbrace;...&rbrace; <r>for required arguments</r></indexterm></findex>
<para>In the &latex; input file, a command name starts with a backslash
character, <code>\</code>.  The name itself then consists of either
(a)&nbsp;a string of letters or (b)&nbsp;a single non-letter.
</para>
<para>&latex; commands names are case sensitive so that <code>\pagebreak</code>
differs from <code>\Pagebreak</code> (the latter is not a standard command).
Most command names are lowercase, but in any event you must enter all
commands in the same case as they are defined.
</para>
<para>A command may be followed by zero, one, or more arguments. These
arguments may be either required or optional.  Required arguments are
contained in curly braces, <code>&lbrace;...&rbrace;</code>.  Optional arguments are
contained in square brackets, <code>[...]</code>.  Generally, but not
universally, if the command accepts an optional argument, it comes
first, before any required arguments.
</para>
<para>Inside of an optional argument, to use the character close square
bracket&nbsp;(<code>]</code>) hide it inside curly braces, as
in&nbsp;<code>\item[closing bracket &lbrace;]&rbrace;]</code>.  Similarly, if an optional
argument comes last, with no required argument after it, then to make
the first character of the following text be an open square bracket,
hide it inside curly braces.
</para>
<para>&latex; has the convention that some commands have a <code>*</code> form that
is related to the form without a <code>*</code>, such as <code>\chapter</code> and
<code>\chapter*</code>.  The exact difference in behavior varies from command
to command.
</para>
<para>This manual describes all accepted options and <code>*</code>-forms for the
commands it covers (barring unintentional omissions, a.k.a.&noeos; bugs).
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="48"><r>package</r>, <code>expl3</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="49"><code>expl3</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="50"><r>package</r>, <code>xparse</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="51"><code>xparse</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="52">&latex;3 syntax</indexterm></cindex>
<para>As of the 2020-10-01 release of &latex;, the <code>expl3</code> and
<code>xparse</code> packages are part of the &latex;2e format.  They
provide a completely different underlying programming language
syntax. We won&textrsquo;t try to cover them in this document; see the related
package documentation and other &latex; manuals.
</para>
</section>
<node name="Environment" spaces=" "><nodename>Environment</nodename><nodenext automatic="on">CTAN</nodenext><nodeprev automatic="on">&latex; command syntax</nodeprev><nodeup automatic="on">Overview</nodeup></node>
<section spaces=" "><sectiontitle>Environment</sectiontitle>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;<var>environment-name</var>&rbrace;
  ...
\end&lbrace;<var>environment-name</var>&rbrace;
</pre></example>

<para>An <dfn>environment</dfn> is an area of &latex; source, inside of which
there is a distinct behavior.  For instance, for poetry in &latex;
put the lines between <code>\begin&lbrace;verse&rbrace;</code> and <code>\end&lbrace;verse&rbrace;</code>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;verse&rbrace;
  There once was a man from Nantucket \\
  ...
\end&lbrace;verse&rbrace;
</pre></example>

<para><xref label="Environments"><xrefnodename>Environments</xrefnodename></xref>, for a list of environments.  Particularly notable is
that every &latex; document must have a <code>document</code> environment,
a <code>\begin&lbrace;document&rbrace; ... \end&lbrace;document&rbrace;</code> pair.
</para>
<para>The <var>environment-name</var> at the beginning must exactly match that at
the end.  This includes the case where <var>environment-name</var> ends in a
star&nbsp;(<code>*</code>); both the <code>\begin</code> and <code>\end</code> texts must
include the star.
</para>
<para>Environments may have arguments, including optional arguments.  This
example produces a table.  The first argument is optional (and causes
the table to be aligned on its top row) while the second argument is
required (it specifies the formatting of columns).
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;tabular&rbrace;[t]&lbrace;r|l&rbrace;
  ... rows of table ...
\end&lbrace;tabular&rbrace;
</pre></example> 


</section>
<node name="CTAN" spaces=" "><nodename>CTAN</nodename><nodeprev automatic="on">Environment</nodeprev><nodeup automatic="on">Overview</nodeup></node>
<section spaces=" "><sectiontitle>CTAN: The Comprehensive &tex; Archive Network</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="53">CTAN</indexterm></cindex>

<para>The Comprehensive &tex; Archive Network, CTAN, is the &tex; and
&latex; community&textrsquo;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><urefurl>https://ctan.org</urefurl></url>.
</para>
<para>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&textrsquo;s
specifications.
</para>
<para>In addition to the massive holdings, the <code>ctan.org</code> web site
offers features such as search by name or by functionality.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="54">DANTE e.V.</indexterm></cindex>
<para>CTAN is not a single host, but instead is a set of hosts, one of which
is the so-called &textldquo;master&textrdquo;. The master host actively manages the
material, for instance, by accepting uploads of new or updated
packages. For many years, it has been hosted by the German &tex;
group, DANTE e.V.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="55">mirrors of CTAN</indexterm></cindex>
<para>Other sites around the world help out by mirroring, that is,
automatically syncing their collections with the master 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 master
site. The list of mirrors is at <url><urefurl>https://ctan.org/mirrors</urefurl></url>.
</para>

</section>
</chapter>
<node name="Document-classes" spaces=" "><nodename>Document classes</nodename><nodenext automatic="on">Fonts</nodenext><nodeprev automatic="on">Overview</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Document classes</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="56">document classes</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="57">classes of documents</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="38" mergedindex="cp">\documentclass</indexterm></findex>

<para>The document&textrsquo;s overall class is defined with this command, which is
normally the first command in a &latex; source file.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\documentclass[<var>options</var>]&lbrace;<var>class</var>&rbrace;
</pre></example>

<findex index="fn" spaces=" "><indexterm index="fn" number="39" mergedindex="cp">article <r>class</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="40" mergedindex="cp">report <r>class</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="41" mergedindex="cp">book <r>class</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="42" mergedindex="cp">letter <r>class</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="43" mergedindex="cp">slides <r>class</r></indexterm></findex>
<para>The following document <var>class</var> names are built into &latex;.
(Many other document classes are available as separate packages;
<pxref label="Overview"><xrefnodename>Overview</xrefnodename></pxref>.)
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">article</itemformat></item>
</tableterm><tableitem><anchor name="document-classes-article">document classes article</anchor>
<para>For a journal article, a presentation, and miscellaneous general use.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">book</itemformat></item>
</tableterm><tableitem><anchor name="document-classes-book">document classes book</anchor>
<para>Full-length books, including chapters and possibly including front
matter, such as a preface, and back matter, such as an appendix
(<pxref label="Front_002fback-matter"><xrefnodename>Front/back matter</xrefnodename></pxref>).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">letter</itemformat></item>
</tableterm><tableitem><anchor name="document-classes-letter">document classes letter</anchor>
<para>Mail, optionally including mailing labels 
(<pxref label="Letters"><xrefnodename>Letters</xrefnodename></pxref>).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">report</itemformat></item>
</tableterm><tableitem><anchor name="document-classes-report">document classes report</anchor>
<para>For documents of length between an <code>article</code> and a <code>book</code>,
such as technical reports or theses, which may contain several chapters.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">slides</itemformat></item>
</tableterm><tableitem><anchor name="document-classes-slides">document classes slides</anchor>
<para>For slide presentations&textmdash;rarely used nowadays. The
<code>beamer</code> package is perhaps the most prevalent
(<url><urefurl>https://ctan.org/pkg/beamer</urefurl></url>). <xref label="beamer-template"><xrefnodename>beamer template</xrefnodename></xref>, for a
small template for a beamer document.
</para>
</tableitem></tableentry></table>

<para>Standard <var>options</var> are described in the next section.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::   ">Document class options</menunode><menudescription><pre xml:space="preserve">Global options.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::       ">Additional packages</menunode><menudescription><pre xml:space="preserve">Bring in packages.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::   ">Class and package construction</menunode><menudescription><pre xml:space="preserve">Create new classes and packages.
</pre></menudescription></menuentry></menu>


<node name="Document-class-options" spaces=" "><nodename>Document class options</nodename><nodenext automatic="on">Additional packages</nodenext><nodeup automatic="on">Document classes</nodeup></node>
<section spaces=" "><sectiontitle>Document class options</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="58">document class options</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="59">options, document class</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="60">class options</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="61">global options</indexterm></cindex>

<para>You can specify <dfn>global options</dfn> or <dfn>class options</dfn> to the
<code>\documentclass</code> command by enclosing them in square brackets.  To
specify more than one <var>option</var>, separate them with a comma.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\documentclass[<var>option1</var>,<var>option2</var>,...]&lbrace;<var>class</var>&rbrace;
</pre></example>

<para>Here is the list of the standard class options.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="44" mergedindex="cp">10pt <r>option</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="45" mergedindex="cp">11pt <r>option</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="46" mergedindex="cp">12pt <r>option</r></indexterm></findex>
<para>All of the standard classes except <code>slides</code> accept the following
options for selecting the typeface size (default is <code>10pt</code>):
</para>
<example endspaces=" ">
<pre xml:space="preserve">10pt  11pt  12pt
</pre></example>

<findex index="fn" spaces=" "><indexterm index="fn" number="47" mergedindex="cp">a4paper <r>option</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="48" mergedindex="cp">a5paper <r>option</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="49" mergedindex="cp">b5paper <r>option</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="50" mergedindex="cp">executivepaper <r>option</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="51" mergedindex="cp">legalpaper <r>option</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="52" mergedindex="cp">letterpaper <r>option</r></indexterm></findex>
<para>All of the standard classes accept these options for selecting the paper
size (these show height by width):
</para>
<table commandarg="code" spaces=" " endspaces=" "> 
<tableentry><tableterm><item spaces=" "><itemformat command="code">a4paper </itemformat></item>
</tableterm><tableitem><para>210 by 297<dmn>mm</dmn> (about 8.25 by 11.75&nbsp;inches)
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">a5paper </itemformat></item>
</tableterm><tableitem><para>148 by 210<dmn>mm</dmn> (about 5.8 by 8.3&nbsp;inches)
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">b5paper</itemformat></item>
</tableterm><tableitem><para>176 by 250<dmn>mm</dmn> (about 6.9 by 9.8&nbsp;inches)
</para> 
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">executivepaper</itemformat></item>
</tableterm><tableitem><para>7.25 by 10.5&nbsp;inches
</para> 
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">legalpaper</itemformat></item>
</tableterm><tableitem><para>8.5 by 14&nbsp;inches
</para> 
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">letterpaper</itemformat></item>
</tableterm><tableitem><para>8.5 by 11&nbsp;inches (the default)
</para></tableitem></tableentry></table>

<findex index="fn" spaces=" "><indexterm index="fn" number="53" mergedindex="cp">\pdfpagewidth</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="54" mergedindex="cp">\pdfpageheight</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="62"><r>package</r>, <code>geometry</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="63"><code>geometry</code> <r>package</r></indexterm></cindex>

<para>When using one of the engines pdf&latex;, Lua&latex;, or Xe&latex;
(<pxref label="TeX-engines"><xrefnodename>&tex; engines</xrefnodename></pxref>), options other than <code>letterpaper</code> set
the print area but you must also set the physical paper size.  One way
to do that is to put <code>\pdfpagewidth=\paperwidth</code> and
<code>\pdfpageheight=\paperheight</code> in your document&textrsquo;s preamble.
<cindex index="cp" spaces=" "><indexterm index="cp" number="64"><r>package</r>, <code>geometry</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="65"><code>geometry</code> <r>package</r></indexterm></cindex>
</para>
<para>The <code>geometry</code> package provides flexible ways of setting the print
area and physical page size.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="55" mergedindex="cp">draft <r>option</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="56" mergedindex="cp">final <r>option</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="57" mergedindex="cp">fleqn <r>option</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="58" mergedindex="cp">landscape <r>option</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="59" mergedindex="cp">leqno <r>option</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="60" mergedindex="cp">openbib <r>option</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="61" mergedindex="cp">titlepage <r>option</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="62" mergedindex="cp">notitlepage <r>option</r></indexterm></findex>
<para>Miscellaneous other options:
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">draft</itemformat></item>
<itemx spaces=" "><itemformat command="code">final</itemformat></itemx>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="66">black boxes, omitting</indexterm></cindex>
<para>Mark (<code>draft</code>) or do not mark (<code>final</code>) overfull boxes with a
black box in the margin; default is <code>final</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">fleqn</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="67">flush left equations</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="68">centered equations</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="69">equations, flush left vs.&noeos; centered</indexterm></cindex>
<para>Put displayed formulas flush left; default is centered.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">landscape</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="70">landscape orientation</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="71">portrait orientation</indexterm></cindex>
<para>Selects landscape format; default is portrait.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">leqno</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="72">left-hand equation numbers</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="73">right-hand equation numbers</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="74">equation numbers, left vs.&noeos; right</indexterm></cindex>
<para>Put equation numbers on the left side of equations; default is the right side.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">openbib</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="75">bibliography format, open</indexterm></cindex>
<para>Use &textldquo;open&textrdquo; bibliography format.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">titlepage</itemformat></item>
<itemx spaces=" "><itemformat command="code">notitlepage</itemformat></itemx>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="76">title page, separate or run-in</indexterm></cindex>
<para>Specifies whether there is a separate page for the title information and
for the abstract also, if there is one.  The default for the
<code>report</code> class is <code>titlepage</code>, for the other classes it is
<code>notitlepage</code>.
</para></tableitem></tableentry></table>

<para>The following options are not available with the <code>slides</code> class.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="63" mergedindex="cp">onecolumn <r>option</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="64" mergedindex="cp">twocolumn <r>option</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="65" mergedindex="cp">oneside <r>option</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="66" mergedindex="cp">twoside <r>option</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="67" mergedindex="cp">openright <r>option</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="68" mergedindex="cp">openany <r>option</r></indexterm></findex>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">onecolumn</itemformat></item>
<itemx spaces=" "><itemformat command="code">twocolumn</itemformat></itemx>
</tableterm><tableitem><para>Typeset in one or two columns; default is <code>onecolumn</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">oneside</itemformat></item>
<itemx spaces=" "><itemformat command="code">twoside</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="69" mergedindex="cp">\evensidemargin</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="70" mergedindex="cp">\oddsidemargin</indexterm></findex>
<!-- c xx TODO re-align on the French version which is more accurate. -->
<para>Selects one- or two-sided layout; default is <code>oneside</code>, except
that in the <code>book</code> class the default is <code>twoside</code>.
</para>
<para>For one-sided printing, the text is centered on the page.  For two-sided
printing, the <code>\evensidemargin</code> (<code>\oddsidemargin</code>) parameter
determines the distance on even (odd) numbered pages between the left
side of the page and the text&textrsquo;s left margin, with <code>\oddsidemargin</code>
being 40% of the difference between <code>\paperwidth</code> and
<code>\textwidth</code>, and <code>\evensidemargin</code> is the remainder.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">openright</itemformat></item>
<itemx spaces=" "><itemformat command="code">openany</itemformat></itemx>
</tableterm><tableitem><para>Determines if a chapter should start on a right-hand page; default is
<code>openright</code> for <code>book</code>, and <code>openany</code> for <code>report</code>.
</para></tableitem></tableentry></table>

<findex index="fn" spaces=" "><indexterm index="fn" number="71" mergedindex="cp">clock <r>option to <code>slides</code> class</r></indexterm></findex>
<para>The <code>slides</code> class offers the option <code>clock</code> for printing
the time at the bottom of each note.
</para>

</section>
<node name="Additional-packages" spaces=" "><nodename>Additional packages</nodename><nodenext automatic="on">Class and package construction</nodenext><nodeprev automatic="on">Document class options</nodeprev><nodeup automatic="on">Document classes</nodeup></node>
<section spaces=" "><sectiontitle>Additional packages</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="77">loading additional packages</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="78">packages, loading additional</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="79">additional packages, loading</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="72" mergedindex="cp">\usepackage</indexterm></findex>
<para>Load a package <var>pkg</var>, with the package options given in the comma-separated
list <var>options</var>, as here.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage[<var>options</var>]&lbrace;<var>pkg</var>&rbrace;.
</pre></example>

<para>To specify more than one package you can separate them with a comma,
as in <code>\usepackage&lbrace;<var>pkg1</var>,<var>pkg2</var>,...&rbrace;</code>, or use multiple
<code>\usepackage</code> commands.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="80">global options</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="81">options, global</indexterm></cindex>
<para>Any options given in the <code>\documentclass</code> command that are unknown
to the selected document class are passed on to the packages loaded with
<code>\usepackage</code>.
</para>

</section>
<node name="Class-and-package-construction" spaces=" "><nodename>Class and package construction</nodename><nodeprev automatic="on">Additional packages</nodeprev><nodeup automatic="on">Document classes</nodeup></node>
<section spaces=" "><sectiontitle>Class and package construction</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="82">document class commands</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="83">commands, document class</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="84">new class commands</indexterm></cindex>

<para>You can create new document classes and new packages.  For instance, if
your memos must satisfy some local requirements, such as a
standard header for each page, then you could create a new class
<code>smcmemo.cls</code> and begin your documents with
<code>\documentclass&lbrace;smcmemo&rbrace;</code>.
</para>
<para>What separates a package from a document class is that the commands in a
package are useful across classes while those in a document class are
specific to that class.  Thus, a command to set page headers is for a
package while a command to make the page headers say <code>Memo from the
SMC Math Department</code> is for a class.
<cindex index="cp" spaces=" "><indexterm index="cp" number="85">class and package difference</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="86">difference between class and package</indexterm></cindex>
</para>
<para>Inside of a class or package file you can use the at-sign <code>&arobase;</code> as a
character in command names without having to surround the code
containing that command with <code>\makeatletter</code> and
<code>\makeatother</code>.  <xref label="_005cmakeatletter-_0026-_005cmakeatother"><xrefnodename>\makeatletter &amp; \makeatother</xrefnodename></xref>. 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
others. For instance, the class <code>smcmemo</code> might have commands
<code>\smc&arobase;tolist</code>, <code>\smc&arobase;fromlist</code>, etc.
</para>

<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::     ">Class and package structure</menunode><menudescription><pre xml:space="preserve">Layout of the file.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::      ">Class and package commands</menunode><menudescription><pre xml:space="preserve">List of commands.
</pre></menudescription></menuentry></menu>


<node name="Class-and-package-structure" spaces=" "><nodename>Class and package structure</nodename><nodenext automatic="on">Class and package commands</nodenext><nodeup automatic="on">Class and package construction</nodeup></node>
<subsection spaces=" "><sectiontitle>Class and package structure</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="87">class and package structure</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="88">class file layout</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="89">package file layout</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="90">options, document class</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="91">options, package</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="92">class options</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="93">package options</indexterm></cindex>

<para>A class file or package file typically has four parts.  
</para><enumerate first="1" endspaces=" ">
<listitem>
<para>In the <dfn>identification part</dfn>, the file says that it is a &latex;
package or class and describes itself, using the <code>\NeedsTeXFormat</code>
and <code>\ProvidesClass</code> or <code>\ProvidesPackage</code> commands.
</para>
</listitem><listitem>
<para>The <dfn>preliminary declarations part</dfn> declares some commands and
can also load other files. Usually these commands will be those needed
for the code used in the next part.  For example, an <code>smcmemo</code>
class might be called with an option to read in a file with a list of
people for the to-head, as <code>\documentclass[mathto]&lbrace;smcmemo&rbrace;</code>, and
therefore needs to define a command
<code>\newcommand&lbrace;\setto&rbrace;[1]&lbrace;\def\&arobase;tolist&lbrace;#1&rbrace;&rbrace;</code> used in that
file.
</para>
</listitem><listitem>
<para>In the <dfn>handle options part</dfn> the class or package declares
and processes its options.  Class options allow a user to start their
document as <code>\documentclass[<var>option list</var>]&lbrace;<var>class
name</var>&rbrace;</code>, to modify the behavior of the class.  An example is when you
declare <code>\documentclass[11pt]&lbrace;article&rbrace;</code> to set the default
document font size.  
</para>
</listitem><listitem>
<para>Finally, in the <dfn>more declarations part</dfn> the class or package
usually does most of its work: declaring new variables, commands and
fonts, and loading other files.
</para></listitem></enumerate>

<para>Here is a starting class file, which should be saved as <file>stub.cls</file>
where &latex; can find it, for example in the same directory as the
<file>.tex</file> file.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\NeedsTeXFormat&lbrace;LaTeX2e&rbrace;
\ProvidesClass&lbrace;stub&rbrace;[2017/07/06 stub to start building classes from]
\DeclareOption*&lbrace;\PassOptionsToClass&lbrace;\CurrentOption&rbrace;&lbrace;article&rbrace;&rbrace;
\ProcessOptions\relax
\LoadClass&lbrace;article&rbrace;
</pre></example>
<cindex index="cp" spaces=" "><indexterm index="cp" number="94">class file example</indexterm></cindex>

<noindent></noindent>
<para>It identifies itself, handles the class options via the default of
passing them all to the <code>article</code> class, and then loads the
<code>article</code> class to provide the basis for this class&textrsquo;s code.
</para>
<para>For more, see the official guide for class and package writers, the
Class Guide, at
<url><urefurl>https://www.latex-project.org/help/documentation/clsguide.pdf</urefurl></url> (much
of the descriptions here derive from this document), or the tutorial
<url><urefurl>https://www.tug.org/TUGboat/tb26-3/tb84heff.pdf</urefurl></url>.
</para>

</subsection>
<node name="Class-and-package-commands" spaces=" "><nodename>Class and package commands</nodename><nodeprev automatic="on">Class and package structure</nodeprev><nodeup automatic="on">Class and package construction</nodeup></node>
<subsection spaces=" "><sectiontitle>Class and package commands</sectiontitle>
<cindex index="cp" spaces=" "><indexterm index="cp" number="95">class and package commands</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="96">commands, class and package</indexterm></cindex>

<para>These are the commands designed to help writers of classes or packages.
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">\AtBeginDvi&lbrace;specials&rbrace;</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="73" mergedindex="cp">\AtBeginDvi</indexterm></findex>
<para>Save in a box register things that are written to the <file>.dvi</file> file
at the beginning of the shipout of the first page of the document.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\AtEndOfClass&lbrace;<var>code</var>&rbrace;</itemformat></item>
</tableterm></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\AtEndOfPackage&lbrace;<var>code</var>&rbrace;</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="74" mergedindex="cp">\AtEndOfClass</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="75" mergedindex="cp">\AtEndOfPackage</indexterm></findex>
<para>Hook to insert <var>code</var> to be executed when &latex; finishes
processing the current class or package.  You can use these hooks
multiple times; the <code>code</code> will be executed in the order that you
called it.  See also <ref label="_005cAtBeginDocument"><xrefnodename>\AtBeginDocument</xrefnodename></ref>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\CheckCommand&lbrace;<var>cmd</var>&rbrace;[<var>num</var>][<var>default</var>]&lbrace;<var>definition</var>&rbrace;</itemformat></item>
</tableterm></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\CheckCommand*&lbrace;<var>cmd</var>&rbrace;[<var>num</var>][<var>default</var>]&lbrace;<var>definition</var>&rbrace;</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="76" mergedindex="cp">\CheckCommand</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="77" mergedindex="cp">\CheckCommand*</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="97">new command, check</indexterm></cindex>
<para>Like <code>\newcommand</code> (<pxref label="_005cnewcommand-_0026-_005crenewcommand"><xrefnodename>\newcommand &amp; \renewcommand</xrefnodename></pxref>) but does
not define <var>cmd</var>; instead it checks that the current definition of
<var>cmd</var> is exactly as given by <var>definition</var> and is or is not 
<cindex index="cp" spaces=" "><indexterm index="cp" number="98">long command</indexterm></cindex>
<dfn>long</dfn> as expected.  A long command is a command that accepts
<code>\par</code> within an argument.  The <var>cmd</var> command is expected to be
long with the unstarred version of <code>\CheckCommand</code>.  Raises an
error when the check fails.  This allows you to check before you start
redefining <code>cmd</code> yourself that no other package has already
redefined this command.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\ClassError&lbrace;<var>class name</var>&rbrace;&lbrace;<var>error text</var>&rbrace;&lbrace;<var>help text</var>&rbrace;</itemformat></item>
</tableterm></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\PackageError&lbrace;<var>package name</var>&rbrace;&lbrace;<var>error text</var>&rbrace;&lbrace;<var>help text</var>&rbrace;</itemformat></item>
</tableterm></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\ClassWarning&lbrace;<var>class name</var>&rbrace;&lbrace;<var>warning text</var>&rbrace;</itemformat></item>
</tableterm></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\PackageWarning&lbrace;<var>package name</var>&rbrace;&lbrace;<var>warning text</var>&rbrace;</itemformat></item>
</tableterm></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\ClassWarningNoLine&lbrace;<var>class name</var>&rbrace;&lbrace;<var>warning text</var>&rbrace;</itemformat></item>
</tableterm></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\PackageWarningNoLine&lbrace;<var>package name</var>&rbrace;&lbrace;<var>warning text</var>&rbrace;</itemformat></item>
</tableterm></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\ClassInfo&lbrace;<var>class name</var>&rbrace;&lbrace;<var>info text</var>&rbrace;</itemformat></item>
</tableterm></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\PackageInfo&lbrace;<var>package name</var>&rbrace;&lbrace;<var>info text</var>&rbrace;</itemformat></item>
</tableterm></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\ClassInfoNoLine&lbrace;<var>class name</var>&rbrace;&lbrace;<var>info text</var>&rbrace;</itemformat></item>
</tableterm></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\PackageInfoNoLine&lbrace;<var>package name</var>&rbrace;&lbrace;<var>info text</var>&rbrace;</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="78" mergedindex="cp">\ClassError</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="79" mergedindex="cp">\PackageError</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="80" mergedindex="cp">\ClassWarning</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="81" mergedindex="cp">\PackageWarning</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="82" mergedindex="cp">\ClassWarningNoLine</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="83" mergedindex="cp">\PackageWarningNoLine</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="84" mergedindex="cp">\ClassInfo</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="85" mergedindex="cp">\PackageInfo</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="86" mergedindex="cp">\ClassInfoNoLine</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="87" mergedindex="cp">\PackageInfoNoLine</indexterm></findex>
<para>Produce an error message, or warning or informational messages.
</para>
<para>For <code>\ClassError</code> and <code>\PackageError</code> the message is
<var>error text</var>, followed by &tex;&textrsquo;s <code>?</code> error prompt. If the
user then asks for help by typing <code>h</code>, they see the <var>help
text</var>.
</para>
<para>The four warning commands are similar except that they write
<var>warning text</var> on the screen with no error prompt.  The four info
commands write <var>info text</var> only in the transcript file.  The
<code>NoLine</code> versions do not show the number of the line generating the
message, while the other versions do show that number.
</para>
<para>To format the messages, including the <var>help text</var>: use
<code>\protect</code> to stop a command from expanding, get a line break with
<code>\MessageBreak</code>, and get a space with <code>\space</code> when a space
character does not allow it, like after a command.  Note that &latex;
appends a period to the messages.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\CurrentOption</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="88" mergedindex="cp">\CurrentOption</indexterm></findex>
<para>Expands to the name of the currently-being-processed option.  Can only
be used within the <var>code</var> argument of either <code>\DeclareOption</code>
or <code>\DeclareOption*</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\DeclareOption&lbrace;<var>option</var>&rbrace;&lbrace;<var>code</var>&rbrace;</itemformat></item>
</tableterm></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\DeclareOption*&lbrace;<var>code</var>&rbrace;</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="89" mergedindex="cp">\DeclareOption</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="90" mergedindex="cp">\DeclareOption*</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="99">class options</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="100">package options</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="101">options, class</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="102">options, package</indexterm></cindex>
<para>Make an option available to a user to invoke in their
<code>\documentclass</code> command.  For example, the <code>smcmemo</code> class
could have an option <code>\documentclass[logo]&lbrace;smcmemo&rbrace;</code> allowing
users to put the institutional logo on the first page.  The class file
must contain <code>\DeclareOption&lbrace;logo&rbrace;&lbrace;<var>code</var>&rbrace;</code> (and later,
<code>\ProcessOptions</code>).
</para>
<para>If you request an option that has not been declared, by default this
will produce a warning like <code>Unused global option(s):
[badoption].</code>  Change this behavior with the starred version
<code>\DeclareOption*&lbrace;<var>code</var>&rbrace;</code>.  For example, many classes
extend an existing class, using a command such as
<code>\LoadClass&lbrace;article&rbrace;</code>, and for passing extra options to the
underlying class use code such as this.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareOption*&lbrace;%
\PassOptionsToClass&lbrace;\CurrentOption&rbrace;&lbrace;article&rbrace;%
&rbrace;
</pre></example>

<para>Another example is that the class <code>smcmemo</code> may allow users to keep
lists of memo recipients in external files.  Then the user could invoke
<code>\documentclass[math]&lbrace;smcmemo&rbrace;</code> and it will read the file
<code>math.memo</code>.  This code handles the file if it exists and otherwise
passes the option to the <code>article</code> class.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareOption*&lbrace;\InputIfFileExists&lbrace;\CurrentOption.memo&rbrace;&lbrace;&rbrace;&lbrace;%
    \PassOptionsToClass&lbrace;\CurrentOption&rbrace;&lbrace;article&rbrace;&rbrace;&rbrace;
</pre></example>

</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\DeclareRobustCommand&lbrace;<var>cmd</var>&rbrace;[<var>num</var>][<var>default</var>]&lbrace;<var>definition</var>&rbrace; </itemformat></item>
</tableterm></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\DeclareRobustCommand*&lbrace;<var>cmd</var>&rbrace;[<var>num</var>][<var>default</var>]&lbrace;<var>definition</var>&rbrace;</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="91" mergedindex="cp">\DeclareRobustCommand</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="92" mergedindex="cp">\DeclareRobustCommand*</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="103">new command, definition</indexterm></cindex>
<para>Like <code>\newcommand</code> and <code>\newcommand*</code> (<pxref label="_005cnewcommand-_0026-_005crenewcommand"><xrefnodename>\newcommand &amp;
\renewcommand</xrefnodename></pxref>) but these declare a robust command, even if some code
within the <var>definition</var> is fragile.  (For a discussion of robust and
fragile commands <pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>.) Use this command to define new
robust commands or to redefine existing commands and make them
robust. Unlike <code>\newcommand</code> these do not give an error if macro
<var>cmd</var> already exists; instead, a log message is put into the
transcript file if a command is redefined.
</para>
<para>Commands defined this way are a bit less efficient than those defined
using <code>\newcommand</code> so unless the command&textrsquo;s data is fragile and the
command is used within a moving argument, use <code>\newcommand</code>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="104"><r>package</r>, <code>etoolbox</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="105"><code>etoolbox</code> <r>package</r></indexterm></cindex>
 <para>The <code>etoolbox</code> package offers the commands
<code>\newrobustcmd</code>, <code>\newrobustcmd*</code>, as well as the commands
<code>\renewrobustcmd</code>, <code>\renewrobustcmd*</code>, and the commands
<code>\providerobustcmd</code>, and <code>\providerobustcmd*</code>.  These are
similar to <code>\newcommand</code>, <code>\newcommand*</code>,
<code>\renewcommand</code>, <code>\renewcommand*</code>, <code>\providecommand</code>, and
<code>\providecommand*</code>, but define a robust <var>cmd</var> with two
advantages as compared to <code>\DeclareRobustCommand</code>:
</para><enumerate first="1" endspaces=" ">
<listitem>
<para>They use the low-level e-&tex; protection mechanism rather than the
higher level &latex; <code>\protect</code> mechanism, so they do not incur
the slight loss of performance mentioned above, and
</para></listitem><listitem>
<para>They make the same distinction between <code>\new&dots;</code>,
<code>\renew&dots;</code>, and <code>\provide&dots;</code>, as the standard
commands, so they do not just make a log message when you redefine
<var>cmd</var> that already exists, in that case you need to use either
<code>\renew&dots;</code> or <code>\provide&dots;</code> or you get an error.
</para></listitem></enumerate>


</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\IfFileExists&lbrace;<var>filename</var>&rbrace;&lbrace;<var>true code</var>&rbrace;&lbrace;<var>false code</var>&rbrace;</itemformat></item>
</tableterm></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\InputIfFileExists&lbrace;<var>filename</var>&rbrace;&lbrace;<var>true code</var>&rbrace;&lbrace;<var>false code</var>&rbrace;</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="93" mergedindex="cp">\IfFileExists</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="94" mergedindex="cp">\InputIfFileExists</indexterm></findex>
<para>Execute <var>true code</var> if &latex; finds the file <file><var>file
name</var></file> or <var>false code</var> otherwise.  In the first case it executing
<var>true code</var> and then inputs the file.  Thus the command
</para>
<example endspaces=" ">
<pre xml:space="preserve">\IfFileExists&lbrace;img.pdf&rbrace;&lbrace;%
  \includegraphics&lbrace;img.pdf&rbrace;&rbrace;&lbrace;\typeout&lbrace;!! img.pdf not found&rbrace;
</pre></example>

<noindent></noindent>
<para>will include the graphic <file>img.pdf</file> if it is found and otherwise
give a warning.
</para>
<para>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
directory do something like <code>\IfFileExists&lbrace;./filename&rbrace;&lbrace;<var>true
code</var>&rbrace;&lbrace;<var>false code</var>&rbrace;</code>.  If you ask for a filename without a
<code>.tex</code> extension then &latex; will first look for the file by
appending the <code>.tex</code>; for more on how &latex; handles file
extensions see <ref label="_005cinput"><xrefnodename>\input</xrefnodename></ref>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\LoadClass[<var>options list</var>]&lbrace;<var>class name</var>&rbrace;[<var>release date</var>]</itemformat></item>
</tableterm></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\LoadClassWithOptions&lbrace;<var>class name</var>&rbrace;[<var>release date</var>]</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="95" mergedindex="cp">\LoadClass</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="96" mergedindex="cp">\LoadClassWithOptions</indexterm></findex>
<para>Load a class, as with <code>\documentclass[<var>options
list</var>]&lbrace;<var>class name</var>&rbrace;[<var>release info</var>]</code>.  An example is
<code>\LoadClass[twoside]&lbrace;article&rbrace;</code>.
</para>
<para>The <var>options list</var>, if present, is a comma-separated list.  The
<var>release date</var> is optional.  If present it must have the form
<var>YYYY/MM/DD</var>.
<!-- c BTW, there are at-macros documented in macros2e.pdf to check the version -->
<!-- c and do some actions conditionnally on version later or not to some -->
<!-- c date. -->
</para>
<para>If you request a <var>release date</var> 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.
</para>
<example endspaces=" ">
<pre xml:space="preserve">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.
</pre></example>

<para>The command version <code>\LoadClassWithOptions</code> uses the list of
options for the current class.  This means it ignores any options passed
to it via <code>\PassOptionsToClass</code>.  This is a convenience command
that lets you build classes on existing ones, such as the standard
<code>article</code> class, without having to track which options were passed.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\ExecuteOptions&lbrace;<var>options-list</var>&rbrace;</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="97" mergedindex="cp">\ExecuteOptions</indexterm></findex>
<para>For each option <var>option</var> in the <var>options-list</var>, in order, this command
executes the command <code>\ds&arobase;<var>option</var></code>.  If this command is not
defined then that option is silently ignored.
</para>
<para>It can be used to provide a default option list before
<code>\ProcessOptions</code>.  For example, if in a class file you want the
default to be 11pt fonts then you could specify
<code>\ExecuteOptions&lbrace;11pt&rbrace;\ProcessOptions\relax</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\NeedsTeXFormat&lbrace;<var>format</var>&rbrace;[<var>format date</var>]</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="98" mergedindex="cp">\NeedsTeXFormat</indexterm></findex>
<para>Specifies the format that this class must be run under.  Often issued
as the first line of a class file, and most often used as:
<code>\NeedsTeXFormat&lbrace;LaTeX2e&rbrace;</code>.  When a document using that class is
processed, the format name given here must match the format that is
actually being run (including that the <var>format</var> string is case
sensitive).  If it does not match then execution stops with an error
like <samp>This file needs format `LaTeX2e' but this is `xxx'.</samp>
</para>
<para>To specify a version of the format that you know to have certain
features, include the optional <var>format date</var> on which those features
were implemented.  If present it must be in the form <code>YYYY/MM/DD</code>.
If the format version installed on your system is earlier than
<var>format date</var> then you get a warning like this.
</para>
<example endspaces=" ">
<pre xml:space="preserve">You have requested release `2038/01/20' of LaTeX, but only
release `2016/02/01' is available.
</pre></example>

</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\OptionNotUsed</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="99" mergedindex="cp">\OptionNotUsed</indexterm></findex>
<para>Adds the current option to the list of unused options.  Can only be used
within the <var>code</var> argument of either <code>\DeclareOption</code> or
<code>\DeclareOption*</code>.
</para>
<!-- c I cannot reproduce this behavior as it is documented in clsguide. -->
<!-- c In the absence of a @code{\DeclareOption*} declaration, @LaTeX{} issues -->
<!-- c on the console a warning like @code{LaTeX Warning: Unused global -->
<!-- c option(s): [unusedoption].} with the list of not-used options when it -->
<!-- c reaches @code{\begin@{document@}}. -->

</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\PassOptionsToClass&lbrace;<var>option list</var>&rbrace;&lbrace;<var>class name</var>&rbrace;</itemformat></item>
</tableterm></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\PassOptionsToPackage&lbrace;<var>option list</var>&rbrace;&lbrace;<var>package name</var>&rbrace;</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="100" mergedindex="cp">\PassOptionsToClass</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="101" mergedindex="cp">\PassOptionsToPackage</indexterm></findex>
<para>Adds the options in the comma-separated list <var>option list</var> to the
options used by any future <code>\RequirePackage</code> or <code>\usepackage</code>
command for package <var>package name</var> or the class <var>class name</var>.
</para>
<para>The reason for these commands is: you may load a package any number of
times with no options but if you want options then you may only supply
them when you first load the package.  Loading a package with options
more than once will get you an error like <code>Option clash for package
foo.</code> (&latex; throws an error even if there is no conflict between the
options.)
</para>
<para>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]&lbrace;geometry&rbrace;</code> and
<code>\RequirePackage[margins=1in]&lbrace;geometry&rbrace;</code> with the single command
<code>\RequirePackage[landscape,margins=1in]&lbrace;geometry&rbrace;</code>.
</para>
<para>However, imagine that you are loading <file>firstpkg</file> and inside that
package it loads <file>secondpkg</file>, and you need the second package to be
loaded with option <code>draft</code>.  Then before doing the first package
you must queue up the options for the second package, like this.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\PassOptionsToPackage&lbrace;draft&rbrace;&lbrace;secondpkg&rbrace;
\RequirePackage&lbrace;firstpkg&rbrace;
</pre></example>

<noindent></noindent>
<para>(If <code>firstpkg.sty</code> loads an option in conflict with what you want
then you may have to alter its source.)
</para>
<para>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</code>
package with the option <code>draft</code> and also wants to use a class
<code>foo</code> that loads the <code>graphicx</code> package, but without that
option. The user could start their &latex; file with
<code>\PassOptionsToPackage&lbrace;draft&rbrace;&lbrace;graphicx&rbrace;\documentclass&lbrace;foo&rbrace;</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\ProcessOptions</itemformat></item>
</tableterm></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\ProcessOptions*<var>\&arobase;options</var></itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="102" mergedindex="cp">\ProcessOptions</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="103" mergedindex="cp">\ProcessOptions*</indexterm></findex>
<para>Execute the code for each option that the user has invoked.  Include it
in the class file as <code>\ProcessOptions\relax</code> (because of the
existence of the starred command).
</para>
<para>Options come in two types.  <dfn>Local options</dfn> have been specified for this
particular package in the <var>options</var> argument of
<code>\PassOptionsToPackage&lbrace;<var>options</var>&rbrace;</code>,
<code>\usepackage[<var>options</var>]</code>, or
<code>\RequirePackage[<var>options</var>]</code>.  <dfn>Global options</dfn> are those given
by the class user in <code>\documentclass[<var>options</var>]</code> (If an option
is specified both locally and globally then it is local.)
</para>
<para>When <code>\ProcessOptions</code> is called for a package <file>pkg.sty</file>, the
following happens:
</para><enumerate first="1" endspaces=" ">
<listitem>
<para>For each option <var>option</var> so far declared
with <code>\DeclareOption</code>, it looks to see if that option is either a
global or a local option for <code>pkg</code>. If so then it executes the
declared code.  This is done in the order in which these options were
given in <file>pkg.sty</file>.
</para></listitem><listitem>
<para>For each remaining local option, it executes the command
<code>\ds&arobase;</code><var>option</var> if it has been defined somewhere (other than by
a <code>\DeclareOption</code>); otherwise, it executes the default option code
given in <code>\DeclareOption*</code>. If no default option code has been
declared then it gives an error message.  This is done in the order in
which these options were specified.
</para></listitem></enumerate>

<para>When <code>\ProcessOptions</code> is called for a class it works in the same
way except that all options are local, and the default <var>code</var> for
<code>\DeclareOption*</code> is <code>\OptionNotUsed</code> rather than an error.
</para>
<para>The starred version <code>\ProcessOptions*</code> executes the
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.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\ProvidesClass&lbrace;<var>class name</var>&rbrace;[<var>release date</var> <var>brief additional information</var>]</itemformat></item>
</tableterm></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\ProvidesClass&lbrace;<var>class name</var>&rbrace;[<var>release date</var>]</itemformat></item>
</tableterm></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\ProvidesPackage&lbrace;<var>package name</var>&rbrace;[<var>release date</var> <var>brief additional information</var>]</itemformat></item>
</tableterm></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\ProvidesPackage&lbrace;<var>package name</var>&rbrace;[<var>release date</var>]</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="104" mergedindex="cp">\ProvidesClass</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="105" mergedindex="cp">\ProvidesPackage</indexterm></findex>
<para>Identifies the class or package, printing a message to the screen and
the log file.
</para>
<para>When you load a class or package, for example with
<code>\documentclass&lbrace;smcmemo&rbrace;</code> or <code>\usepackage&lbrace;test&rbrace;</code>, &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&lbrace;smcmemo&rbrace;</code>, and the file <file>smcmemo.cls</file> has
the statement <code>\ProvidesClass&lbrace;xxx&rbrace;</code> then you get a warning like
<code>You have requested document class `smcmemo', but the document
class provides 'xxx'.</code>  This warning does not prevent &latex; from
processing the rest of the class file normally.
</para>
<para>If you include the optional argument then you must include a date,
before any spaces, of the form <code>YYYY/MM/DD</code>. 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</file> contains the line
<code>\ProvidesClass&lbrace;smcmemo&rbrace;[2008/06/01 v1.0 SMC memo class]</code> and
your document&textrsquo;s first line is <code>\documentclass&lbrace;smcmemo&rbrace;</code> then you
will see <code>Document Class: smcmemo 2008/06/01 v1.0 SMC memo class</code>.
</para>
<para>The date in the optional argument allows class and package users to ask
to be warned if the version of the class or package is earlier than
<var>release date</var>.  For instance, a user could enter
<code>\documentclass&lbrace;smcmemo&rbrace;[2018/10/12]</code> or
<code>\usepackage&lbrace;foo&rbrace;[[2017/07/07]]</code> 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.)
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\ProvidesFile&lbrace;<var>filename</var>&rbrace;[<var>additional information</var>]</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="106" mergedindex="cp">\ProvidesFile</indexterm></findex>
<para>Declare a file other than the main class and package files, such as
configuration files or font definition files.  Put this command in that
file and you get in the log a string like <code>File: test.config
2017/10/12 config file for test.cls</code> for <var>filename</var> equal to
<samp>test.config</samp> and <var>additional information</var> equal to
<samp>2017/10/12 config file for test.cls</samp>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\RequirePackage[<var>option list</var>]&lbrace;<var>package name</var>&rbrace;[<var>release date</var>]</itemformat></item>
</tableterm></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\RequirePackageWithOptions&lbrace;<var>package name</var>&rbrace;[<var>release date</var>]</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="107" mergedindex="cp">\RequirePackage</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="108" mergedindex="cp">\RequirePackageWithOptions</indexterm></findex>
<para>Load a package, like the command <code>\usepackage</code> (<pxref label="Additional-packages"><xrefnodename>Additional
packages</xrefnodename></pxref>). The &latex; development team strongly recommends use of
these commands over Plain&nbsp;&tex;&textrsquo;s <code>\input</code>; see the Class
Guide.  An example is
<code>\RequirePackage[landscape,margin=1in]&lbrace;geometry&rbrace;</code>.
</para>
<para>The <var>option list</var>, if present, is a comma-separated list.  The
<var>release date</var>, if present, must have the form <var>YYYY/MM/DD</var>.  If
the release date of the package as installed on your system is earlier
than <var>release date</var> then you get a warning like <code>You have
requested, on input line 9, version `2017/07/03' of package jhtest, but
only version `2000/01/01' is available</code>.
</para>
<para>The <code>\RequirePackageWithOptions</code> version uses the list of options
for the current class.  This means it ignores any options passed to it
via <code>\PassOptionsToClass</code>.  This is a convenience command to allow
easily building classes on existing ones without having to track which
options were passed.
</para>
<para>The difference between <code>\usepackage</code> and <code>\RequirePackage</code> is
small.  The <code>\usepackage</code> command is intended for the document file
while <code>\RequirePackage</code> is intended for package and class files.
Thus, using <code>\usepackage</code> before the <code>\documentclass</code> command
causes &latex; to give error like <code>\usepackage before
\documentclass</code>, but you can use <code>\RequirePackage</code> there.
</para></tableitem></tableentry></table>


</subsection>
</section>
</chapter>
<node name="Fonts" spaces=" "><nodename>Fonts</nodename><nodenext automatic="on">Layout</nodenext><nodeprev automatic="on">Document classes</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Fonts</sectiontitle>
<anchor name="Typefaces">Typefaces</anchor><!-- c old name -->

<cindex index="cp" spaces=" "><indexterm index="cp" number="106">typefaces</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="107">fonts</indexterm></cindex>

<para>&latex; comes with powerful font capacities.  For one thing, its New
Font Selection Scheme allows you to work easily with the font families
in your document (for instance, see&nbsp;<ref label="Font-styles"><xrefnodename>Font styles</xrefnodename></ref>).  And,
&latex; documents can use most fonts that are available today,
including versions of Times Roman, Helvetica, Courier, etc.  (Note,
though, that many fonts do not have support for mathematics.)
</para>
<para>The first typeface in the &tex; world was the Computer Modern family,
developed by Donald Knuth.  It is the default for &latex; documents and
is still the most widely used.  But changing to another font often only
involves a few commands.  For instance, putting the following in your
preamble gives you a Palatino-like font, which is handsome and more
readable online than many other fonts, while still allowing you to
typeset mathematics.  (This example is from Michael Sharpe,
<url><urefurl>https://math.ucsd.edu/~msharpe/RcntFnts.pdf</urefurl></url>.)
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage[osf]&lbrace;newpxtext&rbrace; % osf for text, not math
\usepackage&lbrace;cabin&rbrace; % sans serif
\usepackage[varqu,varl]&lbrace;inconsolata&rbrace; % sans serif typewriter
\usepackage[bigdelims,vvarbb]&lbrace;newpxmath&rbrace; % bb from STIX
\usepackage[cal=boondoxo]&lbrace;mathalfa&rbrace; % mathcal
</pre></example>

<noindent></noindent>
<para>In addition, the <command>xelatex</command> or <command>lualatex</command> engines allow
you to use any fonts on your system that are in OpenType or TrueType
format (<pxref label="TeX-engines"><xrefnodename>&tex; engines</xrefnodename></pxref>).
</para>
<para>The &latex; Font Catalogue (<url><urefurl>https://tug.org/FontCatalogue</urefurl></url>) shows
font sample graphics and copy-and-pasteable source to use many fonts,
including many with support for mathematics.  It aims to cover all Latin
alphabet free fonts available for easy use with &latex;.
</para>
<para>More information is also available from the &tex; Users Group, at
<url><urefurl>https://www.tug.org/fonts/</urefurl></url>.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::             ">fontenc package</menunode><menudescription><pre xml:space="preserve">Encoding of the font.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                 ">Font styles</menunode><menudescription><pre xml:space="preserve">Select roman, italics, etc.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                  ">Font sizes</menunode><menudescription><pre xml:space="preserve">Select point size.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::     ">Low-level font commands</menunode><menudescription><pre xml:space="preserve">Select encoding, family, series, shape.
</pre></menudescription></menuentry></menu>


<node name="fontenc-package" spaces=" "><nodename>fontenc package</nodename><nodenext automatic="on">Font styles</nodenext><nodeup automatic="on">Fonts</nodeup></node>
<section spaces=" "><sectiontitle><code>fontenc</code> package</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="108">font encoding</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="109">UTF-8, font support for</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="110">T1</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="111">OT1</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="109" mergedindex="cp">fontenc</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage[<var>font_encoding</var>]&lbrace;fontenc&rbrace;
</pre></example>

<para>or
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage[<var>font_encoding1</var>, <var>font_encoding2</var>, ...]&lbrace;fontenc&rbrace;
</pre></example>

<para>Specify the font encodings.  A font encoding is a mapping of the
character codes to the font glyphs that are used to typeset your output.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="112"><r>package</r>, <code>fontspec</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="113"><code>fontspec</code> <r>package</r></indexterm></cindex>

<para>This package only applies if you use the <code>pdflatex</code> engine
(<pxref label="TeX-engines"><xrefnodename>&tex; engines</xrefnodename></pxref>).  If you use the <command>xelatex</command> or
<command>lualatex</command> engine then instead use the <code>fontspec</code> package.
</para>
<para>&tex;&textrsquo;s original font family, Computer Modern, has a limited character
set. For instance, to make common accented characters you must use
<code>\accent</code> (<pxref label="_005caccent"><xrefnodename>\accent</xrefnodename></pxref>) but this disables hyphenation.  &tex;
users have agreed on a number of standards to access the larger sets of
characters provided by modern fonts.  If you are using
<command>pdflatex</command> then put this in the preamble
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage[T1]&lbrace;fontenc&rbrace;
</pre></example>

<noindent></noindent>
<para>gives you support for the most widespread European languages, including
French, German, Italian, Polish, and others.  In particular, if you have
words with accented letters then &latex; will hyphenate them and your
output can be copied and pasted.  (The optional second line allows you
to directly enter accented characters into your source file.)
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="114"><r>package</r>, <code>lmodern</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="115"><code>lmodern</code> <r>package</r></indexterm></cindex>
 <cindex index="cp" spaces=" "><indexterm index="cp" number="116"><r>package</r>, <code>cm-super</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="117"><code>cm-super</code> <r>package</r></indexterm></cindex>

<para>If you are using an encoding such as <code>T1</code> and the characters appear
blurry or do not magnify well then your fonts may be bitmapped,
sometimes called raster or Type&nbsp;3.  You want vector fonts.  Use a
package such as <code>lmodern</code> or <code>cm-super</code> to get a font that
extends &latex;&textrsquo;s default using vector fonts.
</para>
<para>For each <var>font_encoding</var> given as an option but not already
declared, this package loads the encoding definition files, named
<file><var>font_encoding</var>enc.def</file>.  It also sets <code>\encodingdefault</code>
to be the last encoding in the option list.
</para>
<para>These are the common values for <var>font_encoding</var>.
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">OT1</itemformat></item>
</tableterm><tableitem><para>The original encoding for &tex;.  Limited to mostly English characters.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">OMS, OML</itemformat></item>
</tableterm><tableitem><para>Math symbols and math letters encoding.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">T1</itemformat></item>
</tableterm><tableitem><para>&tex; text extended.  Sometimes called the Cork encoding for the Users
Group meeting where it was developed.  Gives access to most European
accented characters.  The most common option for this package.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">TS1</itemformat></item>
</tableterm><tableitem><para>Text Companion encoding.
</para></tableitem></tableentry></table>

<noindent></noindent>
<para>&latex;&textrsquo;s default is to load <code>OML</code>, <code>T1</code>, <code>OT1</code>, and
then <code>OMS</code>, and set the default to <code>OT1</code>.
</para>
<para>Even if you do not use accented letters, you may need to specify a font
encoding if your font requires it.
</para>
<para>If you use <code>T1</code>&nbsp;encoded fonts other than the default Computer
Modern family then you may need to load the package that selects your
fonts before loading <file>fontenc</file>, to prevent the system from loading
any <code>T1</code>&nbsp;encoded fonts from the default.
</para>
<para>The &latex; team reserve encoding names starting with: <samp>T</samp> for the
standard text encodings with 256 characters, <samp>TS</samp> for symbols that
extend the corresponding T encodings, <samp>X</samp> for test encodings,
<samp>M</samp> for standard math encodings with 256 characters, <samp>A</samp> for
special applications, <samp>OT</samp> for standard text encodings with 128
characters, and <samp>OM</samp> for standard math encodings with 128
characters (<samp>O</samp> stands for <samp>obsolete</samp>).
</para>
<para>This package provides a number of commands, detailed below.  Many of
them are encoding-specific, so if you have defined a command that works
for one encoding but the current encoding is different then the command
is not in effect.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::           ">\DeclareFontEncoding</menunode><menudescription><pre xml:space="preserve">Define an encoding.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::             ">\DeclareTextAccent</menunode><menudescription><pre xml:space="preserve">Define an accent in the encoding.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::      ">\DeclareTextAccentDefault</menunode><menudescription><pre xml:space="preserve">Fallback for using an accent in the encoding.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::  ">\DeclareTextCommand &amp; \ProvideTextCommand</menunode><menudescription><pre xml:space="preserve">New encoding-specific command.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::  ">\DeclareTextCommandDefault &amp; \ProvideTextCommandDefault</menunode><menudescription><pre xml:space="preserve">Fallback for encoding-specific commands.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::   ">\DeclareTextComposite</menunode><menudescription><pre xml:space="preserve">Directly access an accented glyph, in the encoding.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::    ">\DeclareTextCompositeCommand</menunode><menudescription><pre xml:space="preserve">Run code in slot, in the encoding.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::              ">\DeclareTextSymbol</menunode><menudescription><pre xml:space="preserve">Define a symbol in the encoding.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::       ">\DeclareTextSymbolDefault</menunode><menudescription><pre xml:space="preserve">Fallback for a symbol in the encoding.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::           ">\LastDeclaredEncoding</menunode><menudescription><pre xml:space="preserve">Save most recently declared encoding.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator=":: ">\UseTextSymbol &amp; \UseTextAccent</menunode><menudescription><pre xml:space="preserve">Temporarily switch to another encoding.
</pre></menudescription></menuentry></menu>


<node name="_005cDeclareFontEncoding" spaces=" "><nodename>\DeclareFontEncoding</nodename><nodenext automatic="on">\DeclareTextAccent</nodenext><nodeup automatic="on">fontenc package</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\DeclareFontEncoding</code></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="118">font encoding, declaring</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="119">encoding, font</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="120">accents, defining</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="110" mergedindex="cp">\DeclareFontEncoding</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareFontEncoding&lbrace;<var>encoding</var>&rbrace;&lbrace;<var>text-settings</var>&rbrace;&lbrace;<var>math-settings</var>&rbrace;
</pre></example>

<para>Declare the font encoding <var>encoding</var>.  It also saves the value of
<var>encoding</var> in <code>\LastDeclaredEncoding</code>
(<pxref label="_005cLastDeclaredEncoding"><xrefnodename>\LastDeclaredEncoding</xrefnodename></pxref>).
</para>
<para>The file <file>t1enc.def</file> contains this line (followed by many others).
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareFontEncoding&lbrace;T1&rbrace;&lbrace;&rbrace;&lbrace;&rbrace;
</pre></example>

<para>The <var>text-settings</var> are the commands that &latex; will run every
time it switches from one encoding to another with the
<code>\selectfont</code> and <code>\fontencoding</code> commands.  The
<var>math-settings</var> are the commands that &latex; will use whenever the
font is accessed as a math alphabet.
</para>
<para>&latex; ignores any space characters inside <var>text-settings</var> and
<var>math-settings</var>, to prevent unintended spaces in the output.
</para>
<para>If you invent an encoding you should pick a two or three letter name
starting with <samp>L</samp> for <samp>local</samp>, or <samp>E</samp> for
<samp>experimental</samp>.
</para>
<para>Note that output encoding files may be read several times by &latex; so
using, e.g., <code>\newcommand</code> may cause an error.  In addition, such
files should contain <code>\ProvidesFile</code> line (<pxref label="Class-and-package-commands"><xrefnodename>Class and package
commands</xrefnodename></pxref>).
</para>
<para>Note also that you should use the <code>\...Default</code> commands only in a
package, not in the encoding definition files, since those files
should only contain declarations specific to that encoding.
</para>

</subsection>
<node name="_005cDeclareTextAccent" spaces=" "><nodename>\DeclareTextAccent</nodename><nodenext automatic="on">\DeclareTextAccentDefault</nodenext><nodeprev automatic="on">\DeclareFontEncoding</nodeprev><nodeup automatic="on">fontenc package</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\DeclareTextAccent</code></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="121">font encoding</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="122">accents, defining</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="111" mergedindex="cp">\DeclareTextAccent</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareTextAccent&lbrace;<var>cmd</var>&rbrace;&lbrace;<var>encoding</var>&rbrace;&lbrace;<var>slot</var>&rbrace;
</pre></example>

<para>Define an accent, to be put on top of other glyphs, in the encoding
<var>encoding</var> at the location <var>slot</var>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="123">slot, font</indexterm></cindex>
<para>A <dfn>slot</dfn> is the number identifying a glyph within a font.
</para>
<para>This line from <file>t1enc.def</file> declares that to make a circumflex
accent as in <code>\^A</code>, the system will put the accent in slot&nbsp;2
over the <samp>A</samp> character, which is represented in ASCII as&nbsp;65.
(This holds unless there is a relevant <code>DeclareTextComposite</code> or
<code>\DeclareTextCompositeCommand</code> declaration;
<pxref label="_005cDeclareTextComposite"><xrefnodename>\DeclareTextComposite</xrefnodename></pxref>.)
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareTextAccent&lbrace;\^&rbrace;&lbrace;T1&rbrace;&lbrace;2&rbrace;
</pre></example>

<para>If <var>cmd</var> has already been defined then <code>\DeclareTextAccent</code>
does not give an error but it does log the redefinition in the
transcript file.
</para>

</subsection>
<node name="_005cDeclareTextAccentDefault" spaces=" "><nodename>\DeclareTextAccentDefault</nodename><nodenext automatic="on">\DeclareTextCommand &amp; \ProvideTextCommand</nodenext><nodeprev automatic="on">\DeclareTextAccent</nodeprev><nodeup automatic="on">fontenc package</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\DeclareTextAccentDefault</code></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="124">accents, defining</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="112" mergedindex="cp">\DeclareTextAccent</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="113" mergedindex="cp">\DeclareTextAccentDefault</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareTextAccentDefault&lbrace;\<var>cmd</var>&rbrace;&lbrace;<var>encoding</var>&rbrace;
</pre></example>

<para>If there is an encoding-specific accent command \<var>cmd</var> but there is
no associated <code>\DeclareTextAccent</code> for that encoding then this
command will pick up the slack, by saying to use it as described for
<var>encoding</var>.
</para>
<para>For example, to make the encoding <code>OT1</code> be the default encoding for
the accent <code>\&quot;</code>, declare this.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareTextAccentDefault&lbrace;\&quot;&rbrace;&lbrace;OT1&rbrace;
</pre></example>

<noindent></noindent>
<para>If you issue a <code>\&quot;</code> when the current encoding does not have a
definition for that accent then &latex; will use the definition from
<code>OT1</code>
</para>
<para>That is, this command is equivalent to this call (<pxref label="_005cUseTextSymbol-_0026-_005cUseTextAccent"><xrefnodename>\UseTextSymbol
&amp; \UseTextAccent</xrefnodename></pxref>).
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareTextCommandDefault[1]&lbrace;\<var>cmd</var>&rbrace;
   &lbrace;\UseTextAccent&lbrace;<var>encoding</var>&rbrace;&lbrace;\<var>cmd</var>&rbrace;&lbrace;#1&rbrace;&rbrace;
</pre></example>

<para>Note that <code>\DeclareTextAccentDefault</code> works for any one-argument
<file>fontenc</file> command, not just the accent command.
</para>

</subsection>
<node name="_005cDeclareTextCommand-_0026-_005cProvideTextCommand" spaces=" "><nodename>\DeclareTextCommand &amp; \ProvideTextCommand</nodename><nodenext automatic="on">\DeclareTextCommandDefault &amp; \ProvideTextCommandDefault</nodenext><nodeprev automatic="on">\DeclareTextAccentDefault</nodeprev><nodeup automatic="on">fontenc package</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\DeclareTextCommand</code> &amp; <code>\ProvideTextCommand</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="114" mergedindex="cp">\DeclareTextCommand</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="115" mergedindex="cp">\ProvideTextCommand</indexterm></findex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareTextCommand&lbrace;\<var>cmd</var>&rbrace;&lbrace;<var>encoding</var>&rbrace;&lbrace;<var>defn</var>&rbrace;
\DeclareTextCommand&lbrace;\<var>cmd</var>&rbrace;&lbrace;<var>encoding</var>&rbrace;[<var>nargs</var>]&lbrace;<var>defn&rbrace;</var>
\DeclareTextCommand&lbrace;\<var>cmd</var>&rbrace;&lbrace;<var>encoding</var>&rbrace;[<var>nargs</var>][<var>optargdefault</var>]&lbrace;<var>defn</var>&rbrace;
</pre></example>

<para>or one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\ProvideTextCommand&lbrace;\<var>cmd</var>&rbrace;&lbrace;<var>encoding</var>&rbrace;&lbrace;<var>defn</var>&rbrace;
\ProvideTextCommand&lbrace;\<var>cmd</var>&rbrace;&lbrace;<var>encoding</var>&rbrace;[<var>nargs</var>]&lbrace;<var>defn</var>&rbrace;
\ProvideTextCommand&lbrace;\<var>cmd</var>&rbrace;&lbrace;<var>encoding</var>&rbrace;[<var>nargs</var>][<var>optargdefault</var>]&lbrace;<var>defn</var>&rbrace;
</pre></example>

<para>Define the command <code>\<var>cmd</var></code>, which will be specific to one
encoding.  The command name <var>cmd</var> must be preceded by a backslash,
<code>\</code>.  These commands can only appear in the preamble.  Redefining
\<var>cmd</var> does not cause an error. The defined command will be robust
even if the code in <var>defn</var> is fragile (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>For example, the file <file>t1enc.def</file> contains this line.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareTextCommand&lbrace;\textperthousand&rbrace;&lbrace;T1&rbrace;&lbrace;\%\char 24 &rbrace;
</pre></example>

<para>With that, you can express parts per thousand.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage[T1]&lbrace;fontenc&rbrace;  % in preamble
  ...
Legal limit is \( 0.8 \)\textperthousand.
</pre></example>

<noindent></noindent>
<para>If you change the font encoding to <code>OT1</code> then you get an error like
<samp>LaTeX Error: Command \textperthousand unavailable in encoding
OT1</samp>.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="116" mergedindex="cp">\DeclareTextSymbol</indexterm></findex>
<para>The <code>\ProvideTextCommand</code> variant does the same, except that it
does nothing if <code>\<var>cmd</var></code> is already defined.  The
<code>\DeclareTextSymbol</code> command is faster than this one for simple
slot-to-glyph association (<pxref label="_005cDeclareTextSymbol"><xrefnodename>\DeclareTextSymbol</xrefnodename></pxref>)
</para>
<para>The optional <var>nargs</var> and <var>optargdefault</var> arguments play the same
role here as in <code>\newcommand</code> (<pxref label="_005cnewcommand-_0026-_005crenewcommand"><xrefnodename>\newcommand &amp;
\renewcommand</xrefnodename></pxref>).  Briefly, <var>nargs</var> is an integer from 0 to 9
specifying the number of arguments that the defined command
<code>\<var>cmd</var></code> takes.  This number includes any optional argument.
Omitting this argument is the same as specifying 0, meaning that
<code>\<var>cmd</var></code> will have no arguments.  And, if <var>optargdefault</var>
is present then the first argument of <code>\<var>cmd</var></code> is optional,
with default value <var>optargdefault</var> (which may be the empty string).
If <var>optargdefault</var> is not present then <code>\<var>cmd</var></code> does not
take an optional argument.
</para>

</subsection>
<node name="_005cDeclareTextCommandDefault-_0026-_005cProvideTextCommandDefault" spaces=" "><nodename>\DeclareTextCommandDefault &amp; \ProvideTextCommandDefault</nodename><nodenext automatic="on">\DeclareTextComposite</nodenext><nodeprev automatic="on">\DeclareTextCommand &amp; \ProvideTextCommand</nodeprev><nodeup automatic="on">fontenc package</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\DeclareTextCommandDefault</code> &amp; <code>\ProvideTextCommandDefault </code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="117" mergedindex="cp">\DeclareTextCommand</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="118" mergedindex="cp">\DeclareTextCommandDefault</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="119" mergedindex="cp">\ProvideTextCommand</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="120" mergedindex="cp">\ProvideTextCommandDefault</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareTextCommandDefault&lbrace;\<var>cmd</var>&rbrace;&lbrace;<var>defn</var>&rbrace;
</pre></example>

<para>or:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\ProvideTextCommandDefault&lbrace;\<var>cmd</var>&rbrace;&lbrace;<var>defn</var>&rbrace;
</pre></example>

<para>Give a default definition for <code>\<var>cmd</var></code>, for when that command
is not defined in the encoding currently in force. This default should
only use encodings known to be available.
</para>
<para>This makes <code>\copyright</code> available.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareTextCommandDefault&lbrace;\copyright&rbrace;&lbrace;\textcircled&lbrace;c&rbrace;&rbrace;
</pre></example>

<noindent></noindent>
<para>It uses only an encoding (OMS) that is always available.
</para>
<para>The <code>\DeclareTextCommandDefault</code> should not occur in the encoding
definition files since those files should declare only commands for use
when you select that encoding. It should instead be in a package.
</para>
<para>As with the related non-default commands, the
<code>\ProvideTextCommandDefault</code> has exactly the same behavior as
<code>\DeclareTextCommandDefault</code> except that it does nothing if
<code>\<var>cmd</var></code> is already defined (<pxref label="_005cDeclareTextCommand-_0026-_005cProvideTextCommand"><xrefnodename>\DeclareTextCommand &amp;
\ProvideTextCommand</xrefnodename></pxref>).  So, packages can use it to provide fallbacks
that other packages can improve upon.
</para>

</subsection>
<node name="_005cDeclareTextComposite" spaces=" "><nodename>\DeclareTextComposite</nodename><nodenext automatic="on">\DeclareTextCompositeCommand</nodenext><nodeprev automatic="on">\DeclareTextCommandDefault &amp; \ProvideTextCommandDefault</nodeprev><nodeup automatic="on">fontenc package</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\DeclareTextComposite</code></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="125">accents, defining</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="121" mergedindex="cp">\DeclareTextComposite</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareTextComposite&lbrace;\<var>cmd</var>&rbrace;&lbrace;<var>encoding</var>&rbrace;&lbrace;<var>simple_object</var>&rbrace;&lbrace;<var>slot</var>&rbrace;
</pre></example>

<para>Access an accented glyph directly, that is, without having to put an
accent over a separate character.
</para>
<para>This line from <file>t1enc.def</file> means that <code>\^o</code> will cause
&latex; to typeset lowercase&nbsp;<samp>o</samp> by taking the character
directly from slot 224 in the font.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareTextComposite&lbrace;\^&rbrace;&lbrace;T1&rbrace;&lbrace;o&rbrace;&lbrace;244&rbrace;
</pre></example>

<para><xref label="fontenc-package"><xrefnodename>fontenc package</xrefnodename></xref>, for a list of common encodings.  The
<var>simple_object</var> should be a single character or a single command.
The <var>slot</var> argument is usually a positive integer represented in
decimal (although octal or hexadecimal are possible).  Normally
\<var>cmd</var> has already been declared for this encoding, either with
<code>\DeclareTextAccent</code> or with a one-argument
<code>\DeclareTextCommand</code>.  In <file>t1enc.def</file>, the above line follows
the <code>\DeclareTextAccent&lbrace;\^&rbrace;&lbrace;T1&rbrace;&lbrace;2&rbrace;</code> command.
</para>

</subsection>
<node name="_005cDeclareTextCompositeCommand" spaces=" "><nodename>\DeclareTextCompositeCommand</nodename><nodenext automatic="on">\DeclareTextSymbol</nodenext><nodeprev automatic="on">\DeclareTextComposite</nodeprev><nodeup automatic="on">fontenc package</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\DeclareTextCompositeCommand</code></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="126">accents, defining</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="122" mergedindex="cp">\DeclareTextCompositeCommand</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareTextCompositeCommand&lbrace;\<var>cmd</var>&rbrace;&lbrace;<var>encoding</var>&rbrace;&lbrace;<var>arg</var>&rbrace;&lbrace;<var>code</var>&rbrace;
</pre></example>

<para>A more general version of <code>\DeclareTextComposite</code> that runs
arbitrary code with <code>\<var>cmd</var></code>.
</para>
<para>This allows accents on <samp>i</samp> to act like accents on dotless&nbsp;i,
<code>\i</code>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareTextCompositeCommand&lbrace;\'&rbrace;&lbrace;OT1&rbrace;&lbrace;i&rbrace;&lbrace;\'\i&rbrace;
</pre></example>

<para><xref label="fontenc-package"><xrefnodename>fontenc package</xrefnodename></xref>, for a list of common encodings.  Normally
<code>\<var>cmd</var></code> will have already been declared with <code>\DeclareTextAccent</code>
or as a one argument <code>\DeclareTextCommand</code>.
</para>

</subsection>
<node name="_005cDeclareTextSymbol" spaces=" "><nodename>\DeclareTextSymbol</nodename><nodenext automatic="on">\DeclareTextSymbolDefault</nodenext><nodeprev automatic="on">\DeclareTextCompositeCommand</nodeprev><nodeup automatic="on">fontenc package</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\DeclareTextSymbol</code></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="127">symbol, defining</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="123" mergedindex="cp">\DeclareTextSymbol</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareTextSymbol&lbrace;\<var>cmd</var>&rbrace;&lbrace;<var>encoding</var>&rbrace;&lbrace;<var>slot</var>&rbrace;
</pre></example>

<para>Define a symbol in the encoding <var>encoding</var> at the location
<var>slot</var>.  Symbols defined in this way are for use in text, not
mathematics.
</para>
<para>For example, this line from <file>t1enc.def</file> declares the number of the
glyph to use for <U>00AB</U>, the left guillemet.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareTextSymbol&lbrace;\guillemotleft&rbrace;&lbrace;T1&rbrace;&lbrace;19&rbrace;
</pre></example>

<noindent></noindent>
<para>The command <code>\DeclareTextCommand&lbrace;\guillemotleft&rbrace;&lbrace;T1&rbrace;&lbrace;\char
19&rbrace;</code> has the same effect but is slower (<pxref label="_005cDeclareTextCommand-_0026-_005cProvideTextCommand"><xrefnodename>\DeclareTextCommand &amp;
\ProvideTextCommand</xrefnodename></pxref>).
</para>
<para><xref label="fontenc-package"><xrefnodename>fontenc package</xrefnodename></xref>, for a list of common encodings.  The <var>slot</var>
can be specified in decimal, or octal (as in <code>'023</code>), or
hexadecimal (as in <code>&quot;13</code>), although decimal has the advantage that
single quote or double quote could be redefined by another package.
</para>
<para>If <code>\<var>cmd</var></code> has already been defined then
<code>\DeclareTextSymbol</code> does not give an error but it does log the
redefinition in the transcript file.
</para>

</subsection>
<node name="_005cDeclareTextSymbolDefault" spaces=" "><nodename>\DeclareTextSymbolDefault</nodename><nodenext automatic="on">\LastDeclaredEncoding</nodenext><nodeprev automatic="on">\DeclareTextSymbol</nodeprev><nodeup automatic="on">fontenc package</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\DeclareTextSymbolDefault</code></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="128">accents, defining</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="124" mergedindex="cp">\DeclareTextSymbol</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="125" mergedindex="cp">\DeclareTextSymbolDefault</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareTextSymbolDefault&lbrace;\<var>cmd</var>&rbrace;&lbrace;<var>encoding</var>&rbrace;
</pre></example>

<para>If there is an encoding-specific symbol command <code>\<var>cmd</var></code> but
there is no associated <code>\DeclareTextSymbol</code> for that encoding, then
this command will pick up the slack, by saying to get the symbol as
described for <var>encoding</var>.
</para>
<para>For example, to declare that if the current encoding has no meaning for
<code>\textdollar</code> then use the one from <code>OT1</code>, declare this.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareTextSymbolDefault&lbrace;\textdollar&rbrace;&lbrace;OT1&rbrace;
</pre></example>

<para>That is, this command is equivalent to this call (<pxref label="_005cUseTextSymbol-_0026-_005cUseTextAccent"><xrefnodename>\UseTextSymbol
&amp; \UseTextAccent</xrefnodename></pxref>).
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareTextCommandDefault&lbrace;\<var>cmd</var>&rbrace;
   &lbrace;\UseTextSymbol&lbrace;<var>encoding</var>&rbrace;&lbrace;\<var>cmd</var>&rbrace;&rbrace;
</pre></example>

<para>Note that <code>\DeclareTextSymbolDefault</code> can be used to define a
default for any zero-argument <file>fontenc</file> command.
</para>

</subsection>
<node name="_005cLastDeclaredEncoding" spaces=" "><nodename>\LastDeclaredEncoding</nodename><nodenext automatic="on">\UseTextSymbol &amp; \UseTextAccent</nodenext><nodeprev automatic="on">\DeclareTextSymbolDefault</nodeprev><nodeup automatic="on">fontenc package</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\LastDeclaredEncoding</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="126" mergedindex="cp">\LastDeclaredEncoding</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\LastDeclaredEncoding
</pre></example>

<para>Get the name of the most recently declared encoding.  The
<code>\DeclareFontEncoding</code> command stores the name so that it can be
retrieved with this command (<pxref label="_005cDeclareFontEncoding"><xrefnodename>\DeclareFontEncoding</xrefnodename></pxref>).
</para>
<para>This relies on <code>\LastDeclaredEncoding</code> rather than give the
name of the encoding explicitly.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareFontEncoding&lbrace;JH1&rbrace;&lbrace;&rbrace;&lbrace;&rbrace;
\DeclareTextAccent&lbrace;\'&rbrace;&lbrace;\LastDeclaredEncoding&rbrace;&lbrace;0&rbrace;
</pre></example>


</subsection>
<node name="_005cUseTextSymbol-_0026-_005cUseTextAccent" spaces=" "><nodename>\UseTextSymbol &amp; \UseTextAccent</nodename><nodeprev automatic="on">\LastDeclaredEncoding</nodeprev><nodeup automatic="on">fontenc package</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\UseTextSymbol</code> &amp; <code>\UseTextAccent</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="127" mergedindex="cp">\UseTextSymbol</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="128" mergedindex="cp">\UseTextAccent</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\UseTextSymbol&lbrace;<var>encoding</var>&rbrace;&lbrace;\<var>cmd</var>&rbrace;
</pre></example>

<para>or:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\UseTextAccent&lbrace;<var>encoding</var>&rbrace;&lbrace;\<var>cmd</var>&rbrace;&lbrace;<var>text</var>&rbrace;
</pre></example>

<para>Use a symbol or accent not from the current encoding.
</para>
<para>In general, to use a <file>fontenc</file> command in an encoding where it is
not defined, and if the command has no arguments, then you can use it
like this:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\UseTextSymbol&lbrace;OT1&rbrace;&lbrace;\ss&rbrace;
</pre></example>

<noindent></noindent>
<para>which is equivalent to this (note the outer braces form a group, so &latex;
reverts back to the prior encoding after the <code>\ss</code>):
</para>
<example endspaces=" ">
<pre xml:space="preserve">&lbrace;\fontencoding&lbrace;OT1&rbrace;\selectfont\ss&rbrace;
</pre></example>

<para>Similarly, to use a <file>fontenc</file> command in an encoding where it is
not defined, and if the command has one argument, you can use it like this:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\UseTextAccent&lbrace;OT1&rbrace;&lbrace;\'&rbrace;&lbrace;a&rbrace;
</pre></example>

<noindent></noindent>
<para>which is equivalent to this (again note the outer braces forming a group):
</para>
<example endspaces=" ">
<pre xml:space="preserve">&lbrace;fontencoding&lbrace;OT1&rbrace;\selectfont\'&lbrace;\fontencoding&lbrace;<var>enc_in_use</var>&rbrace;\selectfont a&rbrace;&rbrace;
</pre></example>

<noindent></noindent>
<para>Here, <var>enc_in_use</var> is the encoding in force before this sequence
of commands, so that <samp>a</samp> is typeset using the current encoding
and only the accent is taken from <code>OT1</code>.
</para>

</subsection>
</section>
<node name="Font-styles" spaces=" "><nodename>Font styles</nodename><nodenext automatic="on">Font sizes</nodenext><nodeprev automatic="on">fontenc package</nodeprev><nodeup automatic="on">Fonts</nodeup></node>
<section spaces=" "><sectiontitle>Font styles</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="129">font styles</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="130">type styles</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="131">styles of text</indexterm></cindex>

<para>The following type style commands are supported by &latex;.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="132">declaration form of font style commands</indexterm></cindex>
<para>In the table below the listed commands, the <code>\text...</code>  commands,
are used with an argument as in <code>\textit&lbrace;<var>text</var>&rbrace;</code>.  This is
the preferred form.  But shown after it in parenthesis is the
corresponding <dfn>declaration form</dfn>, which is often useful.  This
form takes no arguments, as in <code>&lbrace;\itshape <var>text</var>&rbrace;</code>.  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&lbrace;itshape&rbrace;...\end&lbrace;itshape&rbrace;</code>, which we&textrsquo;ll
describe further at the end of the section.
</para>
<para>These commands, in any of the three forms, are cumulative; for instance
you can get bold sans serif by saying either of
<code>\sffamily\bfseries</code> or <code>\bfseries\sffamily</code>.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="129" mergedindex="cp">\nocorrlist</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="130" mergedindex="cp">\nocorr</indexterm></findex>
<para>One advantage of these commands is that they automatically insert italic
corrections if needed (<pxref label="_005c_002f"><xrefnodename>\/</xrefnodename></pxref>).  Specifically, they insert the
italic correction unless the following character is in the list
<code>\nocorrlist</code>, which by default consists of period and comma.
To suppress the automatic insertion of italic correction, use
<code>\nocorr</code> at the start or end of the command argument, such as
<code>\textit&lbrace;\nocorr text&rbrace;</code> or <code>\textsc&lbrace;text \nocorr&rbrace;</code>.
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">\textrm (\rmfamily)</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="131" mergedindex="cp">\textrm</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="132" mergedindex="cp">\rmfamily</indexterm></findex>
<para>Roman.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\textit (\itshape)</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="133" mergedindex="cp">\textit</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="134" mergedindex="cp">\itshape</indexterm></findex>
<para>Italics.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\textmd (\mdseries)</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="135" mergedindex="cp">\textmd</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="136" mergedindex="cp">\mdseries</indexterm></findex>
<para>Medium weight (default).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\textbf (\bfseries)</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="137" mergedindex="cp">\textbf</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="138" mergedindex="cp">\bfseries</indexterm></findex>
<para>Boldface.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\textup (\upshape)</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="139" mergedindex="cp">\textup</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="140" mergedindex="cp">\upshape</indexterm></findex>
<para>Upright (default).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\textsl (\slshape)</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="141" mergedindex="cp">\textsl</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="142" mergedindex="cp">\slshape</indexterm></findex>
<para>Slanted.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\textsf (\sffamily)</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="143" mergedindex="cp">\textsf</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="144" mergedindex="cp">\sffamily</indexterm></findex>
<para>Sans serif.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\textsc (\scshape)</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="145" mergedindex="cp">\textsc</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="146" mergedindex="cp">\scshape</indexterm></findex>
<para>Small caps.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\texttt (\ttfamily)</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="147" mergedindex="cp">\texttt</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="148" mergedindex="cp">\ttfamily</indexterm></findex>
<para>Typewriter.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\textnormal (\normalfont)</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="149" mergedindex="cp">\textnormal</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="150" mergedindex="cp">\normalfont</indexterm></findex>
<para>Main document font.
</para>
</tableitem></tableentry></table>

<cindex index="cp" spaces=" "><indexterm index="cp" number="133">emphasis</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="151" mergedindex="cp">\emph</indexterm></findex>
<para>Although it also changes fonts, the <code>\emph&lbrace;<var>text</var>&rbrace;</code> command
is semantic, for text to be emphasized, and should not be used as a
substitute for <code>\textit</code>.  For example, <code>\emph&lbrace;<var>start
text</var> \emph&lbrace;<var>middle text</var>&rbrace; <var>end text</var>&rbrace;</code> will result in the
<var>start text</var> and <var>end text</var> in italics, but <var>middle text</var>
will be in roman.
</para>
<para>&latex; also provides the following commands, which unconditionally
switch to the given style, that is, are <emph>not</emph> cumulative.  They are
used as declarations: <code>&lbrace;\<var>cmd</var>...&rbrace;</code> instead of
<code>\<var>cmd</var>&lbrace;...&rbrace;</code>.
</para>
<para>(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 what is
needed.)
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="152" mergedindex="cp">\bf</indexterm>\bf</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="134">bold font</indexterm></cindex>
<para>Switch to bold face.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="153" mergedindex="cp">\cal</indexterm>\cal</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="135">script letters for math</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="136">calligraphic letters for math</indexterm></cindex>
<para>Switch to calligraphic letters for math.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="154" mergedindex="cp">\it</indexterm>\it</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="137">italic font</indexterm></cindex>
<para>Italics.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="155" mergedindex="cp">\rm</indexterm>\rm</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="138">roman font</indexterm></cindex>
<para>Roman.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="156" mergedindex="cp">\sc</indexterm>\sc</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="139">small caps font</indexterm></cindex>
<para>Small caps.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="157" mergedindex="cp">\sf</indexterm>\sf</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="140">sans serif font</indexterm></cindex>
<para>Sans serif.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="158" mergedindex="cp">\sl</indexterm>\sl</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="141">slanted font</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="142">oblique font</indexterm></cindex>
<para>Slanted (oblique).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="159" mergedindex="cp">\tt</indexterm>\tt</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="143">typewriter font</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="144">monospace font</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="145">fixed-width font</indexterm></cindex>
<para>Typewriter (monospace, fixed-width).
</para>
</tableitem></tableentry></ftable>

<para>The <code>\em</code> command is the unconditional version of <code>\emph</code>.
</para>
<para>The following commands are for use in math mode.  They are not
cumulative, so <code>\mathbf&lbrace;\mathit&lbrace;<var>symbol</var>&rbrace;&rbrace;</code> does not
create a boldface and italic <var>symbol</var>; instead, it will just be in
italics.  This is because typically math symbols need consistent
typographic treatment, regardless of the surrounding environment.
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">\mathrm</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="160" mergedindex="cp">\mathrm</indexterm></findex>
<para>Roman, for use in math mode.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\mathbf</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="161" mergedindex="cp">\mathbf</indexterm></findex>
<para>Boldface, for use in math mode.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\mathsf</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="162" mergedindex="cp">\mathsf</indexterm></findex>
<para>Sans serif, for use in math mode.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\mathtt</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="163" mergedindex="cp">\mathtt</indexterm></findex>
<para>Typewriter, for use in math mode.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\mathit</itemformat></item>
<itemx spaces=" "><itemformat command="code">(\mit)</itemformat></itemx>
</tableterm><tableitem><para>Italics, for use in math mode.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\mathnormal</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="164" mergedindex="cp">\mathnormal</indexterm></findex>
<para>For use in math mode, e.g., inside another type style declaration.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\mathcal</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="165" mergedindex="cp">\mathcal</indexterm></findex>
<para>Calligraphic letters, for use in math mode.
</para>
</tableitem></tableentry></table>

<findex index="fn" spaces=" "><indexterm index="fn" number="166" mergedindex="cp">\mathversion</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="146">math, bold</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="147">bold math</indexterm></cindex>
<para>In addition, the command <code>\mathversion&lbrace;bold&rbrace;</code> can be used for
switching to bold letters and symbols in
formulas. <code>\mathversion&lbrace;normal&rbrace;</code> restores the default.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="167" mergedindex="cp">\oldstylenums</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="148">numerals, old-style</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="149">old-style numerals</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="150">lining numerals</indexterm></cindex>
<para>Finally, the command <code>\oldstylenums&lbrace;<var>numerals</var>&rbrace;</code> will
typeset so-called &textldquo;old-style&textrdquo; numerals, which have differing heights
and depths (and sometimes widths) from the standard &textldquo;lining&textrdquo;
numerals, which all have the same height as uppercase letters.
&latex;&textrsquo;s default fonts support this, and will respect <code>\textbf</code>
(but not other styles; there are no italic old-style numerals in
Computer Modern).  Many other fonts have old-style numerals also;
sometimes package options are provided to make them the default.  FAQ
entry: <url><urefurl>https://www.texfaq.org/FAQ-osf</urefurl></url>.
</para>

</section>
<node name="Font-sizes" spaces=" "><nodename>Font sizes</nodename><nodenext automatic="on">Low-level font commands</nodenext><nodeprev automatic="on">Font styles</nodeprev><nodeup automatic="on">Fonts</nodeup></node>
<section spaces=" "><sectiontitle>Font sizes</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="151">font sizes</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="152">typeface sizes</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="153">sizes of text</indexterm></cindex>

<para>The following standard type size commands are supported by &latex;.
The table shows the command name and the corresponding actual font
size used (in points) with the <samp>10pt</samp>, <samp>11pt</samp>, and
<samp>12pt</samp> document size options, respectively (<pxref label="Document-class-options"><xrefnodename>Document class
options</xrefnodename></pxref>).
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="168" mergedindex="cp">\tiny</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="169" mergedindex="cp">\scriptsize</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="170" mergedindex="cp">\footnotesize</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="171" mergedindex="cp">\small</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="172" mergedindex="cp">\normalsize</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="173" mergedindex="cp">\large</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="174" mergedindex="cp">\Large</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="175" mergedindex="cp">\LARGE</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="176" mergedindex="cp">\huge</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="177" mergedindex="cp">\Huge</indexterm></findex>

<multitable spaces=" " endspaces=" "><columnprototypes><columnprototype bracketed="on"><code>\normalsize</code> (default)<spacecmd type="spc"/><spacecmd type="spc"/></columnprototype> <columnprototype bracketed="on">24.88<spacecmd type="spc"/><spacecmd type="spc"/></columnprototype> <columnprototype bracketed="on">24.88<spacecmd type="spc"/><spacecmd type="spc"/></columnprototype> <columnprototype bracketed="on">24.88</columnprototype></columnprototypes>
<thead><row><entry command="headitem" spaces=" "><para>Command  </para></entry><entry command="tab" spaces=" "><para><code>10pt</code>  </para></entry><entry command="tab" spaces=" "><para><code>11pt</code>  </para></entry><entry command="tab" spaces=" "><para><code>12pt</code>
</para></entry></row></thead><tbody><row><entry command="item" spaces=" "><para><code>\tiny</code>
</para></entry><entry command="tab" spaces=" "><para>5          </para></entry><entry command="tab" spaces=" "><para>6          </para></entry><entry command="tab" spaces=" "><para>6
</para></entry></row><row><entry command="item" spaces=" "><para><code>\scriptsize</code>
</para></entry><entry command="tab" spaces=" "><para>7          </para></entry><entry command="tab" spaces=" "><para>8          </para></entry><entry command="tab" spaces=" "><para>8
</para></entry></row><row><entry command="item" spaces=" "><para><code>\footnotesize</code>
</para></entry><entry command="tab" spaces=" "><para>8          </para></entry><entry command="tab" spaces=" "><para>9          </para></entry><entry command="tab" spaces=" "><para>10
</para></entry></row><row><entry command="item" spaces=" "><para><code>\small</code>
</para></entry><entry command="tab" spaces=" "><para>9          </para></entry><entry command="tab" spaces=" "><para>10         </para></entry><entry command="tab" spaces=" "><para>10.95
</para></entry></row><row><entry command="item" spaces=" "><para><code>\normalsize</code> (default)
</para></entry><entry command="tab" spaces=" "><para>10         </para></entry><entry command="tab" spaces=" "><para>10.95      </para></entry><entry command="tab" spaces=" "><para>12
</para></entry></row><row><entry command="item" spaces=" "><para><code>\large</code>
</para></entry><entry command="tab" spaces=" "><para>12         </para></entry><entry command="tab" spaces=" "><para>12         </para></entry><entry command="tab" spaces=" "><para>14.4
</para></entry></row><row><entry command="item" spaces=" "><para><code>\Large</code>
</para></entry><entry command="tab" spaces=" "><para>14.4       </para></entry><entry command="tab" spaces=" "><para>14.4       </para></entry><entry command="tab" spaces=" "><para>17.28
</para></entry></row><row><entry command="item" spaces=" "><para><code>\LARGE</code>
</para></entry><entry command="tab" spaces=" "><para>17.28      </para></entry><entry command="tab" spaces=" "><para>17.28      </para></entry><entry command="tab" spaces=" "><para>20.74
</para></entry></row><row><entry command="item" spaces=" "><para><code>\huge</code>
</para></entry><entry command="tab" spaces=" "><para>20.74      </para></entry><entry command="tab" spaces=" "><para>20.74      </para></entry><entry command="tab" spaces=" "><para>24.88
</para></entry></row><row><entry command="item" spaces=" "><para><code>\Huge</code>
</para></entry><entry command="tab" spaces=" "><para>24.88      </para></entry><entry command="tab" spaces=" "><para>24.88      </para></entry><entry command="tab" spaces=" "><para>24.88
</para></entry></row></tbody></multitable>

<cindex index="cp" spaces=" "><indexterm index="cp" number="154">declaration form of font size commands</indexterm></cindex>
<para>The commands are listed here in declaration (not environment) form,
since that is how they are typically used.  For example.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;quotation&rbrace; \small
  The Tao that can be named is not the eternal Tao.
\end&lbrace;quotation&rbrace;
</pre></example>

<noindent></noindent>
<para>Here, the scope of the <code>\small</code> lasts until the end of the
<code>quotation</code> environment.  It would also end at the next type
style command or the end of the current group, so you could enclose it
in curly braces <code>&lbrace;\small This text is typeset in the small font.&rbrace;</code>.
</para>
<para>Trying to use these commands in math, as with <code>$\small mv^2/2$</code>,
results in <samp>LaTeX Font Warning: Command \small
invalid in math mode</samp>, and the font size doesn&textrsquo;t
change. To work with a too-large formula, often the best option is to
use the <code>displaymath</code> environment (<pxref label="Math-formulas"><xrefnodename>Math formulas</xrefnodename></pxref>), or
one of the environments from the <code>amsmath</code> package.  For inline
mathematics, such as in a table of formulas, an alternative is something
like <code>&lbrace;\small $mv^2/2$&rbrace;</code>.  (Sometimes <code>\scriptsize</code> and
<code>\scriptstyle</code> are confused.  Both change the font size, but the
latter also changes a number of other aspects of how mathematics is
typeset. <xref label="Math-styles"><xrefnodename>Math styles</xrefnodename></xref>.)
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="155">environment form of font size commands</indexterm></cindex>
<para>An <dfn>environment form</dfn> of each of these commands is also defined; for
instance, <code>\begin&lbrace;tiny&rbrace;...\end&lbrace;tiny&rbrace;</code>. However, in practice
this form can easily lead to unwanted spaces at the beginning and/or
end of the environment without careful consideration, so it&textrsquo;s
generally less error-prone to stick to the declaration form.
</para>
<para>(Aside: Technically, due to the way &latex; defines <code>\begin</code> and
<code>\end</code>, nearly every command that does not take an argument
technically has an environment form. But in almost all cases, it would
only cause confusion to use it. The reason for mentioning the
environment form of the font size declarations specifically is that
this particular use is not rare.)
</para>

</section>
<node name="Low_002dlevel-font-commands" spaces=" "><nodename>Low-level font commands</nodename><nodeprev automatic="on">Font sizes</nodeprev><nodeup automatic="on">Fonts</nodeup></node>
<section spaces=" "><sectiontitle>Low-level font commands</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="156">low-level font commands</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="157">font commands, low-level</indexterm></cindex>

<para>These commands are primarily intended for writers of macros and
packages.  The commands listed here are only a subset of the available
ones.
<!-- c xx but it should be complete -->
<!-- c xx something about ultimately reading ENCFAM.fd? -->
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<beforefirstitem><anchor name="low-level-font-commands-fontencoding">low level font commands fontencoding</anchor>
</beforefirstitem><tableentry><tableterm><item spaces=" "><itemformat command="code">\fontencoding&lbrace;<var>encoding</var>&rbrace;</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="178" mergedindex="cp">\fontencoding</indexterm></findex>
<para>Select the font encoding, the encoding of the output font. There are a
large number of valid encodings.  The most common are <code>OT1</code>,
Knuth&textrsquo;s original encoding for Computer Modern (the default), and
<code>T1</code>, also known as the Cork encoding, which has support for the
accented characters used by the most widespread European languages
(German, French, Italian, Polish and others), which allows &tex; to
hyphenate words containing accented letters. For more, see
<url><urefurl>https://ctan.org/pkg/encguide</urefurl></url>.
</para>
<anchor name="low-level-font-commands-fontfamily">low level font commands fontfamily</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\fontfamily&lbrace;<var>family</var>&rbrace;</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="179" mergedindex="cp">\fontfamily</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="158">families, of fonts</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="159">font catalogue</indexterm></cindex>
<para>Select the font family.  The web page
<url><urefurl>https://tug.org/FontCatalogue/</urefurl></url> provides one way to browse
through many of the fonts easily used with &latex;.  Here are
examples of some common families.
</para>
<multitable spaces=" " endspaces=" "><columnprototypes><columnprototype bracketed="on">font</columnprototype> <columnprototype bracketed="on">Computer Modern Typewriter more space</columnprototype></columnprototypes>
<tbody><row><entry command="item" spaces=" "><para><code>pag</code>
</para></entry><entry command="tab" spaces=" "><para>Avant Garde
</para></entry></row><row><entry command="item" spaces=" "><para><code>fvs</code>
</para></entry><entry command="tab" spaces=" "><para>Bitstream Vera Sans
</para></entry></row><row><entry command="item" spaces=" "><para><code>pbk</code>
</para></entry><entry command="tab" spaces=" "><para>Bookman
</para></entry></row><row><entry command="item" spaces=" "><para><code>bch</code>
</para></entry><entry command="tab" spaces=" "><para>Charter
</para></entry></row><row><entry command="item" spaces=" "><para><code>ccr</code>
</para></entry><entry command="tab" spaces=" "><para>Computer Concrete
</para></entry></row><row><entry command="item" spaces=" "><para><code>cmr</code>
</para></entry><entry command="tab" spaces=" "><para>Computer Modern
</para></entry></row><row><entry command="item" spaces=" "><para><code>cmss</code>
</para></entry><entry command="tab" spaces=" "><para>Computer Modern Sans Serif
</para></entry></row><row><entry command="item" spaces=" "><para><code>cmtt</code>
</para></entry><entry command="tab" spaces=" "><para>Computer Modern Typewriter
</para></entry></row><row><entry command="item" spaces=" "><para><code>pcr</code>
</para></entry><entry command="tab" spaces=" "><para>Courier
</para></entry></row><row><entry command="item" spaces=" "><para><code>phv</code>
</para></entry><entry command="tab" spaces=" "><para>Helvetica
</para></entry></row><row><entry command="item" spaces=" "><para><code>fi4</code>
</para></entry><entry command="tab" spaces=" "><para>Inconsolata
</para></entry></row><row><entry command="item" spaces=" "><para><code>lmr</code>
</para></entry><entry command="tab" spaces=" "><para>Latin Modern
</para></entry></row><row><entry command="item" spaces=" "><para><code>lmss</code>
</para></entry><entry command="tab" spaces=" "><para>Latin Modern Sans
</para></entry></row><row><entry command="item" spaces=" "><para><code>lmtt</code>
</para></entry><entry command="tab" spaces=" "><para>Latin Modern Typewriter
</para></entry></row><row><entry command="item" spaces=" "><para><code>pnc</code>
</para></entry><entry command="tab" spaces=" "><para>New Century Schoolbook
</para></entry></row><row><entry command="item" spaces=" "><para><code>ppl</code>
</para></entry><entry command="tab" spaces=" "><para>Palatino
</para></entry></row><row><entry command="item" spaces=" "><para><code>ptm</code>
</para></entry><entry command="tab" spaces=" "><para>Times
</para></entry></row><row><entry command="item" spaces=" "><para><code>uncl</code>
</para></entry><entry command="tab" spaces=" "><para>Uncial
</para></entry></row><row><entry command="item" spaces=" "><para><code>put</code>
</para></entry><entry command="tab" spaces=" "><para>Utopia
</para></entry></row><row><entry command="item" spaces=" "><para><code>pzc</code>
</para></entry><entry command="tab" spaces=" "><para>Zapf Chancery
</para></entry></row></tbody></multitable>


<anchor name="low-level-font-commands-fontseries">low level font commands fontseries</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\fontseries&lbrace;<var>series</var>&rbrace;</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="180" mergedindex="cp">\fontseries</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="160">series, of fonts</indexterm></cindex>
<para>Select the font series.  A <dfn>series</dfn> combines a <dfn>weight</dfn> and a
<dfn>width</dfn>.  Typically, a font supports only a few of the possible
combinations.  Some common combined series values include:
</para>
<multitable spaces=" " endspaces=" "><columnprototypes><columnprototype bracketed="on">xx</columnprototype> <columnprototype bracketed="on">Medium (normal)xx</columnprototype></columnprototypes>
<tbody><row><entry command="item" spaces=" "><para><code>m</code>
</para></entry><entry command="tab" spaces=" "><para>Medium (normal)
</para></entry></row><row><entry command="item" spaces=" "><para><code>b</code>
</para></entry><entry command="tab" spaces=" "><para>Bold
</para></entry></row><row><entry command="item" spaces=" "><para><code>c</code>
</para></entry><entry command="tab" spaces=" "><para>Condensed
</para></entry></row><row><entry command="item" spaces=" "><para><code>bc</code>
</para></entry><entry command="tab" spaces=" "><para>Bold condensed
</para></entry></row><row><entry command="item" spaces=" "><para><code>bx</code>
</para></entry><entry command="tab" spaces=" "><para>Bold extended
</para></entry></row></tbody></multitable>

<cindex index="cp" spaces=" "><indexterm index="cp" number="161">weights, of fonts</indexterm></cindex>
<para>The possible values for weight, individually, are:
</para>
<multitable spaces=" " endspaces=" "><columnprototypes><columnprototype bracketed="on">xx</columnprototype> <columnprototype bracketed="on">Medium (normal) xx</columnprototype></columnprototypes>
<tbody><row><entry command="item" spaces=" "><para><code>ul</code>
</para></entry><entry command="tab" spaces=" "><para>Ultra light
</para></entry></row><row><entry command="item" spaces=" "><para><code>el</code>
</para></entry><entry command="tab" spaces=" "><para>Extra light
</para></entry></row><row><entry command="item" spaces=" "><para><code>l</code>
</para></entry><entry command="tab" spaces=" "><para>Light
</para></entry></row><row><entry command="item" spaces=" "><para><code>sl</code>
</para></entry><entry command="tab" spaces=" "><para>Semi light
</para></entry></row><row><entry command="item" spaces=" "><para><code>m</code>
</para></entry><entry command="tab" spaces=" "><para>Medium (normal)
</para></entry></row><row><entry command="item" spaces=" "><para><code>sb</code>
</para></entry><entry command="tab" spaces=" "><para>Semi bold
</para></entry></row><row><entry command="item" spaces=" "><para><code>b</code>
</para></entry><entry command="tab" spaces=" "><para>Bold
</para></entry></row><row><entry command="item" spaces=" "><para><code>eb</code>
</para></entry><entry command="tab" spaces=" "><para>Extra bold
</para></entry></row><row><entry command="item" spaces=" "><para><code>ub</code>
</para></entry><entry command="tab" spaces=" "><para>Ultra bold
</para></entry></row></tbody></multitable>
 
<cindex index="cp" spaces=" "><indexterm index="cp" number="162">widths, of fonts</indexterm></cindex>
<para>The possible values for width, individually, are (the meaning and
relationship of these terms varies with individual typefaces):
</para>
<multitable spaces=" " endspaces=" "><columnprototypes><columnprototype bracketed="on">xx</columnprototype> <columnprototype bracketed="on">Ultra condensed</columnprototype></columnprototypes>
<tbody><row><entry command="item" spaces=" "><para><code>uc</code>
</para></entry><entry command="tab" spaces=" "><para>Ultra condensed
</para></entry></row><row><entry command="item" spaces=" "><para><code>ec</code>
</para></entry><entry command="tab" spaces=" "><para>Extra condensed
</para></entry></row><row><entry command="item" spaces=" "><para><code>c</code>
</para></entry><entry command="tab" spaces=" "><para>Condensed
</para></entry></row><row><entry command="item" spaces=" "><para><code>sc</code>
</para></entry><entry command="tab" spaces=" "><para>Semi condensed
</para></entry></row><row><entry command="item" spaces=" "><para><code>m</code>
</para></entry><entry command="tab" spaces=" "><para>Medium
</para></entry></row><row><entry command="item" spaces=" "><para><code>sx</code>
</para></entry><entry command="tab" spaces=" "><para>Semi expanded
</para></entry></row><row><entry command="item" spaces=" "><para><code>x</code>
</para></entry><entry command="tab" spaces=" "><para>Expanded
</para></entry></row><row><entry command="item" spaces=" "><para><code>ex</code>
</para></entry><entry command="tab" spaces=" "><para>Extra expanded
</para></entry></row><row><entry command="item" spaces=" "><para><code>ux</code>
</para></entry><entry command="tab" spaces=" "><para>Ultra expanded
</para></entry></row></tbody></multitable>

<para>When forming the <var>series</var> string from the weight and width, drop the
<code>m</code> that stands for medium weight or medium width, unless both
weight and width are <code>m</code>, in which case use just one
(<samp><code>m</code></samp>).
</para> 
<anchor name="low-level-font-commands-fontshape">low level font commands fontshape</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\fontshape&lbrace;<var>shape</var>&rbrace;</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="181" mergedindex="cp">\fontshape</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="163">shapes, of fonts</indexterm></cindex>
<para>Select font shape. Valid shapes are:
</para>
<multitable spaces=" " endspaces=" "><columnprototypes><columnprototype bracketed="on">xx</columnprototype> <columnprototype bracketed="on">Slanted (oblique)xx</columnprototype></columnprototypes>
<tbody><row><entry command="item" spaces=" "><para><code>n</code>
</para></entry><entry command="tab" spaces=" "><para>Upright (normal)
</para></entry></row><row><entry command="item" spaces=" "><para><code>it</code>
</para></entry><entry command="tab" spaces=" "><para>Italic
</para></entry></row><row><entry command="item" spaces=" "><para><code>sl</code>
</para></entry><entry command="tab" spaces=" "><para>Slanted (oblique)
</para></entry></row><row><entry command="item" spaces=" "><para><code>sc</code>
</para></entry><entry command="tab" spaces=" "><para>Small caps
</para></entry></row><row><entry command="item" spaces=" "><para><code>ui</code>
</para></entry><entry command="tab" spaces=" "><para>Upright italics
</para></entry></row><row><entry command="item" spaces=" "><para><code>ol</code>
</para></entry><entry command="tab" spaces=" "><para>Outline
</para></entry></row></tbody></multitable>

<para>The two last shapes are not available for most font families, and
small caps are often missing as well.
</para>
<anchor name="low-level-font-commands-fontsize">low level font commands fontsize</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\fontsize&lbrace;<var>size</var>&rbrace;&lbrace;<var>skip</var>&rbrace;</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="182" mergedindex="cp">\fontsize</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="164">font size</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="183" mergedindex="cp">\baselineskip</indexterm></findex>
<para>Set the font size and the line spacing.  The unit of both parameters
defaults to points (<code>pt</code>).  The line spacing is the nominal
vertical space between lines, baseline to baseline.  It is stored in the
parameter <code>\baselineskip</code>.  The default <code>\baselineskip</code> for
the Computer Modern typeface is 1.2 times the <code>\fontsize</code>.
Changing <code>\baselineskip</code> directly is inadvisable since its value is
reset every time a size change happens; instead use
<code>\baselinestretch</code>.  (<pxref label="_005cbaselineskip-_0026-_005cbaselinestretch"><xrefnodename>\baselineskip &amp; \baselinestretch</xrefnodename></pxref>).
</para>
<anchor name="low-level-font-commands-linespread">low level font commands linespread</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\linespread&lbrace;<var>factor</var>&rbrace;</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="184" mergedindex="cp">\linespread</indexterm></findex>
<para>Equivalent to <code>\renewcommand&lbrace;\baselinestretch&rbrace;&lbrace;<var>factor</var>&rbrace;</code>,
and therefore must be followed by <code>\selectfont</code> to have any
effect. Best specified in the preamble. <xref label="_005cbaselineskip-_0026-_005cbaselinestretch"><xrefnodename>\baselineskip &amp;
\baselinestretch</xrefnodename></xref>, for using <code>setspace</code> package instead.
</para>
<anchor name="low-level-font-commands-selectfont">low level font commands selectfont</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\selectfont</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="185" mergedindex="cp">\selectfont</indexterm></findex>
<para>The effects of the font commands described above do not happen until
<code>\selectfont</code> is called, as in
<code>\fontfamily&lbrace;<var>familyname</var>&rbrace;\selectfont</code>.  It is often useful
to put this in a macro:&linebreak;
<code>\newcommand*&lbrace;\myfont&rbrace;&lbrace;\fontfamily&lbrace;<var>familyname</var>&rbrace;\selectfont&rbrace;</code>&linebreak;
(<pxref label="_005cnewcommand-_0026-_005crenewcommand"><xrefnodename>\newcommand &amp; \renewcommand</xrefnodename></pxref>).
</para>
<anchor name="low-level-font-commands-usefont">low level font commands usefont</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\usefont&lbrace;<var>enc</var>&rbrace;&lbrace;<var>family</var>&rbrace;&lbrace;<var>series</var>&rbrace;&lbrace;<var>shape</var>&rbrace;</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="186" mergedindex="cp">\usefont</indexterm></findex>
<para>The same as invoking <code>\fontencoding</code>, <code>\fontfamily</code>,
<code>\fontseries</code> and <code>\fontshape</code> with the given parameters,
followed by <code>\selectfont</code>.  For example:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usefont&lbrace;ot1&rbrace;&lbrace;cmr&rbrace;&lbrace;m&rbrace;&lbrace;n&rbrace;
</pre></example>

</tableitem></tableentry></table>


</section>
</chapter>
<node name="Layout" spaces=" "><nodename>Layout</nodename><nodenext automatic="on">Sectioning</nodenext><nodeprev automatic="on">Fonts</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Layout</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="165">layout commands</indexterm></cindex>

<para>Commands for controlling the general page layout.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::              ">\onecolumn</menunode><menudescription><pre xml:space="preserve">Use one-column layout.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::              ">\twocolumn</menunode><menudescription><pre xml:space="preserve">Use two-column layout.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::            ">\flushbottom</menunode><menudescription><pre xml:space="preserve">Make all text pages the same height.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::           ">\raggedbottom</menunode><menudescription><pre xml:space="preserve">Allow text pages of differing height.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::  ">Page layout parameters</menunode><menudescription><pre xml:space="preserve"><code>\headheight</code> <code>\footskip</code>.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::           ">\baselineskip &amp; \baselinestretch</menunode><menudescription><pre xml:space="preserve">Space between lines.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                  ">Floats</menunode><menudescription><pre xml:space="preserve">Figures, tables, etc.
</pre></menudescription></menuentry></menu>


<node name="_005conecolumn" spaces=" "><nodename>\onecolumn</nodename><nodenext automatic="on">\twocolumn</nodenext><nodeup automatic="on">Layout</nodeup></node>
<section spaces=" "><sectiontitle><code>\onecolumn</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="187" mergedindex="cp">\onecolumn</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="166">one-column output</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\onecolumn
</pre></example>

<para>Start a new page and produce single-column output.  If the document is
given the class option <code>onecolumn</code> then this is the default
behavior (<pxref label="Document-class-options"><xrefnodename>Document class options</xrefnodename></pxref>).  This command is fragile
(<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>

</section>
<node name="_005ctwocolumn" spaces=" "><nodename>\twocolumn</nodename><nodenext automatic="on">\flushbottom</nodenext><nodeprev automatic="on">\onecolumn</nodeprev><nodeup automatic="on">Layout</nodeup></node>
<section spaces=" "><sectiontitle><code>\twocolumn</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="188" mergedindex="cp">\twocolumn</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="167">multicolumn text</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="168">two-column output</indexterm></cindex>

<para>Synopses:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\twocolumn
\twocolumn[<var>prelim one column text</var>]
</pre></example>

<para>Start a new page and produce two-column output. If the document is given
the class option <code>twocolumn</code> then this is the default
(<pxref label="Document-class-options"><xrefnodename>Document class options</xrefnodename></pxref>).  This command is fragile
(<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>If the optional <var>prelim one column text</var> argument
is present, it is typeset in one-column mode before the two-column
typesetting starts.
</para>
<para>These parameters control typesetting in two-column output:
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="189" mergedindex="cp">\columnsep</indexterm>\columnsep</itemformat></item>
</tableterm><tableitem><anchor name="twocolumn-columnsep">twocolumn columnsep</anchor>
<para>The distance between columns. The default is 35pt.  Change it with a
command such as <code>\setlength&lbrace;\columnsep&rbrace;&lbrace;40pt&rbrace;</code>. You must change
it before the two column mode starts; in the preamble is a good
place.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="190" mergedindex="cp">\columnseprule</indexterm>\columnseprule</itemformat></item>
</tableterm><tableitem><anchor name="twocolumn-columnseprule">twocolumn columnseprule</anchor>
<para>The width of the rule between columns. The default is 0pt, meaning that
there is no rule. Otherwise, the rule appears halfway between the two
columns.  Change it with a command such as
<code>\setlength&lbrace;\columnseprule&rbrace;&lbrace;0.4pt&rbrace;</code>, before the two-column
mode starts.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="191" mergedindex="cp">\columnwidth</indexterm>\columnwidth</itemformat></item>
</tableterm><tableitem><anchor name="twocolumn-columnwidth">twocolumn columnwidth</anchor>
<para>The width of a single column.  In one-column mode this is equal to
<code>\textwidth</code>.  In two-column mode by default &latex; sets the
width of each of the two columns, <code>\columnwidth</code>, to be half of
<code>\textwidth</code> minus <code>\columnsep</code>.
</para>
</tableitem></tableentry></ftable>

<para>In a two-column document, the starred environments <code>table*</code> and
<code>figure*</code> are two columns wide, whereas the unstarred environments
<code>table</code> and <code>figure</code> take up only one column (<pxref label="figure"><xrefnodename>figure</xrefnodename></pxref>
and <pxref label="table"><xrefnodename>table</xrefnodename></pxref>). &latex; places starred floats at the top of a page.
The following parameters control float behavior of two-column output.
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<beforefirstitem><anchor name="twocolumn-dbltopfraction">twocolumn dbltopfraction</anchor>
</beforefirstitem><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="192" mergedindex="cp">\dbltopfraction</indexterm>\dbltopfraction</itemformat></item>
</tableterm><tableitem><para>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
the height of a <code>table*</code> or <code>figure*</code> environment must not
exceed <code>0.7\textheight</code>.  If the height of your starred float
environment exceeds this then you can take one of the following actions
to prevent it from floating all the way to the back of the document:
</para>
<itemize commandarg="bullet" spaces=" " endspaces=" "><itemprepend><formattingcommand command="bullet"/></itemprepend>
<listitem><prepend>&bullet;</prepend>
<para>Use the <code>[tp]</code> location specifier to tell &latex; to try to put
the bulky float on a page by itself, as well as at the top of a page.
</para>
</listitem><listitem><prepend>&bullet;</prepend>
<para>Use the <code>[t!]</code> location specifier to override the effect of
<code>\dbltopfraction</code> for this particular float.
</para>
</listitem><listitem><prepend>&bullet;</prepend>
<para>Increase the value of <code>\dbltopfraction</code> to a suitably large number,
to avoid going to float pages so soon.
</para></listitem></itemize>

<para>You can redefine it, as with
<code>\renewcommand&lbrace;\dbltopfraction&rbrace;&lbrace;0.9&rbrace;</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="193" mergedindex="cp">\dblfloatpagefraction</indexterm>\dblfloatpagefraction</itemformat></item>
</tableterm><tableitem><anchor name="twocolumn-dblfloatpagefraction">twocolumn dblfloatpagefraction</anchor>
<para>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;&textrsquo;s default is <code>0.5</code>.  Change it with <code>\renewcommand</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="194" mergedindex="cp">\dblfloatsep</indexterm>\dblfloatsep</itemformat></item>
</tableterm><tableitem><anchor name="twocolumn-dblfloatsep">twocolumn dblfloatsep</anchor>
<para>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
<code>12pt plus2pt minus2pt</code> for a document set at <code>10pt</code> or
<code>11pt</code>, and <code>14pt plus2pt minus4pt</code> for a document set at
<code>12pt</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="195" mergedindex="cp">\dbltextfloatsep</indexterm>\dbltextfloatsep</itemformat></item>
</tableterm><tableitem><anchor name="twocolumn-dbltextfloatsep">twocolumn dbltextfloatsep</anchor>
<para>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</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="196" mergedindex="cp">\dbltopnumber</indexterm>\dbltopnumber</itemformat></item>
</tableterm><tableitem><anchor name="twocolumn-dbltopnumber">twocolumn dbltopnumber</anchor>
<para>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;
default is <code>2</code>.
</para>
</tableitem></tableentry></ftable>

<!-- c From egreg at http://tex.stackexchange.com/a/142232/339 -->
<para>This example uses <code>\twocolumn</code>&textrsquo;s optional argument of to create a
title that spans the two-column article:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\documentclass[twocolumn]&lbrace;article&rbrace;
\newcommand&lbrace;\authormark&rbrace;[1]&lbrace;\textsuperscript&lbrace;#1&rbrace;&rbrace;
\begin&lbrace;document&rbrace;
\twocolumn[&lbrace;% inside this optional argument goes one-column text
  \centering
  \LARGE The Title \\[1.5em]
  \large Author One\authormark&lbrace;1&rbrace;,
         Author Two\authormark&lbrace;2&rbrace;,
         Author Three\authormark&lbrace;1&rbrace; \\[1em]
  \normalsize
  \begin&lbrace;tabular&rbrace;&lbrace;p&lbrace;.2\textwidth&rbrace;&arobase;&lbrace;\hspace&lbrace;2em&rbrace;&rbrace;p&lbrace;.2\textwidth&rbrace;&rbrace;
    \authormark&lbrace;1&rbrace;Department one  &amp;\authormark&lbrace;2&rbrace;Department two \\ 
     School one                   &amp;School two 
  \end&lbrace;tabular&rbrace;\\[3em] % space below title part
  &rbrace;]

Two column text here.
</pre></example>


</section>
<node name="_005cflushbottom" spaces=" "><nodename>\flushbottom</nodename><nodenext automatic="on">\raggedbottom</nodenext><nodeprev automatic="on">\twocolumn</nodeprev><nodeup automatic="on">Layout</nodeup></node>
<section spaces=" "><sectiontitle><code>\flushbottom</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="197" mergedindex="cp">\flushbottom</indexterm></findex>

<para>Make all pages in the documents after this declaration have the same
height, by stretching the vertical space where necessary to fill out the
page.  This is most often used when making two-sided documents since the
differences in facing pages can be glaring.
</para>
<para>If &tex; cannot satisfactorily stretch the vertical space in a page
then you get a message like <samp>Underfull \vbox (badness 10000) has
occurred while \output is active</samp>.  If you get that, one option is to
change to <code>\raggedbottom</code> (<pxref label="_005craggedbottom"><xrefnodename>\raggedbottom</xrefnodename></pxref>).  Alternatively,
you can adjust the <code>textheight</code> to make compatible pages, or you
can add some vertical stretch glue between lines or between paragraphs,
as in <code>\setlength&lbrace;\parskip&rbrace;&lbrace;0ex plus0.1ex&rbrace;</code>.  Your last option
is to, in a final editing stage, adjust the height of individual pages
(<pxref label="_005cenlargethispage"><xrefnodename>\enlargethispage</xrefnodename></pxref>).
</para>
<para>The <code>\flushbottom</code> state is the default only if you select the
<code>twoside</code> document class option (<pxref label="Document-class-options"><xrefnodename>Document class options</xrefnodename></pxref>).
</para>

</section>
<node name="_005craggedbottom" spaces=" "><nodename>\raggedbottom</nodename><nodenext automatic="on">Page layout parameters</nodenext><nodeprev automatic="on">\flushbottom</nodeprev><nodeup automatic="on">Layout</nodeup></node>
<section spaces=" "><sectiontitle><code>\raggedbottom</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="198" mergedindex="cp">\raggedbottom</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="169">stretch, omitting vertical</indexterm></cindex>

<para>Make all later pages the natural height of the material on that page; no
rubber vertical lengths will be stretched.  Thus, in a two-sided
document the facing pages may be different heights.  This command can go
at any point in the document body.  See <ref label="_005cflushbottom"><xrefnodename>\flushbottom</xrefnodename></ref>.
</para>
<para>This is the default unless you select the <code>twoside</code> document class
option (<pxref label="Document-class-options"><xrefnodename>Document class options</xrefnodename></pxref>).
</para>

</section>
<node name="Page-layout-parameters" spaces=" "><nodename>Page layout parameters</nodename><nodenext automatic="on">\baselineskip &amp; \baselinestretch</nodenext><nodeprev automatic="on">\raggedbottom</nodeprev><nodeup automatic="on">Layout</nodeup></node>
<section spaces=" "><sectiontitle>Page layout parameters</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="170">page layout parameters</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="171">parameters, page layout</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="172">layout, page parameters for</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="173">header, parameters for</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="174">footer, parameters for</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="175">running header and footer</indexterm></cindex>

<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="199" mergedindex="cp">\columnsep</indexterm>\columnsep</itemformat></item>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="200" mergedindex="cp">\columnseprule</indexterm>\columnseprule</itemformat></itemx>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="201" mergedindex="cp">\columnwidth</indexterm>\columnwidth</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="202" mergedindex="cp">\columnsep</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="203" mergedindex="cp">\columnseprule</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="204" mergedindex="cp">\columnwidth</indexterm></findex>
<anchor name="page-layout-parameters-columnsep">page layout parameters columnsep</anchor>
<anchor name="page-layout-parameters-columnseprule">page layout parameters columnseprule</anchor>
<anchor name="page-layout-parameters-columnwidth">page layout parameters columnwidth</anchor>
<para>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</code> is in effect (<pxref label="Document-class-options"><xrefnodename>Document class options</xrefnodename></pxref>).
<xref label="_005ctwocolumn"><xrefnodename>\twocolumn</xrefnodename></xref>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="205" mergedindex="cp">\headheight</indexterm>\headheight</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="206" mergedindex="cp">\headheight</indexterm></findex>
<anchor name="page-layout-parameters-headheight">page layout parameters headheight</anchor>
<para>Height of the box that contains the running head.  The default in the
<code>article</code>, <code>report</code>, and <code>book</code> classes is <samp>12pt</samp>,
at all type sizes.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="207" mergedindex="cp">\headsep</indexterm>\headsep</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="208" mergedindex="cp">\headsep</indexterm></findex>
<anchor name="page-layout-parameters-headsep">page layout parameters headsep</anchor>
<para>Vertical distance between the bottom of the header line and the top of
the main text.  The default in the <code>article</code> and <code>report</code>
classes is <samp>25pt</samp>.  In the <code>book</code> class the default is: if the
document is set at 10pt then it is <samp>0.25in</samp>, and at 11pt or 12pt
it is <samp>0.275in</samp>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="209" mergedindex="cp">\footskip</indexterm>\footskip</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="210" mergedindex="cp">\footskip</indexterm></findex>
<anchor name="page-layout-parameters-footskip">page layout parameters footskip</anchor>
<para>Distance from the baseline of the last line of text to the baseline of
the page footer.  The default in the <code>article</code> and <code>report</code>
classes is <samp>30pt</samp>.  In the <code>book</code> class the default is: when
the type size is 10pt the default is <samp>0.35in</samp>, while at 11pt it is
<samp>0.38in</samp>, and at 12pt it is <samp>30pt</samp>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="211" mergedindex="cp">\linewidth</indexterm>\linewidth</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="212" mergedindex="cp">\linewidth</indexterm></findex>
<anchor name="page-layout-parameters-linewidth">page layout parameters linewidth</anchor>
<para>Width of the current line, decreased for each nested <code>list</code>
(<pxref label="list"><xrefnodename>list</xrefnodename></pxref>).  That is, the nominal value for <code>\linewidth</code> is to
equal <code>\textwidth</code> but for each nested list the <code>\linewidth</code>
is decreased by the sum of that list&textrsquo;s <code>\leftmargin</code> and
<code>\rightmargin</code> (<pxref label="itemize"><xrefnodename>itemize</xrefnodename></pxref>).
<!-- c The default varies with the font size, paper width, two-column mode, -->
<!-- c etc.  For an @code{article} document set in 10pt, the default is -->
<!-- c @samp{345pt}, while in two-column mode that becomes @samp{229.5pt}. -->
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="213" mergedindex="cp">\marginparpush</indexterm>\marginparpush</itemformat></item>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="214" mergedindex="cp">\marginsep</indexterm>\marginsep</itemformat></itemx>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="215" mergedindex="cp">\marginparwidth</indexterm>\marginparwidth</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="216" mergedindex="cp">\marginparpush</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="217" mergedindex="cp">\marginsep</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="218" mergedindex="cp">\marginparwidth</indexterm></findex>
<anchor name="page-layout-parameters-marginparpush">page layout parameters marginparpush</anchor>
<anchor name="page-layout-parameters-marginsep">page layout parameters marginsep</anchor>
<anchor name="page-layout-parameters-marginparwidth">page layout parameters marginparwidth</anchor>
<para>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.
</para>
<para>Normally marginal notes appear on the outside of the page, but the
declaration <code>\reversemarginpar</code> changes that (and
<code>\normalmarginpar</code> changes it back).
</para>
<para>The defaults for <code>\marginparpush</code> in both <code>book</code> and
<code>article</code> classes are: <samp>7pt</samp> if the document is set at 12pt,
and <samp>5pt</samp> if the document is set at 11pt or 10pt.
</para>
<para>For <code>\marginsep</code>, in <code>article</code> class the default is
<samp>10pt</samp> except if the document is set at 10pt and in two-column mode
where the default is <samp>11pt</samp>.
</para>
<para>For <code>\marginsep</code> in <code>book</code> class the default is <samp>10pt</samp> in
two-column mode and <samp>7pt</samp> in one-column mode.  
</para>
<para>For <code>\marginparwidth</code> in both <code>book</code> and <code>article</code>
classes, in two-column mode the default is 60% of <code>\paperwidth
&minus; \textwidth</code>, while in one-column mode it is 50% of that
distance.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="219" mergedindex="cp">\oddsidemargin</indexterm>\oddsidemargin</itemformat></item>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="220" mergedindex="cp">\evensidemargin</indexterm>\evensidemargin</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="221" mergedindex="cp">\oddsidemargin</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="222" mergedindex="cp">\evensidemargin</indexterm></findex>
<anchor name="page-layout-parameters-oddsidemargin">page layout parameters oddsidemargin</anchor>
<anchor name="page-layout-parameters-evensidemargin">page layout parameters evensidemargin</anchor>
<!-- c xx TODO re-align on French version that is more complete/accurate. -->
<para>The <code>\oddsidemargin</code> length is the extra distance between the left side of
the page and the text&textrsquo;s left margin, on odd-numbered pages when the
document class option <code>twoside</code> is chosen and on all pages when
<code>oneside</code> is in effect.  When <code>twoside</code> is in effect, on
even-numbered pages the extra distance on the left is
<code>\evensidemargin</code>.
</para>
<para>&latex;&textrsquo;s default is that <code>\oddsidemargin</code> is 40% of the
difference between <code>\paperwidth</code> and <code>\textwidth</code>, and
<code>\evensidemargin</code> is the remainder.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="223" mergedindex="cp">\paperheight</indexterm>\paperheight</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="224" mergedindex="cp">\paperheight</indexterm></findex>
<anchor name="page-layout-parameters-paperheight">page layout parameters paperheight</anchor>
<para>The height of the paper, as distinct from the height of the print area.
Normally set with a document class option, as in
<code>\documentclass[a4paper]&lbrace;article&rbrace;</code> (<pxref label="Document-class-options"><xrefnodename>Document class
options</xrefnodename></pxref>).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="225" mergedindex="cp">\paperwidth</indexterm>\paperwidth</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="226" mergedindex="cp">\paperwidth</indexterm></findex>
<anchor name="page-layout-parameters-paperwidth">page layout parameters paperwidth</anchor>
<para>The width of the paper, as distinct from the width of the print area.
Normally set with a document class option, as in
<code>\documentclass[a4paper]&lbrace;article&rbrace;</code> (<pxref label="Document-class-options"><xrefnodename>Document class
options</xrefnodename></pxref>).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="227" mergedindex="cp">\textheight</indexterm>\textheight</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="228" mergedindex="cp">\textheight</indexterm></findex>
<anchor name="page-layout-parameters-textheight">page layout parameters textheight</anchor>
<para>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</code> or <code>report</code>
the default is <samp>43\baselineskip</samp>, while for a <code>book</code> it is
<samp>41\baselineskip</samp>.  At a type size of 11pt the default is
<samp>38\baselineskip</samp> for all document classes.  At 12pt it is
<samp>36\baselineskip</samp> for all classes.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="229" mergedindex="cp">\textwidth</indexterm>\textwidth</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="230" mergedindex="cp">\textwidth</indexterm></findex>
<anchor name="page-layout-parameters-textwidth">page layout parameters textwidth</anchor>
<para>The full horizontal width of the entire page body.  For an
<code>article</code> or <code>report</code> document, the default is <samp>345pt</samp>
when the chosen type size is 10pt, the default is <samp>360pt</samp> at 11pt,
and it is <samp>390pt</samp> at 12pt.  For a <code>book</code> document, the default
is <samp>4.5in</samp> at a type size of 10pt, and <samp>5in</samp> at 11pt or 12pt.
</para>
<para>In multi-column output, <code>\textwidth</code> remains the width of the
entire page body, while <code>\columnwidth</code> is the width of one column
(<pxref label="_005ctwocolumn"><xrefnodename>\twocolumn</xrefnodename></pxref>).
</para>
<para>In lists (<pxref label="list"><xrefnodename>list</xrefnodename></pxref>), <code>\textwidth</code> remains the width of the
entire page body (and <code>\columnwidth</code> the width of the entire
column), while <code>\linewidth</code> may decrease for nested lists.
</para>
<para>Inside a minipage (<pxref label="minipage"><xrefnodename>minipage</xrefnodename></pxref>) or <code>\parbox</code>
(<pxref label="_005cparbox"><xrefnodename>\parbox</xrefnodename></pxref>), all the width-related parameters are set to the
specified width, and revert to their normal values at the end of the
<code>minipage</code> or <code>\parbox</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="231" mergedindex="cp">\hsize</indexterm>\hsize</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="232" mergedindex="cp">\hsize</indexterm></findex>
<anchor name="page-layout-parameters-hsize">page layout parameters hsize</anchor>
<para>This entry is included for completeness: <code>\hsize</code> is the &tex;
primitive parameter used when text is broken into lines.  It should not
be used in normal &latex; documents.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="233" mergedindex="cp">\topmargin</indexterm>\topmargin</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="234" mergedindex="cp">topmargin</indexterm></findex>
<anchor name="page-layout-parameters-topmargin">page layout parameters topmargin</anchor>
<!-- c xxx TODO re-align on French version that is more accurate. -->
<para>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;
\headheight &minus; \headsep &minus; \textheight &minus; \footskip</code>,
and then divided by two.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="235" mergedindex="cp">\topskip</indexterm>\topskip</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="236" mergedindex="cp">\topskip</indexterm></findex>
<anchor name="page-layout-parameters-topskip">page layout parameters topskip</anchor>
<para>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</samp> at a type size of 10pt.
</para>
</tableitem></tableentry></ftable>


</section>
<node name="_005cbaselineskip-_0026-_005cbaselinestretch" spaces=" "><nodename>\baselineskip &amp; \baselinestretch</nodename><nodenext automatic="on">Floats</nodenext><nodeprev automatic="on">Page layout parameters</nodeprev><nodeup automatic="on">Layout</nodeup></node>
<section spaces=" "><sectiontitle><code>\baselineskip</code> &amp; <code>\baselinestretch</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="237" mergedindex="cp">\baselineskip</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="238" mergedindex="cp">\baselinestretch</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="239" mergedindex="cp">\linespread</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="176">space between lines</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="177">interline space</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="178">leading</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="179">double spacing</indexterm></cindex>

<para>The <code>\baselineskip</code> is a rubber length (<pxref label="Lengths"><xrefnodename>Lengths</xrefnodename></pxref>).  It gives
the <dfn>leading</dfn>, the normal distance between lines in a paragraph, from
baseline to baseline.
</para>
<para>Ordinarily document authors do not directly change <code>\baselineskip</code>
while writing.  Instead, it is set by the low level font selection
command <code>\fontsize</code> (<pxref label="low-level-font-commands-fontsize"><xrefnodename>low level font commands fontsize</xrefnodename></pxref>).
The <code>\baselineskip</code>&textrsquo;s value is reset every time a font change
happens and so any direct change to <code>\baselineskip</code> would vanish
the next time there was a font switch.  For how to influence line
spacing, see the discussion of <code>\baselinestretch</code> below.
</para>
<para>Usually, a font&textrsquo;s size and baseline skip is assigned by the font
designer.  These numbers are nominal in the sense that if, for instance,
a font&textrsquo;s style file has the command <code>\fontsize&lbrace;10pt&rbrace;&lbrace;12pt&rbrace;</code>
then that does not mean that the characters in the font are 10<dmn>pt</dmn> tall;
for instance, parentheses and accented capitals may be taller.  Nor does
it mean that if the lines are spaced less than 12<dmn>pt</dmn> apart then they risk
touching.  Rather these numbers are typographic judgements.  (Often, the
<code>\baselineskip</code> is about twenty percent larger than the font size.)
</para>
<!-- c adapted from FAQ -->
<para>The <code>\baselineskip</code> is not a property of each line but of the
entire paragraph.  As a result, large text in the middle of a paragraph,
such as a single <code>&lbrace;\Huge Q&rbrace;</code>, will be squashed into its line.
&tex; will make sure it doesn&textrsquo;t scrape up against the line above but
won&textrsquo;t change the <code>\baselineskip</code> for that one line to make extra
room above.  For the fix, use a <code>\strut</code> (<pxref label="_005cstrut"><xrefnodename>\strut</xrefnodename></pxref>).
</para>
<para>The value of <code>\baselineskip</code> that &tex; uses for the paragraph is
the value in effect at the blank line or command that ends the paragraph
unit.  So if a document contains this paragraph then its lines will be
scrunched together, compared to lines in surrounding paragraphs.
</para>
<!-- c Adapted from B Beeton's "Lapses in TeX" TB 42:1 p 13. -->
<example endspaces=" ">
<pre xml:space="preserve">Many people see a page break between text and a displayed equation as 
bad style, so in effect the display is part of the paragraph.
Because this display is in footnotesize, the entire paragraph has the
baseline spacing matching that size.
&lbrace;\footnotesize $$a+b = c$$&rbrace;
</pre></example>

<findex index="fn" spaces=" "><indexterm index="fn" number="240" mergedindex="cp">\lineskip</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="241" mergedindex="cp">\lineskiplimit</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="242" mergedindex="cp">\prevdepth</indexterm></findex>
<para>The process for making paragraphs is that when a new line is added, if
the depth of the previous line plus the height of the new line is less
than <code>\baselineskip</code> then &tex; inserts vertical glue to make up
the difference.  There are two fine points.  The first is that if the
lines would be too close together, closer than <code>\lineskiplimit</code>,
then &tex; instead uses <code>\lineskip</code> as the interline glue.  The
second is that &tex; doesn&textrsquo;t actually use the depth of the previous
line.  Instead it uses <code>\prevdepth</code>, which usually contains that
depth.  But at the beginning of the paragraph (or any vertical list) or
just after a rule, <code>\prevdepth</code> has the value -1000<dmn>pt</dmn> and
this special value tells &tex; not to insert any interline glue at the
paragraph start.
</para>
<para>In the standard classes <code>\lineskiplimit</code> is 0<dmn>pt</dmn> and
<code>\lineskip</code> is 1<dmn>pt</dmn>.  By the prior paragraph then, the distance
between lines can approach zero but if it becomes zero (or less than
zero) then the lines jump to 1<dmn>pt</dmn> apart.
</para>
<para>Sometimes authors must, for editing purposes, put the document in double
space or one-and-a-half space.  The right way to influence the interline
distance is via <code>\baselinestretch</code>.  It scales
<code>\baselineskip</code>, and has a default value of 1.0.  It is a command,
not a length, so change the scale factor as in
<code>\renewcommand&lbrace;\baselinestretch&rbrace;&lbrace;1.5&rbrace;\selectfont</code>.
</para>
<para>The most straightforward way to change the line spacing for an entire
document is to put <code>\linespread&lbrace;<var>factor</var>&rbrace;</code> in the preamble.
For double spacing, take <var>factor</var> to be 1.6 and for one-and-a-half
spacing use 1.3.  These number are rough: for instance, since the
<code>\baselineskip</code> is about 1.2 times the font size, multiplying by
1.6 gives a baseline skip to font size ratio of about 2.  (The
<code>\linespread</code> command is defined as
<code>\renewcommand&lbrace;\baselinestretch&rbrace;&lbrace;<var>factor</var>&rbrace;</code> so it won&textrsquo;t
take effect until a font setting happens. But that always takes place at
the start of a document, so there you don&textrsquo;t need to follow it with
<code>\selectfont</code>.)
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="180"><r>package</r>, <code>setspace</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="181"><code>setspace</code> <r>package</r></indexterm></cindex>

<para>A simpler approach is the <code>setspace</code> package.  The basic example:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;setspace&rbrace;
\doublespacing  % or \onehalfspacing for 1.5
</pre></example>

<noindent></noindent>
<para>In the preamble these will start the document off with that sizing.
But you can also use these declarations in the document body to change
the spacing from that point forward, and consequently there is
<code>\singlespacing</code> to return the spacing to normal.  In the
document body, a better practice than using the declarations is to use
environments, such as <code>\begin&lbrace;doublespace&rbrace;
... \end&lbrace;doublespace&rbrace;</code>.  The package also has commands to do
arbitrary spacing: <code>\setstretch&lbrace;<var>factor</var>&rbrace;</code> and
<code>\begin&lbrace;spacing&rbrace;&lbrace;<var>factor</var>&rbrace; ... \end&lbrace;spacing&rbrace;</code>.
This package also keeps the line spacing single-spaced in places
where that is typically desirable, such as footnotes and figure
captions.  See the package documentation.
</para>
</section>
<node name="Floats" spaces=" "><nodename>Floats</nodename><nodeprev automatic="on">\baselineskip &amp; \baselinestretch</nodeprev><nodeup automatic="on">Layout</nodeup></node>
<section spaces=" "><sectiontitle>Floats</sectiontitle>

<para>Some typographic elements, such as figures and tables, cannot be broken
across pages.  They must be typeset outside of the normal flow of text,
for instance floating to the top of a later page.
</para>
<para>&latex; can have a number of different classes of floating material.
The default is the two classes, <code>figure</code> (<pxref label="figure"><xrefnodename>figure</xrefnodename></pxref>) and
<code>table</code> (<pxref label="table"><xrefnodename>table</xrefnodename></pxref>), but you can create a new class with the
package <code>float</code>.
</para>
<para>Within any one float class &latex; always respects the order, so that
the first figure in a document source must be typeset before the second
figure.  However, &latex; may mix the classes, so it can happen that
while the first table appears in the source before the first figure, it
appears in the output after it.
</para>
<para>The placement of floats is subject to parameters, given below, that
limit the number of floats that can appear at the top of a page, and
the bottom, etc. If so many floats are queued that the limits prevent
them all from fitting on a page then &latex; places what it can and
defers the rest to the next page.  In this way, floats may end up
being typeset far from their place in the source.  In particular, a
float that is big may migrate to the end of the document. In which
event, because all floats in a class must appear in sequential order,
every following float in that class also appears at the end.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="182">placement of floats</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="183">specifier, float placement</indexterm></cindex>
<para>In addition to changing the parameters, for each float you can tweak
where the float placement algorithm tries to place it by using its
<var>placement</var> argument.  The possible values are a sequence of the
letters below. The default for both <code>figure</code> and <code>table</code>, in
both <code>article</code> and <code>book</code> classes, is <code>tbp</code>.
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">t</itemformat></item>
</tableterm><tableitem><para>(Top)&textmdash;at the top of a text page.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">b</itemformat></item>
</tableterm><tableitem><para>(Bottom)&textmdash;at the bottom of a text page.  (However, <code>b</code> is not
allowed for full-width floats (<code>figure*</code>) with double-column
output.  To ameliorate this, use the <file>stfloats</file> or
<file>dblfloatfix</file> package, but see the discussion at caveats in the
FAQ: <url><urefurl>https://www.texfaq.org/FAQ-2colfloat</urefurl></url>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">h</itemformat></item>
</tableterm><tableitem><para>(Here)&textmdash;at the position in the text where the <code>figure</code> environment
appears.  However, <code>h</code> is not allowed by itself; <code>t</code> is
automatically added.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="184">here, putting floats</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="185"><r>package</r>, <code>float</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="186"><code>float</code> <r>package</r></indexterm></cindex>

<para>To absolutely force a float to appear &textldquo;here&textrdquo;, you can
<code>\usepackage&lbrace;float&rbrace;</code> and use the <code>H</code> specifier which it
defines.  For further discussion, see the FAQ entry at
<url><urefurl>https://www.texfaq.org/FAQ-figurehere</urefurl></url>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">p</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="187">float page</indexterm></cindex>
<para>(Page of floats)&textmdash;on a separate <dfn>float page</dfn>, which is a page
containing no text, only floats.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">!</itemformat></item>
</tableterm><tableitem><para>Used in addition to one of the above; for this float only, &latex;
ignores the restrictions on both the number of floats that can appear
and the relative amounts of float and non-float text on the page.
The <code>!</code> specifier does <emph>not</emph> mean &textldquo;put the float here&textrdquo;;
see above.
</para>
</tableitem></tableentry></table>

<para>Note: the order in which letters appear in the <var>placement</var> argument
does not change the order in which &latex; tries to place the float;
for instance, <code>btp</code> has the same effect as <code>tbp</code>.  All that
<var>placement</var> does is that if a letter is not present then the
algorithm does not try that location.  Thus, &latex;&textrsquo;s default of
<code>tbp</code> is to try every location except placing the float where it
occurs in the source.
</para>
<para>To prevent &latex; from moving floats to the end of the document or a
chapter you can use a <code>\clearpage</code> command to start a new page and
insert all pending floats. If a pagebreak is undesirable then you can
use the <file>afterpage</file> package and issue
<code>\afterpage&lbrace;\clearpage&rbrace;</code>.  This will wait until the current page
is finished and then flush all outstanding floats.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="188"><r>package</r>, <code>flafter</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="189"><code>flafter</code> <r>package</r></indexterm></cindex>

<para>&latex; can typeset a float before where it appears in the source
(although on the same output page) if there is a <code>t</code> specifier in
the <var>placement</var> parameter.  If this is not desired, and deleting
the <code>t</code> is not acceptable as it keeps the float from being placed
at the top of the next page, then you can prevent it by either using
the <code>flafter</code> package or using the command
<findex index="fn" spaces=" "><indexterm index="fn" number="243" mergedindex="cp">\suppressfloats</indexterm></findex>
<code>\suppressfloats[t]</code>, which causes floats for the top position on
this page to moved to the next page.
</para>
<para>Parameters relating to fractions of pages occupied by float and
non-float text (change them with
<code>\renewcommand&lbrace;<var>parameter</var>&rbrace;&lbrace;<var>decimal between 0 and 1</var>&rbrace;</code>):
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="244" mergedindex="cp">\bottomfraction</indexterm>\bottomfraction</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="245" mergedindex="cp">\bottomfraction</indexterm></findex>
<anchor name="floats-bottomfraction">floats bottomfraction</anchor>
<para>The maximum fraction of the page allowed to be occupied by floats at
the bottom; default <samp>.3</samp>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="246" mergedindex="cp">\floatpagefraction</indexterm>\floatpagefraction</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="247" mergedindex="cp">\floatpagefraction</indexterm></findex>
<anchor name="floats-floatpagefraction">floats floatpagefraction</anchor>
<para>The minimum fraction of a float page that must be occupied by floats;
default <samp>.5</samp>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="248" mergedindex="cp">\textfraction</indexterm>\textfraction</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="249" mergedindex="cp">\textfraction</indexterm></findex>
<anchor name="floats-textfraction">floats textfraction</anchor>
<para>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</samp>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="250" mergedindex="cp">\topfraction</indexterm>\topfraction</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="251" mergedindex="cp">\topfraction</indexterm></findex>
<anchor name="floats-topfraction">floats topfraction</anchor>
<para>Maximum fraction at the top of a page that may be occupied before
floats; default <samp>.7</samp>.
</para></tableitem></tableentry></ftable>

<para>Parameters relating to vertical space around floats (change them with a
command of the form <code>\setlength&lbrace;<var>parameter</var>&rbrace;&lbrace;<var>length
expression</var>&rbrace;</code>):
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="252" mergedindex="cp">\floatsep</indexterm>\floatsep</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="253" mergedindex="cp">\floatsep</indexterm></findex>
<anchor name="floats-floatsep">floats floatsep</anchor>
<para>Space between floats at the top or bottom of a page; default
<samp>12pt plus2pt minus2pt</samp>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="254" mergedindex="cp">\intextsep</indexterm>\intextsep</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="255" mergedindex="cp">\intextsep</indexterm></findex>
<anchor name="floats-intextsep">floats intextsep</anchor>
<para>Space above and below a float in the middle of the main text; default
<samp>12pt plus2pt minus2pt</samp> for 10 point and 11 point documents,
and <samp>14pt plus4pt minus4pt</samp> for 12 point documents.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="256" mergedindex="cp">\textfloatsep</indexterm>\textfloatsep</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="257" mergedindex="cp">\textfloatsep</indexterm></findex>
<anchor name="floats-textfloatsep">floats textfloatsep</anchor>
<para>Space between the last (first) float at the top (bottom) of a page;
default <samp>20pt plus2pt minus4pt</samp>.
</para></tableitem></tableentry></ftable>

<para>Counters relating to the number of floats on a page (change them with a
command of the form <code>\setcounter&lbrace;<var>ctrname</var>&rbrace;&lbrace;<var>natural
number</var>&rbrace;</code>):
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="258" mergedindex="cp">bottomnumber</indexterm>bottomnumber</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="259" mergedindex="cp">bottomnumber</indexterm></findex>
<anchor name="floats-bottomnumber">floats bottomnumber</anchor>
<para>Maximum number of floats that can appear at the bottom of a text page;
default 1.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="260" mergedindex="cp">dbltopnumber</indexterm>dbltopnumber</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="261" mergedindex="cp">dbltopnumber</indexterm></findex>
<anchor name="floats-dbltopnumber">floats dbltopnumber</anchor>
<para>Maximum number of full-sized floats that can appear at the top of a
two-column page; default 2.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="262" mergedindex="cp">topnumber</indexterm>topnumber</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="263" mergedindex="cp">topnumber</indexterm></findex>
<anchor name="floats-topnumber">floats topnumber</anchor>
<para>Maximum number of floats that can appear at the top of a text page;
default 2.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="264" mergedindex="cp">totalnumber</indexterm>totalnumber</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="265" mergedindex="cp">totalnumber</indexterm></findex>
<anchor name="floats-totalnumber">floats totalnumber</anchor>
<para>Maximum number of floats that can appear on a text page; default 3.
</para></tableitem></tableentry></ftable>

<para>The principal &tex;&nbsp;FAQ entry relating to floats
<url><urefurl>https://www.texfaq.org/FAQ-floats</urefurl></url> contains
suggestions for relaxing &latex;&textrsquo;s default parameters to reduce the
problem of floats being pushed to the end.  A full explanation of the
float placement algorithm is in Frank Mittelbach&textrsquo;s article &textldquo;How to
influence the position of float environments like figure and table in
&latex;?&textrdquo;
(<url><urefurl>https://www.latex-project.org/publications/2014-FMi-TUB-tb111mitt-float-placement.pdf</urefurl></url>).
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::          ">\caption</menunode><menudescription><pre xml:space="preserve">Make a caption for a floating environment.
</pre></menudescription></menuentry></menu>


<node name="_005ccaption" spaces=" "><nodename>\caption</nodename><nodeup automatic="on">Floats</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\caption</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="266" mergedindex="cp">\caption</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="190">captions</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\caption&lbrace;<var>caption-text</var>&rbrace;
</pre></example>

<noindent></noindent>
<para>or
</para>
<example endspaces=" ">
<pre xml:space="preserve">\caption[<var>short-caption-text</var>]&lbrace;<var>caption-text</var>&rbrace;
</pre></example>

<para>Make a caption for a floating environment, such as a <code>figure</code> or
<code>table</code> environment (<pxref label="figure"><xrefnodename>figure</xrefnodename></pxref> or <ref label="table"><xrefnodename>table</xrefnodename></ref>).
</para>
<para>In this example, &latex; places a caption below the vertical blank
space that is left by the author for the later inclusion of a picture.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;figure&rbrace;
  \vspace*&lbrace;1cm&rbrace;
  \caption&lbrace;Alonzo Cushing, Battery A, 4th US Artillery.&rbrace;
  \label&lbrace;fig:CushingPic&rbrace;
\end&lbrace;figure&rbrace;
</pre></example>

<noindent></noindent>
<para>The <code>\caption</code> command will label the <var>caption-text</var> with
something like <samp>Figure&nbsp;1:</samp> for an article or
<samp>Figure&nbsp;1.1:</samp> for a book.  The text is centered if it is
shorter than the text width, or set as an unindented paragraph if it
takes more than one line.
</para>
<para>In addition to placing the <var>caption-text</var> in the output, the
<code>\caption</code> command also saves that information for use in a list of
figures or list of tables (<pxref label="Table-of-contents-etc_002e"><xrefnodename>Table of contents etc.</xrefnodename></pxref>).
</para>
<para>Here the <code>\caption</code> command uses the optional
<var>short-caption-text</var>, so that the shorter text appears in the list
of tables, rather than the longer <var>caption-text</var>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;table&rbrace;
  \centering
  \begin&lbrace;tabular&rbrace;&lbrace;|*&lbrace;3&rbrace;&lbrace;c&rbrace;|&rbrace;
    \hline
    4  &amp;9  &amp;2 \\
    3  &amp;5  &amp;7 \\ 
    8  &amp;1  &amp;6 \\
    \hline
  \end&lbrace;tabular&rbrace;
  \caption[\textit&lbrace;Lo Shu&rbrace; magic square]&lbrace;%
    The \textit&lbrace;Lo Shu&rbrace; magic square, which is unique among
    squares of order three up to rotation and reflection.&rbrace;
  \label&lbrace;tab:LoShu&rbrace;
\end&lbrace;table&rbrace;
</pre></example>

<noindent></noindent>
<para>&latex; will label the <var>caption-text</var> with something like
<samp>Table&nbsp;1:</samp> for an article or <samp>Table&nbsp;1.1:</samp> for a
book.
</para>
<para>The caption can appear at the top of the <code>figure</code> or <code>table</code>.
For instance, that would happen in the prior example by putting the
<code>\caption</code> between the <code>\centering</code> and the
<code>\begin&lbrace;tabular&rbrace;</code>.
</para>
<para>Different floating environments are numbered separately, by default.  It
is <code>\caption</code> that updates the counter, and so any <code>\label</code>
must come after the <code>\caption</code>.  The counter for the <code>figure</code>
environment is named <code>figure</code>, and similarly the counter for the
<code>table</code> environment is <code>table</code>.
</para>
<para>The text that will be put in the list of figures or list of tables is
moving argument.  If you get the &latex; error <samp>! Argument of
\&arobase;caption has an extra &rbrace;</samp> then you must put <code>\protect</code> in front
of any fragile commands. <xref label="_005cprotect"><xrefnodename>\protect</xrefnodename></xref>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="191"><r>package</r>, <code>caption</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="192"><code>caption</code> <r>package</r></indexterm></cindex>

<para>The <code>caption</code> package has many options to adjust how the caption
appears, for example changing the font size, making the caption be
hanging text rather than set as a paragraph, or making the caption
always set as a paragraph rather than centered when it is short.
</para>

</subsection>
</section>
</chapter>
<node name="Sectioning" spaces=" "><nodename>Sectioning</nodename><nodenext automatic="on">Cross references</nodenext><nodeprev automatic="on">Layout</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Sectioning</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="193">sectioning commands</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="194">part</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="195">chapter</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="196">section</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="197">subsection</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="198">subsubsection</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="199">paragraph</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="200">subparagraph</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="267" mergedindex="cp">\part</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="268" mergedindex="cp">\chapter</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="269" mergedindex="cp">\section</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="270" mergedindex="cp">\subsection</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="271" mergedindex="cp">\subsubsection</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="272" mergedindex="cp">\paragraph</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="273" mergedindex="cp">\subparagraph</indexterm></findex>

<para>Structure your text into divisions: parts, chapters, sections, etc.  All
sectioning commands have the same form, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve"><var>sectioning-command</var>&lbrace;<var>title</var>&rbrace;
<var>sectioning-command</var>*&lbrace;<var>title</var>&rbrace;
<var>sectioning-command</var>[<var>toc-title</var>]&lbrace;<var>title</var>&rbrace;
</pre></example>

<noindent></noindent>
<para>For instance, declare the start of a subsection as with
<code>\subsection&lbrace;Motivation&rbrace;</code>.
</para>
<para>The table has each <var>sectioning-command</var> in &latex;.  All are
available in all of &latex;&textrsquo;s standard document classes <code>book</code>,
<code>report</code>, and&nbsp;<code>article</code>, except that <code>\chapter</code> is
not available in <code>article</code>.
</para>
<multitable spaces=" " endspaces=" "><columnfractions line=".25 .25 .40 "><columnfraction value=".25"></columnfraction><columnfraction value=".25"></columnfraction><columnfraction value=".40"></columnfraction></columnfractions>
<thead><row><entry command="headitem" spaces=" "><para>Sectioning unit  </para></entry><entry command="tab" spaces=" "><para>Command  </para></entry><entry command="tab" spaces=" "><para>Level 
</para></entry></row></thead><tbody><row><entry command="item" spaces=" "><para>Part
</para></entry><entry command="tab" spaces=" "><para><code>\part</code>  </para></entry><entry command="tab" spaces=" "><para>-1 (<code>book</code>, <code>report</code>), 0 (<code>article</code>)
</para></entry></row><row><entry command="item" spaces=" "><para>Chapter
</para></entry><entry command="tab" spaces=" "><para><code>\chapter</code>   </para></entry><entry command="tab" spaces=" "><para>0
</para></entry></row><row><entry command="item" spaces=" "><para>Section
</para></entry><entry command="tab" spaces=" "><para><code>\section</code>   </para></entry><entry command="tab" spaces=" "><para>1 
</para></entry></row><row><entry command="item" spaces=" "><para>Subsection
</para></entry><entry command="tab" spaces=" "><para><code>\subsection</code>   </para></entry><entry command="tab" spaces=" "><para>2 
</para></entry></row><row><entry command="item" spaces=" "><para>Subsubsection
</para></entry><entry command="tab" spaces=" "><para><code>\subsubsection</code>   </para></entry><entry command="tab" spaces=" "><para>3  
</para></entry></row><row><entry command="item" spaces=" "><para>Paragraph
</para></entry><entry command="tab" spaces=" "><para><code>\paragraph</code>   </para></entry><entry command="tab" spaces=" "><para>4  
</para></entry></row><row><entry command="item" spaces=" "><para>Subparagraph
</para></entry><entry command="tab" spaces=" "><para><code>\subparagraph</code>   </para></entry><entry command="tab" spaces=" "><para>5  
</para></entry></row></tbody></multitable>

<cindex index="cp" spaces=" "><indexterm index="cp" number="201"><code>*</code>-form of sectioning commands</indexterm></cindex>
<para>All these commands have a <code>*</code>-form that prints <var>title</var> as usual
but does not number it and does not make an entry in the table of contents.
An example of using this is for an appendix in an <code>article</code>.  The
input <code>\appendix\section&lbrace;Appendix&rbrace;</code> gives the output <samp>A
Appendix</samp> (<pxref label="_005cappendix"><xrefnodename>\appendix</xrefnodename></pxref>).  You can lose the numbering&nbsp;<samp>A</samp>
by instead entering <code>\section*&lbrace;Appendix&rbrace;</code> (articles often omit a
table of contents and have simple page headers so the other differences
from the <code>\section</code> command may not matter).
</para>
<para>The section title <var>title</var> 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 label="Page-styles"><xrefnodename>Page styles</xrefnodename></pxref>).  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</var> for these other places.
</para>
<para>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&textrsquo;s <var>level</var> is less than or equal to the value of the counter
<code>secnumdepth</code> then the titles for this sectioning command will be
numbered (<pxref label="Sectioning_002fsecnumdepth"><xrefnodename>Sectioning/secnumdepth</xrefnodename></pxref>).  And, if <var>level</var> is less
than or equal to the value of the counter <code>tocdepth</code> then the table
of contents will have an entry for this sectioning unit
(<pxref label="Sectioning_002ftocdepth"><xrefnodename>Sectioning/tocdepth</xrefnodename></pxref>).
</para>
<para>&latex; expects that before you have a <code>\subsection</code> you will have
a <code>\section</code> and, in a <code>book</code> class document, that before a
<code>\section</code> you will have a <code>\chapter</code>.  Otherwise you can get
something like a subsection numbered <samp>3.0.1</samp>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="202"><r>package</r>, <code>titlesec</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="203"><code>titlesec</code> <r>package</r></indexterm></cindex>

<para>&latex; lets you change the appearance of the sectional units.  As a
simple example, you can change the section numbering to upper-case
letters with <code>\renewcommand\thesection&lbrace;\Alph&lbrace;section&rbrace;&rbrace;</code> in the
preamble (<pxref label="_005calph-_005cAlph-_005carabic-_005croman-_005cRoman-_005cfnsymbol"><xrefnodename>\alph \Alph \arabic \roman \Roman \fnsymbol</xrefnodename></pxref>).  CTAN
has many packages that make this adjustment easier, notably
<code>titlesec</code>.
</para>
<para>Two counters relate to the appearance of headings made by sectioning commands.
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="274" mergedindex="cp">secnumdepth</indexterm>secnumdepth</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="275" mergedindex="cp">secnumdepth <r>counter</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="204">section numbers, printing</indexterm></cindex>
<anchor name="sectioning-secnumdepth">sectioning secnumdepth</anchor>
<anchor name="Sectioning_002fsecnumdepth">Sectioning/secnumdepth</anchor>
<para>Controls which sectioning unit are numbered.  Setting the counter with
<code>\setcounter&lbrace;secnumdepth&rbrace;&lbrace;<var>level</var>&rbrace;</code> will suppress
numbering of sectioning at any depth greater than <var>level</var>
(<pxref label="_005csetcounter"><xrefnodename>\setcounter</xrefnodename></pxref>).  See the above table for the level numbers.
For instance, if the <code>secnumdepth</code> is 1 in an <code>article</code> then
a <code>\section&lbrace;Introduction&rbrace;</code> command will produce output like
<samp>1 Introduction</samp> while <code>\subsection&lbrace;Discussion&rbrace;</code> will
produce output like <samp>Discussion</samp>, without the number. &latex;&textrsquo;s
default <code>secnumdepth</code> is&nbsp;3 in <file>article</file> class and
&nbsp;2 in the <file>book</file> and <file>report</file> classes.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="276" mergedindex="cp">tocdepth</indexterm>tocdepth</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="277" mergedindex="cp">tocdepth <r>counter</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="205">table of contents, sectioning numbers printed</indexterm></cindex>
<anchor name="sectioning-tocdepth">sectioning tocdepth</anchor>
<anchor name="Sectioning_002ftocdepth">Sectioning/tocdepth</anchor>
<para>Controls which sectioning units are listed in the table of contents.
The setting <code>\setcounter&lbrace;tocdepth&rbrace;&lbrace;<var>level</var>&rbrace;</code> makes the
sectioning units at <var>level</var> be the smallest ones listed
(<pxref label="_005csetcounter"><xrefnodename>\setcounter</xrefnodename></pxref>).  See the above table for the level numbers.  For
instance, if <code>tocdepth</code> is&nbsp;1 then the table of contents will
list sections but not subsections.  &latex;&textrsquo;s default
<code>tocdepth</code> is&nbsp;3 in <file>article</file> class and &nbsp;2 in the
<file>book</file> and <file>report</file> classes.
</para>
</tableitem></tableentry></ftable>

<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::                                         ">\part</menunode><menudescription><pre xml:space="preserve">Start a part.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                                      ">\chapter</menunode><menudescription><pre xml:space="preserve">Start a chapter.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                                      ">\section</menunode><menudescription><pre xml:space="preserve">Start a section.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                                   ">\subsection</menunode><menudescription><pre xml:space="preserve">Start a subsection.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::   ">\subsubsection &amp; \paragraph &amp; \subparagraph</menunode><menudescription><pre xml:space="preserve">Lower divisions.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                                     ">\appendix</menunode><menudescription><pre xml:space="preserve">Start appendices.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::      ">\frontmatter &amp; \mainmatter &amp; \backmatter</menunode><menudescription><pre xml:space="preserve">The three parts of a book.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                               ">\&arobase;startsection</menunode><menudescription><pre xml:space="preserve">Sectional unit headings.
</pre></menudescription></menuentry></menu>


<node name="_005cpart" spaces=" "><nodename>\part</nodename><nodenext automatic="on">\chapter</nodenext><nodeup automatic="on">Sectioning</nodeup></node>
<section spaces=" "><sectiontitle><code>\part</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="278" mergedindex="cp">\part</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="206">part</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="207">sectioning, part</indexterm></cindex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\part&lbrace;<var>title</var>&rbrace;
\part*&lbrace;<var>title</var>&rbrace;
\part[<var>toc-title</var>]&lbrace;<var>title</var>&rbrace;
</pre></example>

<para>Start a document part.  The standard &latex; classes <code>book</code>,
<code>report</code>, and <code>article</code>, all have this command.
</para>
<para>This produces a document part, in a book.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\part&lbrace;VOLUME I \\
       PERSONAL MEMOIRS OF  U.\ S.\ GRANT&rbrace;
\chapter&lbrace;ANCESTRY--BIRTH--BOYHOOD.&rbrace;
My family is American, and has been for generations,
in all its branches, direct and collateral.
</pre></example>

<para>In each standard class the <code>\part</code> command outputs a part number
such as <samp>Part I</samp>, alone on its line, in boldface, and in large
type.  Then &latex; outputs <var>title</var>, also alone on its line, in
bold and in even larger type.  In class <code>book</code>, 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</code> it is again alone on a page, but
&latex; won&textrsquo;t force it onto an odd-numbered page.  In an <code>article</code>
&latex; does not put it on a fresh page, but instead outputs the part
number and part title onto the main document page.
</para>
<para>The <code>*</code>&nbsp;form shows <var>title</var> 
but it does not show the part number, does not increment the
<code>part</code> counter, and produces no table of contents entry.
</para>
<para>The optional argument <var>toc-title</var> will appear as the part title in
the table of contents (<pxref label="Table-of-contents-etc_002e"><xrefnodename>Table of contents etc.</xrefnodename></pxref>) and in running
headers (<pxref label="Page-styles"><xrefnodename>Page styles</xrefnodename></pxref>).  If it is not present then <var>title</var>
will be there.  This example puts a line break in <var>title</var> but omits
the break in the table of contents.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\part[Up from the bottom; my life]&lbrace;Up from the bottom\\ my life&rbrace;
</pre></example>

<para>For determining which sectional units are numbered and which appear in
the table of contents, the level number of a part is&nbsp;-1
(<pxref label="Sectioning_002fsecnumdepth"><xrefnodename>Sectioning/secnumdepth</xrefnodename></pxref>, and <ref label="Sectioning_002ftocdepth"><xrefnodename>Sectioning/tocdepth</xrefnodename></ref>).
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="208"><r>package</r>, <code>indentfirst</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="209"><code>indentfirst</code> <r>package</r></indexterm></cindex>

<para>In the class <code>article</code>, if a paragraph immediately follows the part
title then it is not indented.  To get an indent you can use the package
<code>indentfirst</code>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="210"><r>package</r>, <code>titlesec</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="211"><code>titlesec</code> <r>package</r></indexterm></cindex>

<para>One package to change the behavior of <code>\part</code> is <code>titlesec</code>.
See its documentation on CTAN.
</para>

</section>
<node name="_005cchapter" spaces=" "><nodename>\chapter</nodename><nodenext automatic="on">\section</nodenext><nodeprev automatic="on">\part</nodeprev><nodeup automatic="on">Sectioning</nodeup></node>
<section spaces=" "><sectiontitle><code>\chapter</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="279" mergedindex="cp">\chapter</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="212">chapter</indexterm></cindex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\chapter&lbrace;<var>title</var>&rbrace;
\chapter*&lbrace;<var>title</var>&rbrace;
\chapter[<var>toc-title</var>]&lbrace;<var>title</var>&rbrace;
</pre></example>

<para>Start a chapter.  The standard &latex; classes <code>book</code> and
<code>report</code> have this command but <code>article</code> does not.
</para>
<para>This produces a chapter.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\chapter&lbrace;Loomings&rbrace;
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.
</pre></example>

<para>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</samp> in large boldface type (the size is
<code>\huge</code>).  It then puts <var>title</var> on a fresh line, in boldface
type that is still larger (size <code>\Huge</code>).  It also increments the
<code>chapter</code> counter, adds an entry to the table of contents
(<pxref label="Table-of-contents-etc_002e"><xrefnodename>Table of contents etc.</xrefnodename></pxref>), and sets the running header
information (<pxref label="Page-styles"><xrefnodename>Page styles</xrefnodename></pxref>).
</para>
<para>The <code>*</code>&nbsp;form shows <var>title</var> on a fresh line, in boldface.
But it does not show the chapter number, does not increment the
<code>chapter</code> counter, produces no table of contents entry, and does
not affect the running header.  (If you use the page style
<code>headings</code> in a two-sided document then the header will be from the
prior chapter.)  This example illustrates.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\chapter*&lbrace;Preamble&rbrace;
</pre></example>

<para>The optional argument <var>toc-title</var> will appear as the chapter title
in the table of contents (<pxref label="Table-of-contents-etc_002e"><xrefnodename>Table of contents etc.</xrefnodename></pxref>) and in
running headers (<pxref label="Page-styles"><xrefnodename>Page styles</xrefnodename></pxref>).  If it is not present then
<var>title</var> will be there.  This shows the full name in the chapter
title,
</para>
<example endspaces=" ">
<pre xml:space="preserve">\chapter[Weyl]&lbrace;Hermann Klaus Hugo (Peter) Weyl (1885--1955)&rbrace;
</pre></example>

<noindent></noindent>
<para>but only <samp>Weyl</samp> on the contents page.  This puts a line break in
the title but that doesn&textrsquo;t work well with running headers so it omits
the break in the contents
</para>
<example endspaces=" ">
<pre xml:space="preserve">\chapter[Given it all; my story]&lbrace;Given it all\\ my story&rbrace;
</pre></example>

<para>For determining which sectional units are numbered and which appear in
the table of contents, the level number of a chapter is&nbsp;0
(<pxref label="Sectioning_002fsecnumdepth"><xrefnodename>Sectioning/secnumdepth</xrefnodename></pxref> and <pxref label="Sectioning_002ftocdepth"><xrefnodename>Sectioning/tocdepth</xrefnodename></pxref>).
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="213"><r>package</r>, <code>indentfirst</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="214"><code>indentfirst</code> <r>package</r></indexterm></cindex>

<para>The paragraph that follows the chapter title is not indented, as is a
standard typographical practice.  To get an indent use the package
<code>indentfirst</code>.
</para>
<para>You can change what is shown for the chapter number.  To change it to
something like <samp>Lecture 1</samp>, put in the preamble either
<code>\renewcommand&lbrace;\chaptername&rbrace;&lbrace;Lecture&rbrace;</code> or this
(<pxref label="_005cmakeatletter-_0026-_005cmakeatother"><xrefnodename>\makeatletter &amp; \makeatother</xrefnodename></pxref>).
</para>
<example endspaces=" ">
<pre xml:space="preserve">\makeatletter
\renewcommand&lbrace;\&arobase;chapapp&rbrace;&lbrace;Lecture&rbrace;
\makeatother
</pre></example>

<cindex index="cp" spaces=" "><indexterm index="cp" number="215"><r>package</r>, <code>babel</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="216"><code>babel</code> <r>package</r></indexterm></cindex>

<noindent></noindent><para>To make this change because of the primary language for
the document, see the package <code>babel</code>.
</para>
<para>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&nbsp;<ref label="_005cclearpage-_0026-_005ccleardoublepage"><xrefnodename>\clearpage &amp; \cleardoublepage</xrefnodename></ref>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="217"><r>package</r>, <code>titlesec</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="218"><code>titlesec</code> <r>package</r></indexterm></cindex>

<para>To change the behavior of the <code>\chapter</code> 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
<code>titlesec</code>.  See its documentation, but the example below gives a
sense of what it can do.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;titlesec&rbrace;   % in preamble
\titleformat&lbrace;\chapter&rbrace;
  &lbrace;\Huge\bfseries&rbrace;  % format of title
  &lbrace;&rbrace;                % label, such as 1.2 for a subsection
  &lbrace;0pt&rbrace;             % length of separation between label and title
  &lbrace;&rbrace;                % before-code hook
</pre></example>

<noindent></noindent>
<para>This omits the chapter number <samp>Chapter 1</samp> from the page but unlike
<code>\chapter*</code> it keeps the chapter in the table of contents and the
running headers.
</para>

</section>
<node name="_005csection" spaces=" "><nodename>\section</nodename><nodenext automatic="on">\subsection</nodenext><nodeprev automatic="on">\chapter</nodeprev><nodeup automatic="on">Sectioning</nodeup></node>
<section spaces=" "><sectiontitle><code>\section</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="280" mergedindex="cp">\section</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="219">section</indexterm></cindex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\section&lbrace;<var>title</var>&rbrace;
\section*&lbrace;<var>title</var>&rbrace;
\section[<var>toc-title</var>]&lbrace;<var>title</var>&rbrace;
</pre></example>

<para>Start a section.  The standard &latex; classes <code>article</code>,
<code>book</code>, and <code>report</code> all have this command.
</para>
<para>This produces a section.
</para>
<example endspaces=" ">
<pre xml:space="preserve">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&lbrace;Turing machines&rbrace;
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.
</pre></example>

<para>For the standard &latex; classes <code>book</code> and <code>report</code> the
default output is like <samp>1.2 <var>title</var></samp> (for chapter&nbsp;1,
section&nbsp;2), alone on its line and flush left, in boldface and a
larger type (the type size is <code>\Large</code>).  The same holds in
<code>article</code> except that there are no chapters in that class so it
looks like <samp>2 <var>title</var></samp>.
</para>
<para>The <code>*</code>&nbsp;form shows <var>title</var>.
But it does not show the section number, does not increment the
<code>section</code> counter, produces no table of contents entry, and does
not affect the running header.  (If you use the page style
<code>headings</code> in a two-sided document then the header will be from the
prior section.)
</para>
<para>The optional argument <var>toc-title</var> will appear as the section title
in the table of contents (<pxref label="Table-of-contents-etc_002e"><xrefnodename>Table of contents etc.</xrefnodename></pxref>) and in
running headers (<pxref label="Page-styles"><xrefnodename>Page styles</xrefnodename></pxref>).  If it is not present then
<var>title</var> will be there.  This shows the full name in the title of the
section: 
</para>
<example endspaces=" ">
<pre xml:space="preserve">\section[Elizabeth~II]&lbrace;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.&rbrace;
</pre></example>

<noindent></noindent>
<para>but only <samp>Elizabeth II</samp> on the contents page and in the headers.
This has a line break in <var>title</var> but that does not work with headers
so it is omitted from the contents and headers.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\section[Truth is, I cheated; my life story]&lbrace;Truth is,
  I cheated\\my life story&rbrace;
</pre></example>

<para>For determining which sectional units are numbered and which appear in
the table of contents, the level number of a section is&nbsp;1
(<pxref label="Sectioning_002fsecnumdepth"><xrefnodename>Sectioning/secnumdepth</xrefnodename></pxref> and <pxref label="Sectioning_002ftocdepth"><xrefnodename>Sectioning/tocdepth</xrefnodename></pxref>).
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="220"><r>package</r>, <code>indentfirst</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="221"><code>indentfirst</code> <r>package</r></indexterm></cindex>

<para>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 <code>indentfirst</code>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="222"><r>package</r>, <code>titlesec</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="223"><code>titlesec</code> <r>package</r></indexterm></cindex>

<para>In general, to change the behavior of the <code>\section</code> command, there
are a number of options.  One is the <code>\&arobase;startsection</code> command
(<pxref label="_005c_0040startsection"><xrefnodename>\&arobase;startsection</xrefnodename></pxref>).  There are also many packages on CTAN that
address this, including <code>titlesec</code>.  See the documentation but the
example below gives a sense of what they can do.
</para>
<!-- c credit: egreg https://groups.google.com/forum/#!topic/comp.text.tex/tvc8oM5P4y4 -->
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;titlesec&rbrace;   % in preamble
\titleformat&lbrace;\section&rbrace;
  &lbrace;\normalfont\Large\bfseries&rbrace;  % format of title
  &lbrace;\makebox[1pc][r]&lbrace;\thesection\hspace&lbrace;1pc&rbrace;&rbrace;&rbrace; % label
  &lbrace;0pt&rbrace;                   % length of separation between label and title
  &lbrace;&rbrace;                      % before-code hook
\titlespacing*&lbrace;\section&rbrace;
  &lbrace;-1pc&rbrace;&lbrace;18pt&rbrace;&lbrace;10pt&rbrace;[10pc]
</pre></example>

<noindent></noindent>
<para>That puts the section number in the margin.
</para>

</section>
<node name="_005csubsection" spaces=" "><nodename>\subsection</nodename><nodenext automatic="on">\subsubsection &amp; \paragraph &amp; \subparagraph</nodenext><nodeprev automatic="on">\section</nodeprev><nodeup automatic="on">Sectioning</nodeup></node>
<section spaces=" "><sectiontitle><code>\subsection</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="281" mergedindex="cp">\subsection</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="224">subsection</indexterm></cindex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\subsection&lbrace;<var>title</var>&rbrace;
\subsection*&lbrace;<var>title</var>&rbrace;
\subsection[<var>toc-title</var>]&lbrace;<var>title</var>&rbrace;
</pre></example>

<para>Start a subsection.  The standard &latex; classes <code>article</code>,
<code>book</code>, and <code>report</code> all have this command.
</para>
<para>This produces a subsection.
</para>
<example endspaces=" ">
<pre xml:space="preserve">We will show that there are more functions than Turing machines and that
therefore some functions have no associated machine.

\subsection&lbrace;Cardinality&rbrace; We will begin with two paradoxes that
dramatize the challenge to our intuition posed by comparing the sizes of
infinite sets.
</pre></example>

<para>For the standard &latex; classes <code>book</code> and <code>report</code> the
default output is like <samp>1.2.3 <var>title</var></samp> (for chapter&nbsp;1,
section&nbsp;2, subsection&nbsp;3), alone on its line and flush left, in
boldface and a larger type (the type size is <code>\large</code>).  The same
holds in <code>article</code> except that there are no chapters in that class
so it looks like <samp>2.3 <var>title</var></samp>.
</para>
<para>The <code>*</code>&nbsp;form shows <var>title</var>.
But it does not show the subsection number, does not increment the
<code>subsection</code> counter, and produces no table of contents entry.
</para>
<para>The optional argument <var>toc-title</var> will appear as the subsection title
in the table of contents (<pxref label="Table-of-contents-etc_002e"><xrefnodename>Table of contents etc.</xrefnodename></pxref>).  If it is
not present then <var>title</var> will be there.  This
shows the full text in the title of the subsection:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\subsection[$\alpha,\beta,\gamma$ paper]&lbrace;\textit&lbrace;The Origin of
  Chemical Elements&rbrace; by R.A.~Alpher, H.~Bethe, and G.~Gamow&rbrace;
</pre></example>

<noindent></noindent>
<para>but only <samp><U>03B1</U>,<U>03B2</U>,<U>03B3</U>
paper</samp> on the contents page.
</para>
<para>For determining which sectional units are numbered and which appear in
the table of contents, the level number of a subsection is&nbsp;2
(<pxref label="Sectioning_002fsecnumdepth"><xrefnodename>Sectioning/secnumdepth</xrefnodename></pxref> and <pxref label="Sectioning_002ftocdepth"><xrefnodename>Sectioning/tocdepth</xrefnodename></pxref>).
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="225"><r>package</r>, <code>indentfirst</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="226"><code>indentfirst</code> <r>package</r></indexterm></cindex>

<para>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 <code>indentfirst</code>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="227"><r>package</r>, <code>titlesec</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="228"><code>titlesec</code> <r>package</r></indexterm></cindex>

<para>There are a number of ways to change the behavior of the
<code>\subsection</code> command.  One is the <code>\&arobase;startsection</code> command
(<pxref label="_005c_0040startsection"><xrefnodename>\&arobase;startsection</xrefnodename></pxref>).  There are also many packages on CTAN that
address this, including <code>titlesec</code>.  See the documentation but the
example below gives a sense of what they can do.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;titlesec&rbrace;   % in preamble
\titleformat&lbrace;\subsection&rbrace;[runin]
  &lbrace;\normalfont\normalsize\bfseries&rbrace;  % format of the title
  &lbrace;\thesubsection&rbrace;                   % label
  &lbrace;0.6em&rbrace;                            % space between label and title
  &lbrace;&rbrace;                                 % before-code hook
</pre></example>

<noindent></noindent>
<para>That puts the subsection number and <var>title</var> in the first line of
text.
</para>

</section>
<node name="_005csubsubsection-_0026-_005cparagraph-_0026-_005csubparagraph" spaces=" "><nodename>\subsubsection &amp; \paragraph &amp; \subparagraph</nodename><nodenext automatic="on">\appendix</nodenext><nodeprev automatic="on">\subsection</nodeprev><nodeup automatic="on">Sectioning</nodeup></node>

<section spaces=" "><sectiontitle><code>\subsubsection</code>, <code>\paragraph</code>, <code>\subparagraph</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="282" mergedindex="cp">\subsubsection</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="229">subsubsection</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="283" mergedindex="cp">\paragraph</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="230">paragraph</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="284" mergedindex="cp">\subparagraph</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="231">subparagraph</indexterm></cindex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\subsubsection&lbrace;<var>title</var>&rbrace;
\subsubsection*&lbrace;<var>title</var>&rbrace;
\subsubsection[<var>toc-title</var>]&lbrace;<var>title</var>&rbrace;
</pre></example>

<noindent></noindent>
<para>or one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\paragraph&lbrace;<var>title</var>&rbrace;
\paragraph*&lbrace;<var>title</var>&rbrace;
\paragraph[<var>toc-title</var>]&lbrace;<var>title</var>&rbrace;
</pre></example>

<noindent></noindent>
<para>or one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\subparagraph&lbrace;<var>title</var>&rbrace;
\subparagraph*&lbrace;<var>title</var>&rbrace;
\subparagraph[<var>toc-title</var>]&lbrace;<var>title</var>&rbrace;
</pre></example>

<para>Start a subsubsection, paragraph, or subparagraph.  The standard
&latex; classes <code>article</code>, <code>book</code>, and <code>report</code> all have
these commands, although they are not commonly used.
</para>
<para>This produces a subsubsection.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\subsubsection&lbrace;Piston ring compressors: structural performance&rbrace;
Provide exterior/interior wall cladding assemblies
capable of withstanding the effects of load and stresses from 
consumer-grade gasoline engine piston rings.
</pre></example>

<para>The default output of each of the three does not change over the
standard &latex; classes <code>article</code>, <code>book</code>, and
<code>report</code>.  For <code>\subsubsection</code> the <var>title</var> is alone on
its line, in boldface and normal size type.  For <code>\paragraph</code> the
<var>title</var> is inline with the text, not indented, in boldface and
normal size type.  For <code>\subparagraph</code> the <var>title</var> is inline
with the text, with a paragraph indent, in boldface and normal size type
(Because an <code>article</code> has no chapters its subsubsections are
numbered and so it looks like <samp>1.2.3 <var>title</var></samp>, for
section&nbsp;1, subsection&nbsp;2, and subsubsection&nbsp;3.  The other
two divisions are not numbered.)
</para>
<para>The <code>*</code>&nbsp;form shows <var>title</var>.  But it does not increment the
associated counter and produces no table of contents entry (and does not
show the number for <code>\subsubsection</code>).
</para>
<para>The optional argument <var>toc-title</var> will appear as the division title
in the table of contents (<pxref label="Table-of-contents-etc_002e"><xrefnodename>Table of contents etc.</xrefnodename></pxref>).  If it is
not present then <var>title</var> will be there.
</para>
<para>For determining which sectional units are numbered and which appear in
the table of contents, the level number of a subsubsection is&nbsp;3, of
a paragraph is&nbsp;4, and of a subparagraph is&nbsp;5
(<pxref label="Sectioning_002fsecnumdepth"><xrefnodename>Sectioning/secnumdepth</xrefnodename></pxref> and <pxref label="Sectioning_002ftocdepth"><xrefnodename>Sectioning/tocdepth</xrefnodename></pxref>).
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="232"><r>package</r>, <code>indentfirst</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="233"><code>indentfirst</code> <r>package</r></indexterm></cindex>

<para>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 <code>indentfirst</code>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="234"><r>package</r>, <code>titlesec</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="235"><code>titlesec</code> <r>package</r></indexterm></cindex>

<para>There are a number of ways to change the behavior of the these commands.
One is the <code>\&arobase;startsection</code> command (<pxref label="_005c_0040startsection"><xrefnodename>\&arobase;startsection</xrefnodename></pxref>).
There are also many packages on CTAN that address this, including
<code>titlesec</code>.  See the documentation on CTAN.
</para>

</section>
<node name="_005cappendix" spaces=" "><nodename>\appendix</nodename><nodenext automatic="on">\frontmatter &amp; \mainmatter &amp; \backmatter</nodenext><nodeprev automatic="on">\subsubsection &amp; \paragraph &amp; \subparagraph</nodeprev><nodeup automatic="on">Sectioning</nodeup></node>

<section spaces=" "><sectiontitle><code>\appendix</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="285" mergedindex="cp">\appendix</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="236">appendix</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="237">appendices</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\appendix
</pre></example>

<para>This does not directly produce any output.  But in a book or report it
declares that subsequent <code>\chapter</code> commands start an appendix.  In
an article it does the same, for <code>\section</code> commands.  It also
resets the <code>chapter</code> and <code>section</code> counters to&nbsp;0 in a
book or report, and in an article resets the <code>section</code> and
<code>subsection</code> counters.
</para>
<para>In this book
</para>
<example endspaces=" ">
<pre xml:space="preserve">\chapter&lbrace;One&rbrace;  ...
\chapter&lbrace;Two&rbrace;  ...
 ...
\appendix
\chapter&lbrace;Three&rbrace;  ...
\chapter&lbrace;Four&rbrace;  ...
</pre></example>

<noindent></noindent>
<para>the first two will generate output numbered <samp>Chapter 1</samp> and
<samp>Chapter 2</samp>.  After the <code>\appendix</code> the numbering will be
<samp>Appendix A</samp> and <samp>Appendix B</samp>.  <xref label="Larger-book-template"><xrefnodename>Larger book template</xrefnodename></xref>,
for another example.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="238"><r>package</r>, <code>appendix</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="239"><code>appendix</code> <r>package</r></indexterm></cindex>

<para>The <code>appendix</code> package adds the command
<code>\appendixpage</code> to put a separate <samp>Appendices</samp> in the document
body before the first appendix, and the command <code>\addappheadtotoc</code>
to do the same in the table of contents.  You can reset the name
<samp>Appendices</samp> with a command like
<code>\renewcommand&lbrace;\appendixname&rbrace;&lbrace;Specification&rbrace;</code>, as well as a
number of other features.  See the documentation on CTAN.
</para>

</section>
<node name="_005cfrontmatter-_0026-_005cmainmatter-_0026-_005cbackmatter" spaces=" "><nodename>\frontmatter &amp; \mainmatter &amp; \backmatter</nodename><nodenext automatic="on">\&arobase;startsection</nodenext><nodeprev automatic="on">\appendix</nodeprev><nodeup automatic="on">Sectioning</nodeup></node>
<section spaces=" "><sectiontitle><code>\frontmatter</code>, <code>\mainmatter</code>, <code>\backmatter</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="286" mergedindex="cp">\frontmatter</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="240">book, front matter</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="241">front matter of a book</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="287" mergedindex="cp">\mainmatter</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="242">book, main matter</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="243">main matter of a book</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="288" mergedindex="cp">\backmatter</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="244">book, back matter</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="245">book, end matter</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="246">back matter of a book</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="247">end matter of a book</indexterm></cindex>

<para>Synopsis, one or more of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\frontmatter
...
\mainmatter
...
\backmatter
...
</pre></example>

<para>Format a <code>book</code> class document differently according to which part
of the document is being produced.  All three commands are optional.
</para>
<para>Traditionally, a book&textrsquo;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.
</para>
<para>The <code>\frontmatter</code> command makes the pages numbered in lowercase
roman, and makes chapters not numbered, although each chapter&textrsquo;s title
appears in the table of contents; if you use other sectioning commands
here, use the <code>*</code>-version (<pxref label="Sectioning"><xrefnodename>Sectioning</xrefnodename></pxref>).
</para>
<para>The <code>\mainmatter</code> command changes the behavior back to the expected
version, and resets the page number.
</para>
<para>The <code>\backmatter</code> command leaves the page numbering alone but
switches the chapters back to being not numbered.
</para>
<para><xref label="Larger-book-template"><xrefnodename>Larger book template</xrefnodename></xref>, for an example using these three commands.
</para>

</section>
<node name="_005c_0040startsection" spaces=" "><nodename>\&arobase;startsection</nodename><nodeprev automatic="on">\frontmatter &amp; \mainmatter &amp; \backmatter</nodeprev><nodeup automatic="on">Sectioning</nodeup></node>
<section spaces=" "><sectiontitle><code>\&arobase;startsection</code>, typesetting sectional unit headings</sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="289" mergedindex="cp">\&arobase;startsection</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="248">section, redefining</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\&arobase;startsection&lbrace;<var>name</var>&rbrace;&lbrace;<var>level</var>&rbrace;&lbrace;<var>indent</var>&rbrace;&lbrace;<var>beforeskip</var>&rbrace;&lbrace;<var>afterskip</var>&rbrace;&lbrace;<var>style</var>&rbrace;
</pre></example>

<para>Used to help redefine the behavior of commands that start sectioning
divisions such as <code>\section</code> or <code>\subsection</code>.
</para>
<para>Note that the <code>titlesec</code> package makes manipulation of sectioning
easier.  Further, while most requirements for sectioning commands can be
satisfied with <code>\&arobase;startsection</code>, some cannot.  For instance, in
the standard &latex; <code>book</code> and <code>report</code> classes the commands
<code>\chapter</code> and <code>\report</code> are not constructed in this way.  To
make such a command you may want to use the <code>\secdef</code> command.
<!-- c xx define, and make a cross reference to, secdef. -->
</para>
<para>Technically, <code>\&arobase;startsection</code> has the form
</para>
<example endspaces=" ">
<pre xml:space="preserve">\&arobase;startsection&lbrace;<var>name</var>&rbrace;
  &lbrace;<var>level</var>&rbrace;
  &lbrace;<var>indent</var>&rbrace;
  &lbrace;<var>beforeskip</var>&rbrace;
  &lbrace;<var>afterskip</var>&rbrace;
  &lbrace;<var>style</var>&rbrace;*[<var>toctitle</var>]&lbrace;<var>title</var>&rbrace;
</pre></example>

<noindent></noindent>
<para>so that issuing
</para>
<example endspaces=" ">
<pre xml:space="preserve">\renewcommand&lbrace;\section&rbrace;&lbrace;\&arobase;startsection&lbrace;<var>name</var>&rbrace;
  &lbrace;<var>level</var>&rbrace;
  &lbrace;<var>indent</var>&rbrace;
  &lbrace;<var>beforeskip</var>&rbrace;
  &lbrace;<var>afterskip</var>&rbrace;
  &lbrace;<var>style</var>&rbrace;&rbrace;
</pre></example>

<noindent></noindent>
<para>redefines <code>\section</code> while keeping its standard calling form
<code>\section*[<var>toctitle</var>]&lbrace;<var>title</var>&rbrace;</code> (in which, for reminder,
the star&nbsp;<code>*</code> is optional).  <xref label="Sectioning"><xrefnodename>Sectioning</xrefnodename></xref>.  This implies
that when you write a command like
<code>\renewcommand&lbrace;\section&rbrace;&lbrace;...&rbrace;</code>, the
<code>\&arobase;startsection&lbrace;...&rbrace;</code> must come last in the definition.  See the
examples below.
</para>
<table commandarg="var" spaces=" " endspaces=" ">
<beforefirstitem>
</beforefirstitem><tableentry><tableterm><item spaces=" "><itemformat command="var">name</itemformat></item>
</tableterm><tableitem><anchor name="startsection-name">startsection name</anchor>
<anchor name="_005c_0040startsection_002fname">\&arobase;startsection/name</anchor>
<para>Name of the counter used to number the sectioning header.  This counter
must be defined separately.  Most commonly this is either
<code>section</code>, <code>subsection</code>, or <code>paragraph</code>.  Although in
those cases the counter name is the same as the sectioning command
itself, you don&textrsquo;t have to use the same name.
</para>
<para>Then <code>\the</code><var>name</var> displays the title number and
<code>\</code><var>name</var><code>mark</code> is for the page headers.  See the third
example below.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">level</itemformat></item>
</tableterm><tableitem><anchor name="startsection-level">startsection level</anchor>
<anchor name="_005c_0040startsection_002flevel">\&arobase;startsection/level</anchor>
<para>An integer giving the depth of the sectioning command.
<xref label="Sectioning"><xrefnodename>Sectioning</xrefnodename></xref>, for the list of standard level numbers.
</para>
<para>If <var>level</var> is less than or equal to the value of the counter
<code>secnumdepth</code> then titles for this sectioning command will be
numbered (<pxref label="Sectioning_002fsecnumdepth"><xrefnodename>Sectioning/secnumdepth</xrefnodename></pxref>).  For instance, if
<code>secnumdepth</code> is 1 in an <code>article</code> then the command
<code>\section&lbrace;Introduction&rbrace;</code> will produce output like &textldquo;1
Introduction&textrdquo; while <code>\subsection&lbrace;Discussion&rbrace;</code> will produce
output like &textldquo;Discussion&textrdquo;, without the number prefix.
</para>
<para>If <var>level</var> is less than or equal to the value of the counter
<var>tocdepth</var> then the table of contents will have an entry for this
sectioning unit (<pxref label="Sectioning_002ftocdepth"><xrefnodename>Sectioning/tocdepth</xrefnodename></pxref>).  For instance, in an
<code>article</code>, if <var>tocdepth</var> is 1 then the table of contents will
list sections but not subsections.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">indent</itemformat></item>
</tableterm><tableitem><anchor name="startsection-indent">startsection indent</anchor>
<anchor name="_005c_0040startsection_002findent">\&arobase;startsection/indent</anchor>
<para>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</code>.  A negative indentation such as <code>-\parindent</code> will move
the title into the left margin.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">beforeskip</itemformat></item>
</tableterm><tableitem><anchor name="startsection-beforeskip">startsection beforeskip</anchor>
<anchor name="_005c_0040startsection_002fbeforeskip">\&arobase;startsection/beforeskip</anchor>
<para>The absolute value of this length is the amount of vertical space that
is inserted before this sectioning unit&textrsquo;s title.  This space will be
discarded if the sectioning unit happens to start at the beginning of a
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</code>
is <code>-1pt plus -2pt minus -3pt</code>.)
</para>
<para>For example, if <var>beforeskip</var> is <code>-3.5ex plus -1ex minus -0.2ex</code>
then to start the new sectioning unit, &latex; will add about 3.5 times
the height of a letter x in vertical space, and the first paragraph in
the section will not be indented.  Using a rubber length, with
<code>plus</code> and <code>minus</code>, is good practice here since it gives
&latex; more flexibility in making up the page (<pxref label="Lengths"><xrefnodename>Lengths</xrefnodename></pxref>).
</para>
<para>The full accounting of the vertical space between the baseline of the
line prior to this sectioning unit&textrsquo;s header and the baseline of the
header is that it is the sum of the <code>\parskip</code> of the text font,
the <code>\baselineskip</code> of the title font, and the absolute value of
the <var>beforeskip</var>.  This space is typically rubber so it may stretch
or shrink.  (If the sectioning unit starts on a fresh page so that the
vertical space is discarded then the baseline of the header text will be
where &latex; would put the baseline of the first text line on that
page.)
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">afterskip</itemformat></item>
</tableterm><tableitem><anchor name="startsection-afterskip">startsection afterskip</anchor>
<anchor name="_005c_0040startsection_002fafterskip">\&arobase;startsection/afterskip</anchor>
<para>This is a length.  If <var>afterskip</var> is non-negative then this is the
vertical space inserted after the sectioning unit&textrsquo;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</code> is <code>-1pt plus -2pt minus -3pt</code>.)
</para>
<para>As with <var>beforeskip</var>, using a rubber length, with <code>plus</code> and
<code>minus</code> components, is good practice here since it gives &latex;
more flexibility in putting together the page.
</para>
<para>If <code>afterskip</code> is non-negative then the full accounting of the
vertical space between the baseline of the sectioning unit&textrsquo;s header and
the baseline of the first line of the following paragraph is that it is
the sum of the <code>\parskip</code> of the title font, the
<code>\baselineskip</code> of the text font, and the value of <var>after</var>.
That space is typically rubber so it may stretch or shrink.  (Note that
because the sign of <code>afterskip</code> changes the sectioning unit
header&textrsquo;s from standalone to run-in, you cannot use a negative
<code>afterskip</code> to cancel part of the <code>\parskip</code>.)
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">style</itemformat></item>
</tableterm><tableitem><anchor name="startsection-style">startsection style</anchor>
<anchor name="_005c_0040startsection_002fstyle">\&arobase;startsection/style</anchor>
<para>Controls the styling of the title.  See the examples below.  Typical
commands to use here are <code>\centering</code>, <code>\raggedright</code>,
<code>\normalfont</code>, <code>\hrule</code>, or <code>\newpage</code>.  The last command
in <var>style</var> may be one that takes one argument, such as
<code>\MakeUppercase</code> or <code>\fbox</code> that takes one argument.  The
section title will be supplied as the argument to this command. For
instance, setting <var>style</var> to <code>\bfseries\MakeUppercase</code> would
produce titles that are bold and uppercase.
</para></tableitem></tableentry></table>

<para>These are &latex;&textrsquo;s defaults for the first three sectioning units that
are defined with <code>\&arobase;startsection</code>, for the <file>article</file>,
<file>book</file>, and <file>report</file> classes.
</para>
<itemize commandarg="bullet" endspaces=" "><itemprepend>&bullet;</itemprepend>
<listitem><prepend>&bullet;</prepend>
<para>For <code>section</code>: <var>level</var> is 1, <var>indent</var> is 0<dmn>pt</dmn>,
<var>beforeskip</var> is <code>-3.5ex plus -1ex minus -0.2ex</code>,
<var>afterskip</var> is <code>2.3ex plus 0.2ex</code>, and <var>style</var> is
<code>\normalfont\Large\bfseries</code>.
</para>
</listitem><listitem><prepend>&bullet;</prepend>
<para>For <code>subsection</code>: <var>level</var> is 2, <var>indent</var> is 0<dmn>pt</dmn>,
<var>beforeskip</var> is <code>-3.25ex plus -1ex minus <w>-0.2ex</w></code>,
<var>afterskip</var> is <code>1.5ex plus 0.2ex</code>, and <var>style</var> is
<code>\normalfont\large\bfseries</code>.
</para>
</listitem><listitem><prepend>&bullet;</prepend>
<raggedright endspaces=" ">
<para>For <code>subsubsection</code>: <var>level</var> is 3, <var>indent</var> is 0<dmn>pt</dmn>,
<var>beforeskip</var> is <code>-3.25ex plus -1ex minus -0.2ex</code>,
<var>afterskip</var> is <code>1.5ex plus 0.2ex</code>, and <var>style</var> is
<code>\normalfont\normalsize\bfseries</code>.
</para></raggedright>
</listitem></itemize>

<para>Some examples follow.  These 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</code> command and a
<code>\makeatother</code>.  (Probably the error message <code>You can't use
`\spacefactor' in vertical mode.</code>  means that you forgot this.)
<xref label="_005cmakeatletter-_0026-_005cmakeatother"><xrefnodename>\makeatletter &amp; \makeatother</xrefnodename></xref>.
</para>
<para>This will put section titles in large boldface type, centered.  It says
<code>\renewcommand</code> because &latex;&textrsquo;s standard classes have already
defined a <code>\section</code>.  For the same reason it does not define a
<code>section</code> counter, or the commands <code>\thesection</code> and
<code>\l&arobase;section</code>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\renewcommand\section&lbrace;%
  \&arobase;startsection&lbrace;section&rbrace;% <ref label="_005c_0040startsection_002fname"><xrefnodename>\&arobase;startsection/name</xrefnodename><xrefinfoname><var>name</var></xrefinfoname><xrefprinteddesc><var>name</var></xrefprinteddesc></ref>
    &lbrace;1&rbrace;% <ref label="_005c_0040startsection_002flevel"><xrefnodename>\&arobase;startsection/level</xrefnodename><xrefinfoname><var>level</var></xrefinfoname><xrefprinteddesc><var>level</var></xrefprinteddesc></ref>
    &lbrace;0pt&rbrace;% <ref label="_005c_0040startsection_002findent"><xrefnodename>\&arobase;startsection/indent</xrefnodename><xrefinfoname><var>indent</var></xrefinfoname><xrefprinteddesc><var>indent</var></xrefprinteddesc></ref>
    &lbrace;-3.5ex plus -1ex minus -.2ex&rbrace;% <ref label="_005c_0040startsection_002fbeforeskip"><xrefnodename>\&arobase;startsection/beforeskip</xrefnodename><xrefinfoname><var>beforeskip</var></xrefinfoname><xrefprinteddesc><var>beforeskip</var></xrefprinteddesc></ref>
    &lbrace;2.3ex plus.2ex&rbrace;% <ref label="_005c_0040startsection_002fafterskip"><xrefnodename>\&arobase;startsection/afterskip</xrefnodename><xrefinfoname><var>afterskip</var></xrefinfoname><xrefprinteddesc><var>afterskip</var></xrefprinteddesc></ref>
    &lbrace;\centering\normalfont\Large\bfseries&rbrace;% <ref label="_005c_0040startsection_002fstyle"><xrefnodename>\&arobase;startsection/style</xrefnodename><xrefinfoname><var>style</var></xrefinfoname><xrefprinteddesc><var>style</var></xrefprinteddesc></ref>
  &rbrace;
</pre></example>

<para>This will put <code>subsection</code> titles in small caps type, inline with the paragraph.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\renewcommand\subsection&lbrace;%
  \&arobase;startsection&lbrace;subsection&rbrace;%  <ref label="_005c_0040startsection_002fname"><xrefnodename>\&arobase;startsection/name</xrefnodename><xrefinfoname><var>name</var></xrefinfoname><xrefprinteddesc><var>name</var></xrefprinteddesc></ref>
    &lbrace;2&rbrace;% <ref label="_005c_0040startsection_002flevel"><xrefnodename>\&arobase;startsection/level</xrefnodename><xrefinfoname><var>level</var></xrefinfoname><xrefprinteddesc><var>level</var></xrefprinteddesc></ref>
    &lbrace;0em&rbrace;% <ref label="_005c_0040startsection_002findent"><xrefnodename>\&arobase;startsection/indent</xrefnodename><xrefinfoname><var>indent</var></xrefinfoname><xrefprinteddesc><var>indent</var></xrefprinteddesc></ref>
    &lbrace;-1ex plus 0.1ex minus -0.05ex&rbrace;% <ref label="_005c_0040startsection_002fbeforeskip"><xrefnodename>\&arobase;startsection/beforeskip</xrefnodename><xrefinfoname><var>beforeskip</var></xrefinfoname><xrefprinteddesc><var>beforeskip</var></xrefprinteddesc></ref>
    &lbrace;-1em plus 0.2em&rbrace;% <ref label="_005c_0040startsection_002fafterskip"><xrefnodename>\&arobase;startsection/afterskip</xrefnodename><xrefinfoname><var>afterskip</var></xrefinfoname><xrefprinteddesc><var>afterskip</var></xrefprinteddesc></ref>
    &lbrace;\scshape&rbrace;% <ref label="_005c_0040startsection_002fstyle"><xrefnodename>\&arobase;startsection/style</xrefnodename><xrefinfoname><var>style</var></xrefinfoname><xrefprinteddesc><var>style</var></xrefprinteddesc></ref>
  &rbrace;
</pre></example>

<para>The prior examples redefined existing sectional unit title commands.
This defines a new one, illustrating the needed counter and macros to
display that counter.
</para>
<!-- c From https://groups.google.com/forum/#!searchin/comp.text.tex/startsection%7Csort:relevance/comp.text.tex/sB-nTS-oL08/ZZeKYdG0llMJ -->
<example endspaces=" ">
<pre xml:space="preserve">\setcounter&lbrace;secnumdepth&rbrace;&lbrace;6&rbrace;% show counters this far down
\newcounter&lbrace;subsubparagraph&rbrace;[subparagraph]% counter for numbering
\renewcommand&lbrace;\thesubsubparagraph&rbrace;%               how to display 
  &lbrace;\thesubparagraph.\&arobase;arabic\c&arobase;subsubparagraph&rbrace;%  numbering
\newcommand&lbrace;\subsubparagraph&rbrace;&lbrace;\&arobase;startsection
                         &lbrace;subsubparagraph&rbrace;%
                         &lbrace;6&rbrace;%
                         &lbrace;0em&rbrace;%
                         &lbrace;\baselineskip&rbrace;%
                         &lbrace;0.5\baselineskip&rbrace;%
                         &lbrace;\normalfont\normalsize&rbrace;&rbrace;
\newcommand*\l&arobase;subsubparagraph&lbrace;\&arobase;dottedtocline&lbrace;6&rbrace;&lbrace;10em&rbrace;&lbrace;5em&rbrace;&rbrace;% for toc
\newcommand&lbrace;\subsubparagraphmark&rbrace;[1]&lbrace;&rbrace;% for page headers
</pre></example>


</section>
</chapter>
<node name="Cross-references" spaces=" "><nodename>Cross references</nodename><nodenext automatic="on">Environments</nodenext><nodeprev automatic="on">Sectioning</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Cross references</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="249">cross references</indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="250">label</indexterm></cindex>
<para>We often want something like <samp>See Theorem~31</samp>.  But by-hand typing
the 31 is poor practice.  Instead you should write a <dfn>label</dfn> such as
<code>\label&lbrace;eq:GreensThm&rbrace;</code> and then <dfn>reference</dfn> it, as with
<code>See equation~\ref&lbrace;eq:GreensThm&rbrace;</code>.  &latex; will automatically
work out the number, put it into the output, and will change that number
later if needed.
</para>
<example endspaces=" ">
<pre xml:space="preserve">We will see this with Theorem~\ref&lbrace;th:GreensThm&rbrace;. % forward reference
...
\begin&lbrace;theorem&rbrace; \label&lbrace;th:GreensThm&rbrace;
  ...
\end&lbrace;theorem&rbrace;
...
See Theorem~\ref&lbrace;th:GreensThm&rbrace; on page~\pageref&lbrace;th:GreensThm&rbrace;.
</pre></example>

<para>&latex; tracks cross reference information in a file having the
extension <file>.aux</file> and with the same base name as the file containing
the <code>\label</code>.  So if <code>\label</code> is in <file>calculus.tex</file> then
the information is in <file>calculus.aux</file>.  &latex; puts the
information in that file every time it runs across a <code>\label</code>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="251">forward reference</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="252">reference, forward</indexterm></cindex>
<para>The behavior described in the prior paragraph results in a quirk that
happens when your document has a <dfn>forward reference</dfn>, a <code>\ref</code>
that appears before the associated <code>\label</code>.  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</samp>
and in the output the forward reference will appear as two question
marks&nbsp;<samp>??</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.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="253"><r>package</r>, <code>cleveref</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="254"><code>cleveref</code> <r>package</r></indexterm></cindex>
 <para>The <code>cleveref</code> package enhances &latex;&textrsquo;s
cross referencing features.  You can arrange that if you enter
<code>\begin&lbrace;thm&rbrace;\label&lbrace;th:Nerode&rbrace;...\end&lbrace;thm&rbrace;</code> then
<code>\cref&lbrace;th:Nerode&rbrace;</code> will output <samp>Theorem 3.21</samp>, without you
having to enter the &textldquo;Theorem.&textrdquo;
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::      ">\label</menunode><menudescription><pre xml:space="preserve">Assign a symbolic name to a piece of text.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::    ">\pageref</menunode><menudescription><pre xml:space="preserve">Refer to a page number.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::        ">\ref</menunode><menudescription><pre xml:space="preserve">Refer to a section, figure or similar.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::        ">xr package</menunode><menudescription><pre xml:space="preserve">References from another document.
</pre></menudescription></menuentry></menu>


<node name="_005clabel" spaces=" "><nodename>\label</nodename><nodenext automatic="on">\pageref</nodenext><nodeup automatic="on">Cross references</nodeup></node>
<section spaces=" "><sectiontitle><code>\label</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="290" mergedindex="cp">\label</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\label&lbrace;<var>key</var>&rbrace;
</pre></example>

<para>Assign a reference number to <var>key</var>.  In ordinary text
<code>\label&lbrace;<var>key</var>&rbrace;</code> assigns to <var>key</var> the number of the
current sectional unit. Inside an environment with numbering, such as a
<code>table</code> or <code>theorem</code> environment, <code>\label&lbrace;<var>key</var>&rbrace;</code>
assigns to <var>key</var> the number of that environment.  Retrieve the
assigned number with the <code>\ref&lbrace;<var>key</var>&rbrace;</code> command
(<pxref label="_005cref"><xrefnodename>\ref</xrefnodename></pxref>).
</para>
<para>A key name can consist of any sequence of letters, digits, or common
punctuation characters.  Upper and lowercase letters are
distinguished, as usual.
</para>
<para>A common convention is to use labels consisting of a prefix and a suffix
separated by a colon or period.  Thus, <code>\label&lbrace;fig:Post&rbrace;</code> 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:
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">ch</itemformat></item>
</tableterm><tableitem><para>for chapters
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">sec</itemformat></item>
<itemx spaces=" "><itemformat command="code">subsec</itemformat></itemx>
</tableterm><tableitem><para>for lower-level sectioning commands
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">fig</itemformat></item>
</tableterm><tableitem><para>for figures
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">tab</itemformat></item>
</tableterm><tableitem><para>for tables
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">eq</itemformat></item>
</tableterm><tableitem><para>for equations
</para></tableitem></tableentry></table>

<para>In the auxiliary file the reference information is kept as the text of
a command of the form
<code>\newlabel&lbrace;<var>label</var>&rbrace;&lbrace;&lbrace;<var>currentlabel</var>&rbrace;&lbrace;<var>pagenumber</var>&rbrace;&rbrace;</code>.
Here <var>currentlabel</var> is the current value of the macro
<code>\&arobase;currentlabel</code> that is usually updated whenever you call
<code>\refstepcounter&lbrace;<var>counter</var>&rbrace;</code>.
</para>
<para>Below, the key <code>sec:test</code> will get the number of the current
section and the key <code>fig:test</code> will get the number of the figure.
(Incidentally, put labels after captions in figures and tables.)
</para>
<example endspaces=" ">
<pre xml:space="preserve">\section&lbrace;section name&rbrace;
\label&lbrace;sec:test&rbrace;
This is Section~\ref&lbrace;sec:test&rbrace;.
\begin&lbrace;figure&rbrace;
  ...
  \caption&lbrace;caption text&rbrace;
  \label&lbrace;fig:test&rbrace;
\end&lbrace;figure&rbrace;
See Figure~\ref&lbrace;fig:test&rbrace;.
</pre></example>


</section>
<node name="_005cpageref" spaces=" "><nodename>\pageref</nodename><nodenext automatic="on">\ref</nodenext><nodeprev automatic="on">\label</nodeprev><nodeup automatic="on">Cross references</nodeup></node>
<section spaces=" "><sectiontitle><code>\pageref</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="291" mergedindex="cp">\pageref</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="255">cross referencing with page number</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="256">page number, cross referencing</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\pageref&lbrace;<var>key</var>&rbrace;
</pre></example>

<para>Produce the page number of the place in the text where the corresponding
<code>\label</code>&lbrace;<var>key</var>&rbrace; command appears.
</para>
<para>If there is no <code>\label&lbrace;<var>key</var>&rbrace;</code> then you get something like
<samp>LaTeX Warning: Reference `th:GrensThm' on page 1 undefined on
input line 11.</samp>
</para>
<para>Below, the <code>\label&lbrace;eq:main&rbrace;</code> 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.)
</para>
<example endspaces=" ">
<pre xml:space="preserve">The main result is formula~\ref&lbrace;eq:main&rbrace; on page~\pageref&lbrace;eq:main&rbrace;.
  ...
\begin&lbrace;equation&rbrace; \label&lbrace;eq:main&rbrace;
   \mathbf&lbrace;P&rbrace;=\mathbf&lbrace;NP&rbrace;
\end&lbrace;equation&rbrace;
</pre></example>


</section>
<node name="_005cref" spaces=" "><nodename>\ref</nodename><nodenext automatic="on">xr package</nodenext><nodeprev automatic="on">\pageref</nodeprev><nodeup automatic="on">Cross references</nodeup></node>
<section spaces=" "><sectiontitle><code>\ref</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="292" mergedindex="cp">\ref</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="257">cross referencing, symbolic</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="258">section number, cross referencing</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="259">equation number, cross referencing</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="260">figure number, cross referencing</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="261">footnote number, cross referencing</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\ref&lbrace;<var>key</var>&rbrace;
</pre></example>

<para>Produces the number of the sectional unit,
equation, footnote, figure, &dots;, of the corresponding
<code>\label</code> command (<pxref label="_005clabel"><xrefnodename>\label</xrefnodename></pxref>).  It does not produce any text,
such as the word &textlsquo;Section&textrsquo; or &textlsquo;Figure&textrsquo;, just the bare number itself.
</para>
<para>If there is no <code>\label&lbrace;<var>key</var>&rbrace;</code> then you get something like
<samp>LaTeX Warning: Reference `th:GrensThm' on page 1 undefined on
input line 11.</samp>
</para>
<para>In this example the <code>\ref&lbrace;popular&rbrace;</code> produces <samp>2</samp>.  Note that
it is a forward reference since it comes before <code>\label&lbrace;popular&rbrace;</code>
so this document would have to be compiled twice.
</para>
<example endspaces=" ">
<pre xml:space="preserve">The most widely-used format is item number~\ref&lbrace;popular&rbrace;.
\begin&lbrace;enumerate&rbrace;
\item Plain \TeX
\item \label&lbrace;popular&rbrace; \LaTeX
\item Con\TeX t
\end&lbrace;enumerate&rbrace;
</pre></example>

<cindex index="cp" spaces=" "><indexterm index="cp" number="262"><r>package</r>, <code>cleveref</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="263"><code>cleveref</code> <r>package</r></indexterm></cindex>

<para>The <code>cleveref</code> package includes text such as <samp>Theorem</samp> in the
reference.  See the documentation on CTAN.
</para>

</section>
<node name="xr-package" spaces=" "><nodename>xr package</nodename><nodeprev automatic="on">\ref</nodeprev><nodeup automatic="on">Cross references</nodeup></node>
<section spaces=" "><sectiontitle><code>xr</code> package</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="264"><r>package</r>, <code>xr</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="265"><code>xr</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="266"><r>package</r>, <code>xr-hyper</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="267"><code>xr-hyper</code> <r>package</r></indexterm></cindex>

<findex index="fn" spaces=" "><indexterm index="fn" number="293" mergedindex="cp">\externaldocument</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="268">cross referencing, across documents</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;xr&rbrace;
  \externaldocument&lbrace;<var>document-basename</var>&rbrace;
</pre></example>

<noindent></noindent>
<para>or
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;xr&rbrace;
  \externaldocument[<var>reference-prefix</var>]&lbrace;<var>document-basename</var>&rbrace;
</pre></example>

<para>Make cross references to the external document
<file><var>document-basename</var>.tex</file>.
</para>
<para>Here is an example. If <file>lectures.tex</file> has this in the preamble
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;xr&rbrace;
  \externaldocument&lbrace;exercises&rbrace;
  \externaldocument[H-]&lbrace;hints&rbrace; 
  \externaldocument&lbrace;answers&rbrace;
</pre></example>

<noindent></noindent>
<para>then it can use cross reference labels from the other three documents.
Suppose that <file>exercises.tex</file> has an enumerated list containing
this,
</para>
<example endspaces=" ">
<pre xml:space="preserve">\item \label&lbrace;exer:EulersThm&rbrace; What if every vertex has odd degree?
</pre></example>

<noindent></noindent>
<para>and <file>hints.tex</file> has an enumerated list with this,
</para>
<example endspaces=" ">
<pre xml:space="preserve">\item \label&lbrace;exer:EulersThm&rbrace; Distinguish the case of two vertices.
</pre></example>

<noindent></noindent>
<para>and <file>answers.tex</file> has an enumerated list with this,
</para>
<example endspaces=" ">
<pre xml:space="preserve">\item \label&lbrace;ans:EulersThm&rbrace; There is no Euler path, except if there
  are exactly two vertices.
</pre></example>

<para>After compiling the exercises, hints, and answers documents, entering
this in the body of <file>lectures.tex</file> will result in the lectures
getting the reference numbers used in the other documents.
</para>
<example endspaces=" ">
<pre xml:space="preserve">See Exercise~\ref&lbrace;exer:EulersThm&rbrace;, with Hint~\ref&lbrace;H-exer:EulersThm&rbrace;.
The solution is Answer~\ref&lbrace;ans:EulersThm&rbrace;.
</pre></example>

<para>The prefix <code>H-</code> for the reference from the hints file is needed
because the label in the hints file is the same as the label in the
exercises file.  Without that prefix, both references would get the
number from the later file.
</para>
<para>Note: if the document uses the <code>hyperref</code> package then in place of
<code>xr</code>, put <code>\usepackage&lbrace;xr-hyper&rbrace;</code> before the
<code>\usepackage&lbrace;hyperref&rbrace;</code>.  Also, if any of the multiple documents
uses <code>hyperref</code> then they all must use it.
</para>

</section>
</chapter>
<node name="Environments" spaces=" "><nodename>Environments</nodename><nodenext automatic="on">Line breaking</nodenext><nodeprev automatic="on">Cross references</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Environments</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="269">environments</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="294" mergedindex="cp">\begin</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="295" mergedindex="cp">\end</indexterm></findex>

<para>&latex; provides many environments for delimiting certain behavior.
An environment begins with <code>\begin</code> and ends with <code>\end</code>,
like this:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;<var>environment-name</var>&rbrace;
  ...
\end&lbrace;<var>environment-name</var>&rbrace;
</pre></example>

<para>The <var>environment-name</var> at the beginning must exactly match that at
the end. For instance, the input
<code>\begin&lbrace;table*&rbrace;...\end&lbrace;table&rbrace;</code> will cause an error like:
<samp>! LaTeX Error: \begin&lbrace;table*&rbrace; on input line 5 ended by
\end&lbrace;table&rbrace;.</samp>
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="270">group, and environments</indexterm></cindex>
<para>Environments are executed within a group.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::              ">abstract</menunode><menudescription><pre xml:space="preserve">Produce an abstract.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                 ">array</menunode><menudescription><pre xml:space="preserve">Math arrays.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                ">center</menunode><menudescription><pre xml:space="preserve">Centered lines.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::           ">description</menunode><menudescription><pre xml:space="preserve">Labelled lists.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::           ">displaymath</menunode><menudescription><pre xml:space="preserve">Formulas that appear on their own line.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::              ">document</menunode><menudescription><pre xml:space="preserve">Enclose the whole document.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::             ">enumerate</menunode><menudescription><pre xml:space="preserve">Numbered lists.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::              ">eqnarray</menunode><menudescription><pre xml:space="preserve">Sequences of aligned equations.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::              ">equation</menunode><menudescription><pre xml:space="preserve">Displayed equation.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                ">figure</menunode><menudescription><pre xml:space="preserve">Floating figures.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::          ">filecontents</menunode><menudescription><pre xml:space="preserve">Writing multiple files from the source.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::             ">flushleft</menunode><menudescription><pre xml:space="preserve">Flushed left lines.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::            ">flushright</menunode><menudescription><pre xml:space="preserve">Flushed right lines.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::               ">itemize</menunode><menudescription><pre xml:space="preserve">Bulleted lists.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                ">letter</menunode><menudescription><pre xml:space="preserve">Letters.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                  ">list</menunode><menudescription><pre xml:space="preserve">Generic list environment.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                  ">math</menunode><menudescription><pre xml:space="preserve">In-line math.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::              ">minipage</menunode><menudescription><pre xml:space="preserve">Miniature page.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::               ">picture</menunode><menudescription><pre xml:space="preserve">Picture with text, arrows, lines and circles.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::     ">quotation &amp; quote</menunode><menudescription><pre xml:space="preserve">Include a quotation.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::               ">tabbing</menunode><menudescription><pre xml:space="preserve">Align text arbitrarily.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                 ">table</menunode><menudescription><pre xml:space="preserve">Floating tables.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::               ">tabular</menunode><menudescription><pre xml:space="preserve">Align text in columns.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::      ">thebibliography</menunode><menudescription><pre xml:space="preserve">Bibliography or reference list.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::               ">theorem</menunode><menudescription><pre xml:space="preserve">Theorems, lemmas, etc.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::             ">titlepage</menunode><menudescription><pre xml:space="preserve">For hand crafted title pages.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::              ">verbatim</menunode><menudescription><pre xml:space="preserve">Simulating typed input.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                 ">verse</menunode><menudescription><pre xml:space="preserve">For poetry and other things.
</pre></menudescription></menuentry></menu>


<node name="abstract" spaces=" "><nodename>abstract</nodename><nodenext automatic="on">array</nodenext><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>abstract</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="296" mergedindex="cp"><r>environment</r>, <code>abstract</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="297" mergedindex="cp"><code>abstract</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="271">abstracts</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;abstract&rbrace;
...
\end&lbrace;abstract&rbrace;
</pre></example>

<para>Produce an abstract, possibly of multiple paragraphs.  This environment
is only defined in the <code>article</code> and <code>report</code> document classes
(<pxref label="Document-classes"><xrefnodename>Document classes</xrefnodename></pxref>).
</para>
<para>Using the example below in the <code>article</code> class produces a displayed
paragraph.  Document class option <code>titlepage</code> causes the abstract
to be on a separate page (<pxref label="Document-class-options"><xrefnodename>Document class options</xrefnodename></pxref>); this is the
default only in the <code>report</code> class.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;abstract&rbrace;
  We compare all known accounts of the proposal made by Porter Alexander 
  to Robert E Lee at the Appomattox Court House that the army continue
  in a guerrilla war, which Lee refused.
\end&lbrace;abstract&rbrace;
</pre></example>

<cindex index="cp" spaces=" "><indexterm index="cp" number="272"><r>package</r>, <code>abstract</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="273"><code>abstract</code> <r>package</r></indexterm></cindex>

<para>The next example produces a one column abstract in a two column document (for
a more flexible solution, use the package <file>abstract</file>).
</para>
<!-- c Adopted from http://www.tex.ac.uk/FAQ-onecolabs.html -->
<example endspaces=" ">
<pre xml:space="preserve">\documentclass[twocolumn]&lbrace;article&rbrace;
  ...
\begin&lbrace;document&rbrace;
\title&lbrace;Babe Ruth as Cultural Progenitor: a Atavistic Approach&rbrace;
\author&lbrace;Smith \\ Jones \\ Robinson\thanks&lbrace;Railroad tracking grant.&rbrace;&rbrace;
\twocolumn[
  \begin&lbrace;&arobase;twocolumnfalse&rbrace;
     \maketitle
     \begin&lbrace;abstract&rbrace;
       Ruth was not just the Sultan of Swat, he was the entire swat
       team.   
     \end&lbrace;abstract&rbrace;
   \end&lbrace;&arobase;twocolumnfalse&rbrace;
   ]
&lbrace;   % by-hand insert a footnote at page bottom
 \renewcommand&lbrace;\thefootnote&rbrace;&lbrace;\fnsymbol&lbrace;footnote&rbrace;&rbrace;
 \footnotetext[1]&lbrace;Thanks for all the fish.&rbrace;
&rbrace;
</pre></example>


</section>
<node name="array" spaces=" "><nodename>array</nodename><nodenext automatic="on">center</nodenext><nodeprev automatic="on">abstract</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>array</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="298" mergedindex="cp"><r>environment</r>, <code>array</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="299" mergedindex="cp"><code>array</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="274">arrays, math</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;array&rbrace;&lbrace;<var>cols</var>&rbrace;
  <var>column 1 entry</var> &amp;<var>column 2 entry</var> ... &amp;<var>column n entry</var> \\
  ...
\end&lbrace;array&rbrace;
</pre></example>

<noindent></noindent>
<para>or:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;array&rbrace;[<var>pos</var>]&lbrace;<var>cols</var>&rbrace;
  <var>column 1 entry</var> &amp;<var>column 2 entry</var> ... &amp;<var>column n entry</var> \\
  ...
\end&lbrace;array&rbrace;
</pre></example>

<para>Produce a mathematical array.  This environment can only be used in math
mode (<pxref label="Modes"><xrefnodename>Modes</xrefnodename></pxref>), and normally appears within a displayed
mathematics environment such as <code>equation</code> (<pxref label="equation"><xrefnodename>equation</xrefnodename></pxref>).
Inside of each row the column entries are separated by an ampersand,
(<code>&amp;</code>).  Rows are terminated with double-backslashes (<pxref label="_005c_005c"><xrefnodename>\\</xrefnodename></pxref>).
</para>
<para>This example shows a three by three array.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;equation*&rbrace;
  \chi(x) =
  \left|              % vertical bar fence
    \begin&lbrace;array&rbrace;&lbrace;ccc&rbrace;
      x-a  &amp;-b  &amp;-c  \\
      -d   &amp;x-e &amp;-f  \\
      -g   &amp;-h  &amp;x-i
    \end&lbrace;array&rbrace;
 \right|
\end&lbrace;equation*&rbrace;
</pre></example>

<para>The required argument <var>cols</var> describes the number of columns, their
alignment, and the formatting of the intercolumn regions.  For instance,
<code>\begin&lbrace;array&rbrace;&lbrace;rcl&rbrace;...\end&lbrace;array&rbrace;</code> gives three columns: the
first flush right, the second centered, and the third flush left.  See
<ref label="tabular"><xrefnodename>tabular</xrefnodename></ref> for the complete description of <var>cols</var> and of the
other common features of the two environments, including the optional
<var>pos</var> argument.
</para>
<para>There are two ways that <code>array</code> diverges from <code>tabular</code>.  The
first is that <code>array</code> entries are typeset in math mode, in
textstyle (<pxref label="Math-styles"><xrefnodename>Math styles</xrefnodename></pxref>) except if the <var>cols</var> definition specifies
the column with <code>p&lbrace;...&rbrace;</code>, which causes the entry to be typeset in
text mode.  The second is that, instead of <code>tabular</code>&textrsquo;s parameter
<code>\tabcolsep</code>, &latex;&textrsquo;s intercolumn space in an <code>array</code> is
governed by
<findex index="fn" spaces=" "><indexterm index="fn" number="300" mergedindex="cp">\arraycolsep</indexterm></findex>
<code>\arraycolsep</code>, which gives half the width between columns. The
default for this is <samp>5pt</samp> so that between two columns comes
10<dmn>pt</dmn> of space.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="275"><r>package</r>, <code>amsmath</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="276"><code>amsmath</code> <r>package</r></indexterm></cindex>

<para>To obtain arrays with braces the standard is to use the <code>amsmath</code>
package.  It comes with environments <code>pmatrix</code> for an array
surrounded by parentheses&nbsp;<code>(...)</code>, <code>bmatrix</code> for an array
surrounded by square brackets&nbsp;<code>[...]</code>, <code>Bmatrix</code> for an
array surrounded by curly braces&nbsp;<code>&lbrace;...&rbrace;</code>, <code>vmatrix</code> for
an array surrounded by vertical bars&nbsp;<code>|...|</code>, and
<code>Vmatrix</code> for an array surrounded by double vertical
bars&nbsp;<code>||...||</code>, along with a number of other array constructs.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="277"><r>package</r>, <code>amsmath</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="278"><code>amsmath</code> <r>package</r></indexterm></cindex>

<para>The next example uses the <code>amsmath</code> package.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;amsmath&rbrace;  % in preamble

\begin&lbrace;equation&rbrace;    
  \begin&lbrace;vmatrix&rbrace;&lbrace;cc&rbrace;  % array with vert lines
    a  &amp;b \\
    c  &amp;d       
  \end&lbrace;vmatrix&rbrace;=ad-bc
\end&lbrace;equation&rbrace;
</pre></example>

<cindex index="cp" spaces=" "><indexterm index="cp" number="279"><r>package</r>, <code>array</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="280"><code>array</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="281"><r>package</r>, <code>dcolumn</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="282"><code>dcolumn</code> <r>package</r></indexterm></cindex>

<para>There are many packages concerning arrays.  The <code>array</code> package has
many useful extensions, including more column types.  The <code>dcolumn</code>
package adds a column type to center on a decimal point.  For both see
the documentation on CTAN.
</para>

</section>
<node name="center" spaces=" "><nodename>center</nodename><nodenext automatic="on">description</nodenext><nodeprev automatic="on">array</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>center</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="301" mergedindex="cp"><r>environment</r>, <code>center</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="302" mergedindex="cp"><code>center</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="283">centering text, environment for</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;center&rbrace;
  <var>line1</var> \\
  <var>line2</var> \\
  ...
\end&lbrace;center&rbrace;
</pre></example>

<para>Create a new paragraph consisting of a sequence of lines that are
centered within the left and right margins.  Use
double-backslash, <code>\\</code>, to get a line break (<pxref label="_005c_005c"><xrefnodename>\\</xrefnodename></pxref>).
<findex index="fn" spaces=" "><indexterm index="fn" number="303" mergedindex="cp">\\ <r>(for <code>center</code>)</r></indexterm></findex>
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.
</para>
<para>This environment inserts space above and below the text body.  See
<ref label="_005ccentering"><xrefnodename>\centering</xrefnodename></ref> to avoid such space, for example inside a <code>figure</code>
environment.
</para>
<para>This example produces three centered lines.  There is extra vertical
space between the last two lines.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;center&rbrace;
  A Thesis Submitted in Partial Fufillment \\
  of the Requirements of \\[0.5ex]
  the School of Environmental Engineering
\end&lbrace;center&rbrace;
</pre></example>

<para>In this example, depending on the page&textrsquo;s line width, &latex; may choose
a line break for the part before the double backslash.  If so, it will
center each of the two lines and if not it will center the single line.
Then &latex; will break at the double backslash, and will center the
ending.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;center&rbrace;
  My father considered that anyone who went to chapel and didn't drink 
  alcohol was not to be tolerated.\\ 
  I grew up in that belief.  ---Richard Burton 
\end&lbrace;center&rbrace;
</pre></example>

<para>A double backslash after the final line is optional.  If present it
doesn&textrsquo;t add any vertical space.
</para>
<para>In a two-column document the text is centered in a column, not in the
entire page.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::          ">\centering</menunode><menudescription><pre xml:space="preserve">Declaration form of the <code>center</code> environment.
</pre></menudescription></menuentry></menu>


<node name="_005ccentering" spaces=" "><nodename>\centering</nodename><nodeup automatic="on">center</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\centering</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="304" mergedindex="cp">\centering</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="284">centering text, declaration for</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">&lbrace;\centering ... &rbrace;
</pre></example>

<noindent></noindent>
<para>or
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;group&rbrace;
  \centering ...
\end&lbrace;group&rbrace;
</pre></example>

<para>Center the material in its scope.  It is most often used inside an
environment such as <code>figure</code>, or in a <code>parbox</code>.
</para>
<para>This example&textrsquo;s <code>\centering</code> declaration causes the graphic to be
horizontally centered.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;figure&rbrace;
  \centering
  \includegraphics[width=0.6\textwidth]&lbrace;ctan_lion.png&rbrace;
  \caption&lbrace;CTAN Lion&rbrace;  \label&lbrace;fig:CTANLion&rbrace;
\end&lbrace;figure&rbrace;
</pre></example>

<noindent></noindent>
<para>The scope of this <code>\centering</code> ends with the <code>\end&lbrace;figure&rbrace;</code>.
</para>
<para>Unlike the <code>center</code> environment, the <code>\centering</code> command does
not add vertical space above and below the text.  That&textrsquo;s its advantage
in the above example; there is not an excess of space.
</para>
<para>It also does not start a new paragraph; it simply changes how &latex;
formats paragraph units.  If <code>ww &lbrace;\centering xx \\ yy&rbrace; zz</code> is
surrounded by blank lines then &latex; will create a paragraph whose
first line <samp>ww xx</samp> is centered and whose second line, not centered,
contains <samp>yy zz</samp>.  Usually what is desired is for the scope of the
declaration to contain a blank line or the <code>\end</code> command of an
environment such as <code>figure</code> or <code>table</code> that ends the
paragraph unit.  Thus, if <code>&lbrace;\centering xx \\ yy\par&rbrace; zz</code> is
surrounded by blank lines then it makes a new paragraph with two
centered lines <samp>xx</samp> and <samp>yy</samp>, followed by a new paragraph with
<samp>zz</samp> that is formatted as usual.
</para>

</subsection>
</section>
<node name="description" spaces=" "><nodename>description</nodename><nodenext automatic="on">displaymath</nodenext><nodeprev automatic="on">center</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>description</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="305" mergedindex="cp"><r>environment</r>, <code>description</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="306" mergedindex="cp"><code>description</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="285">labelled lists, creating</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="286">description lists, creating</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;description&rbrace;
  \item[<var>label of first item</var>] <var>text of first item</var>
  \item[<var>label of second item</var>] <var>text of second item</var>
   ...
\end&lbrace;description&rbrace;
</pre></example>

<para>Environment to make a list of labeled items.  Each item&textrsquo;s <var>label</var> 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</samp>.
</para>
<para>This example shows the environment used for a sequence of definitions.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;description&rbrace;
  \item[lama] A priest.
  \item[llama] A beast.
\end&lbrace;description&rbrace;
</pre></example>

<noindent></noindent>
<para>The labels <samp>lama</samp> and <samp>llama</samp> are output in boldface, with the
left edge on the left margin.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="307" mergedindex="cp">\item</indexterm></findex>
<para>Start list items with the <code>\item</code> command (<pxref label="_005citem"><xrefnodename>\item</xrefnodename></pxref>).  Use the
optional labels, as in <code>\item[Main point]</code>, because there is
no sensible default.  Following the <code>\item</code> is optional text, which
may contain multiple paragraphs.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="287">bold typewriter, avoiding</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="288">typewriter labels in lists</indexterm></cindex>
<para>Since the labels are in bold style, if the label text calls for a font
change given in argument style (see <ref label="Font-styles"><xrefnodename>Font styles</xrefnodename></ref>) then it will come
out bold.  For instance, if the label text calls for typewriter with
<code>\item[\texttt&lbrace;label text&rbrace;]</code> then it will appear in bold
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[&lbrace;\tt label text&rbrace;]</code>.  Similarly, get the standard roman
font with <code>\item[&lbrace;\rm label text&rbrace;]</code>.
</para>
<para>For other major &latex; labelled list environments, see <ref label="itemize"><xrefnodename>itemize</xrefnodename></ref>
and <ref label="enumerate"><xrefnodename>enumerate</xrefnodename></ref>.  Unlike those environments, nesting
<code>description</code> environments does not change the default label; it is
boldface and flush left at all levels.
</para>
<para>For information about list layout parameters, including the default
values, and for information about customizing list layout, see
<ref label="list"><xrefnodename>list</xrefnodename></ref>.  The package <code>enumitem</code> is useful for customizing
lists.
</para>
<para>This example changes the description labels to small caps.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\renewcommand&lbrace;\descriptionlabel&rbrace;[1]&lbrace;%
  &lbrace;\hspace&lbrace;\labelsep&rbrace;\textsc&lbrace;#1&rbrace;&rbrace;&rbrace;
</pre></example>


</section>
<node name="displaymath" spaces=" "><nodename>displaymath</nodename><nodenext automatic="on">document</nodenext><nodeprev automatic="on">description</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>displaymath</code></sectiontitle>
<!-- c http://tex.stackexchange.com/questions/40492/what-are-the-differences-between-align-equation-and-displaymath -->

<findex index="fn" spaces=" "><indexterm index="fn" number="308" mergedindex="cp"><r>environment</r>, <code>displaymath</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="309" mergedindex="cp"><code>displaymath</code> <r>environment</r></indexterm></findex>
        

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;displaymath&rbrace;
  <var>mathematical text</var>
\end&lbrace;displaymath&rbrace;
</pre></example>

<para>Environment to typeset the <var>mathematical text</var> on its own line, in
display style and centered.  To make the text be flush-left use the
global option <code>fleqn</code>; see <ref label="Document-class-options"><xrefnodename>Document class options</xrefnodename></ref>.
</para>
<para>In the <code>displaymath</code> environment no equation number is added to the
math text. One way to get an equation number is to use the
<code>equation</code> environment (<pxref label="equation"><xrefnodename>equation</xrefnodename></pxref>).
</para>
<para>&latex; will not break the <var>math text</var> across lines.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="289"><r>package</r>, <code>amsmath</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="290"><code>amsmath</code> <r>package</r></indexterm></cindex>

<para>Note that the <code>amsmath</code> package has significantly more extensive
displayed equation facilities.  For example, there are a number of
ways in that package for having math text broken across lines.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="310" mergedindex="cp">\[...\] <r>display math</r></indexterm></findex>
<para>The construct <code>\[<var>math</var>\]</code> is a synonym for the environment
<code>\begin&lbrace;displaymath&rbrace; <var>math</var> \end&lbrace;displaymath&rbrace;</code> but the
latter is easier to work with in the source; for instance,
searching for a square bracket may get false positives but the word
<code>displaymath</code> will likely be unique.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="311" mergedindex="cp">$$...$$ <r>plain &tex; display math</r></indexterm></findex>
<para>(Aside: The construct <code>$$<var>math</var>$$</code> from Plain&nbsp;&tex; is
sometimes mistakenly used as a synonym for <code>displaymath</code>.  It is
not a synonym, and is not officially supported in &latex; at all;
<code>$$</code> doesn&textrsquo;t support the <code>fleqn</code> option (<pxref label="Document-class-options"><xrefnodename>Document
class options</xrefnodename></pxref>), has different vertical spacing, and doesn&textrsquo;t perform
consistency checks.)
</para>
<para>The output from this example is centered and alone on its line. 
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;displaymath&rbrace;
  \int_1^2 x^2\,dx=7/3
\end&lbrace;displaymath&rbrace;
</pre></example>

<noindent></noindent>
<para>Also, the integral sign is larger than the inline version  
<code>\( \int_1^2 x^2\,dx=7/3 \)</code> produces.
</para>

</section>
<node name="document" spaces=" "><nodename>document</nodename><nodenext automatic="on">enumerate</nodenext><nodeprev automatic="on">displaymath</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>document</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="312" mergedindex="cp"><r>environment</r>, <code>document</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="313" mergedindex="cp"><code>document</code> <r>environment</r></indexterm></findex>
        

<para>The <code>document</code> environment encloses the entire body of a document.
It is required in every &latex; document.  <xref label="Starting-and-ending"><xrefnodename>Starting and ending</xrefnodename></xref>.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::          ">\AtBeginDocument</menunode><menudescription><pre xml:space="preserve">Hook for commands at the start of the document.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::            ">\AtEndDocument</menunode><menudescription><pre xml:space="preserve">Hook for commands at the end of the document.
</pre></menudescription></menuentry></menu>


<node name="_005cAtBeginDocument" spaces=" "><nodename>\AtBeginDocument</nodename><nodenext automatic="on">\AtEndDocument</nodenext><nodeup automatic="on">document</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\AtBeginDocument</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="314" mergedindex="cp">\AtBeginDocument</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="291">beginning of document hook</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\AtBeginDocument&lbrace;<var>code</var>&rbrace;
</pre></example>

<para>Save <var>code</var> and execute it when <code>\begin&lbrace;document&rbrace;</code> is
executed, at the very end of the preamble.  The code is executed after
the font selection tables have been set up, so the normal font for the
document is the current font.  However, the code is executed as part of
the preamble so you cannot do any typesetting with it.
</para>
<para>You can issue this command more than once; the successive code lines
will be executed in the order that you gave them.
</para>

</subsection>
<node name="_005cAtEndDocument" spaces=" "><nodename>\AtEndDocument</nodename><nodeprev automatic="on">\AtBeginDocument</nodeprev><nodeup automatic="on">document</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\AtEndDocument</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="315" mergedindex="cp">\AtEndDocument</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="292">end of document hook</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\AtEndDocument&lbrace;<var>code</var>&rbrace;
</pre></example>

<para>Save <var>code</var> and execute it near the end of the document.
Specifically, it is executed when <code>\end&lbrace;document&rbrace;</code> is executed,
before the final page is finished and before any leftover floating
environments are processed. If you want some of the code to be executed
after these two processes then include a <code>\clearpage</code> at the
appropriate point in <var>code</var>.
</para>
<para>You can issue this command more than once; the successive code lines
will be executed in the order that you gave them.
</para>

</subsection>
</section>
<node name="enumerate" spaces=" "><nodename>enumerate</nodename><nodenext automatic="on">eqnarray</nodenext><nodeprev automatic="on">document</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>enumerate</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="316" mergedindex="cp"><r>environment</r>, <code>enumerate</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="317" mergedindex="cp"><code>enumerate</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="293">lists of items, numbered</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;enumerate&rbrace;
  \item[<var>optional label of first item</var>] <var>text of first item</var>
  \item[<var>optional label of second item</var>] <var>text of second item</var>
  ...
\end&lbrace;enumerate&rbrace;
</pre></example>

<para>Environment to produce a numbered list of items.  The format of the
label numbering depends on the nesting level of this environment; see
below. The default top-level numbering is <samp>1.</samp>, <samp>2.</samp>,
etc. Each <code>enumerate</code> list environment must have at least one item;
having none causes the &latex; error <samp>Something's wrong--perhaps a
missing \item</samp>.
</para>
<para>This example gives the first two finishers in the 1908 Olympic marathon.
As a top-level list the labels would come out as <samp>1.</samp> and
<samp>2.</samp>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;enumerate&rbrace;
 \item Johnny Hayes (USA)
 \item Charles Hefferon (RSA) 
\end&lbrace;enumerate&rbrace;
</pre></example>

<findex index="fn" spaces=" "><indexterm index="fn" number="318" mergedindex="cp">\item</indexterm></findex>
<para>Start list items with the <code>\item</code> command (<pxref label="_005citem"><xrefnodename>\item</xrefnodename></pxref>).  If you
give <code>\item</code> an optional argument by following it with square
brackets, as in <code>\item[Interstitial label]</code>, then the next item
will continue the interrupted sequence (<pxref label="_005citem"><xrefnodename>\item</xrefnodename></pxref>).  That is, you
will get labels like <samp>1.</samp>, then <samp>Interstitial label</samp>, then
<samp>2.</samp>.  Following the <code>\item</code> is optional text, which may
contain multiple paragraphs.
</para>
<para>Enumerations may be nested within other <code>enumerate</code> environments,
or within any paragraph-making environment such as <code>itemize</code>
(<pxref label="itemize"><xrefnodename>itemize</xrefnodename></pxref>), up to four levels deep.  This gives &latex;&textrsquo;s
default for the format at each nesting level, where 1 is the top level,
the outermost level.
</para>
<enumerate first="1" endspaces=" ">
<listitem spaces=" "><para>arabic number followed by a period: <samp>1.</samp>, <samp>2.</samp>,&nbsp;&dots;
</para></listitem><listitem spaces=" "><para>lowercase letter inside parentheses: <samp>(a)</samp>, <samp>(b)</samp>&nbsp;&dots;
</para></listitem><listitem spaces=" "><para>lowercase roman numeral followed by a period: <samp>i.</samp>, <samp>ii.</samp>,&nbsp;&dots;
</para></listitem><listitem spaces=" "><para>uppercase letter followed by a period: <samp>A.</samp>, <samp>B.</samp>,&nbsp;&dots;
</para></listitem></enumerate>

<findex index="fn" spaces=" "><indexterm index="fn" number="319" mergedindex="cp">\enumi</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="320" mergedindex="cp">\enumii</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="321" mergedindex="cp">\enumiii</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="322" mergedindex="cp">\enumiv</indexterm></findex>
<anchor name="enumerate-enumi">enumerate enumi</anchor>
<anchor name="enumerate-enumii">enumerate enumii</anchor>
<anchor name="enumerate-enumiii">enumerate enumiii</anchor>
<anchor name="enumerate-enumiv">enumerate enumiv</anchor>
<para>The <code>enumerate</code> environment uses the counters <code>\enumi</code> through
<code>\enumiv</code> (<pxref label="Counters"><xrefnodename>Counters</xrefnodename></pxref>).
</para>
<para>For other major &latex; labeled list environments, see
<ref label="description"><xrefnodename>description</xrefnodename></ref> and <ref label="itemize"><xrefnodename>itemize</xrefnodename></ref>.  For information about list layout
parameters, including the default values, and for information about
customizing list layout, see <ref label="list"><xrefnodename>list</xrefnodename></ref>.  The package <code>enumitem</code> is
useful for customizing lists.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="323" mergedindex="cp">\labelenumi</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="324" mergedindex="cp">\labelenumii</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="325" mergedindex="cp">\labelenumiii</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="326" mergedindex="cp">\labelenumiv</indexterm></findex>
<anchor name="enumerate-labelenumi">enumerate labelenumi</anchor>
<anchor name="enumerate-labelenumii">enumerate labelenumii</anchor>
<anchor name="enumerate-labelenumiii">enumerate labelenumiii</anchor>
<anchor name="enumerate-labelenumiv">enumerate labelenumiv</anchor>
<para>To change the format of the label use <code>\renewcommand</code>
(<pxref label="_005cnewcommand-_0026-_005crenewcommand"><xrefnodename>\newcommand &amp; \renewcommand</xrefnodename></pxref>) on the commands <code>\labelenumi</code>
through <code>\labelenumiv</code>. For instance, this first level list will be
labelled with uppercase letters, in boldface, and without a trailing
period.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="327" mergedindex="cp">\Alph <r>example</r></indexterm></findex>
<example endspaces=" ">
<pre xml:space="preserve">\renewcommand&lbrace;\labelenumi&rbrace;&lbrace;\textbf&lbrace;\Alph&lbrace;enumi&rbrace;&rbrace;&rbrace;
\begin&lbrace;enumerate&rbrace;
  \item Shows as boldface A
  \item Shows as boldface B
\end&lbrace;enumerate&rbrace;
</pre></example>

<para>For a list of counter-labeling commands see <ref label="_005calph-_005cAlph-_005carabic-_005croman-_005cRoman-_005cfnsymbol"><xrefnodename>\alph \Alph \arabic
\roman \Roman \fnsymbol</xrefnodename></ref>.
</para>

</section>
<node name="eqnarray" spaces=" "><nodename>eqnarray</nodename><nodenext automatic="on">equation</nodenext><nodeprev automatic="on">enumerate</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>eqnarray</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="328" mergedindex="cp"><r>environment</r>, <code>eqnarray</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="329" mergedindex="cp"><code>eqnarray</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="294">equations, aligning</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="295">aligning equations</indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="296">align <r>environment, from <code>amsmath</code></r></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="297">amsmath <r>package, replacing <code>eqnarray</code></r></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="298">Madsen, Lars</indexterm></cindex>
<para>The <code>eqnarray</code> environment is obsolete.  It has infelicities,
including spacing that is inconsistent with other mathematics elements.
(See &textldquo;Avoid eqnarray!&textrdquo;&noeos; by Lars Madsen
<url><urefurl>https://tug.org/TUGboat/tb33-1/tb103madsen.pdf</urefurl></url>).  New documents
should include the <code>amsmath</code> package and use the displayed
mathematics environments provided there, such as the <code>align</code>
environment.  We include a description only for completeness and for
working with old documents.
</para>
<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;eqnarray&rbrace; 
  <var>first formula left</var>  &amp;<var>first formula middle</var>  &amp;<var>first formula right</var> \\
  ...
\end&lbrace;eqnarray&rbrace;
</pre></example>

<noindent></noindent>
<para>or 
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;eqnarray*&rbrace; 
  <var>first formula left</var>  &amp;<var>first formula middle</var>  &amp;<var>first formula right</var> \\
  ...
\end&lbrace;eqnarray*&rbrace;
</pre></example>

<findex index="fn" spaces=" "><indexterm index="fn" number="330" mergedindex="cp">\\ <r>(for <code>eqnarray</code>)</r></indexterm></findex>
<para>Display a sequence of equations or inequalities.  The left and right
sides are typeset in display mode, while the middle is typeset in text
mode.
</para>
<para>It is similar to a three-column <code>array</code> environment, with items
within a row separated by an ampersand&nbsp;(<code>&amp;</code>), and with rows
separated by double backslash&nbsp; <code>\\</code>).
<findex index="fn" spaces=" "><indexterm index="fn" number="331" mergedindex="cp">\\* <r>(for <code>eqnarray</code>)</r></indexterm></findex>
The starred form of line break (<code>\\*</code>) can also be used to separate
equations, and will disallow a page break there (<pxref label="_005c_005c"><xrefnodename>\\</xrefnodename></pxref>).
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="332" mergedindex="cp">\nonumber</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="299">equation numbers, omitting</indexterm></cindex>
<para>The unstarred form <code>eqnarray</code> places an equation number on every
line (using the <code>equation</code> counter), unless that line contains a
<code>\nonumber</code> command.  The starred form <code>eqnarray*</code> omits
equation numbering, while otherwise being the same.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="333" mergedindex="cp">\lefteqn</indexterm></findex>
<para>The command <code>\lefteqn</code> is used for splitting long formulas across
lines. It typesets its argument in display style flush left in a box of
zero width.
</para>
<para>This example shows three lines.  The first two lines make an inequality,
while the third line has not entry on the left side.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;eqnarray*&rbrace;
  \lefteqn&lbrace;x_1+x_2+\cdots+x_n&rbrace;     \\
    &amp;\leq &amp;y_1+y_2+\cdots+y_n      \\
    &amp;=    &amp;z+y_3+\cdots+y_n
\end&lbrace;eqnarray*&rbrace;
</pre></example>


</section>
<node name="equation" spaces=" "><nodename>equation</nodename><nodenext automatic="on">figure</nodenext><nodeprev automatic="on">eqnarray</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>equation</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="334" mergedindex="cp"><r>environment</r>, <code>equation</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="335" mergedindex="cp"><code>equation</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="300">equations, environment for</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="301">formulas, environment for</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;equation&rbrace;
  <var>mathematical text</var>
\end&lbrace;equation&rbrace;
</pre></example>

<para>The same as a <code>displaymath</code> environment (<pxref label="displaymath"><xrefnodename>displaymath</xrefnodename></pxref>)
except that &latex; puts an equation number flush to the right margin.
The equation number is generated using the <code>equation</code> counter.
</para>
<para>You should have no blank lines between <code>\begin&lbrace;equation&rbrace;</code> and
<code>\begin&lbrace;equation&rbrace;</code>, or &latex; will tell you that there is a
missing dollar sign.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="302"><r>package</r>, <code>amsmath</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="303"><code>amsmath</code> <r>package</r></indexterm></cindex>

<para>The package <code>amsmath</code> package has extensive displayed equation
facilities.  New documents should include this package.
</para>

</section>
<node name="figure" spaces=" "><nodename>figure</nodename><nodenext automatic="on">filecontents</nodenext><nodeprev automatic="on">equation</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>figure</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="336" mergedindex="cp"><r>environment</r>, <code>figure</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="337" mergedindex="cp"><code>figure</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="304">inserting figures</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="305">figures, inserting</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;figure&rbrace;[<var>placement</var>]
  <var>figure body</var>
  \caption[<var>loftitle</var>]&lbrace;<var>title</var>&rbrace;  % optional
  \label&lbrace;<var>label&rbrace;</var>              % optional
\end&lbrace;figure&rbrace;
</pre></example>

<noindent></noindent>
<para>or:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;figure*&rbrace;[<var>placement</var>]
  <var>figure body</var>
  \caption[<var>loftitle</var>]&lbrace;<var>title</var>&rbrace;  % optional
  \label&lbrace;<var>label&rbrace;</var>              % optional  
\end&lbrace;figure*&rbrace;
</pre></example>

<para>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 &textldquo;floats&textrdquo; them to a convenient
place, such as the top of a following page (<pxref label="Floats"><xrefnodename>Floats</xrefnodename></pxref>).
</para>
<para>The <var>figure body</var> can consist of imported graphics
(<pxref label="Graphics"><xrefnodename>Graphics</xrefnodename></pxref>), or text, &latex; commands, etc.  It is typeset in a
<code>parbox</code> of width <code>\textwidth</code>.
</para>
<para>The possible values of <var>placement</var> are <code>h</code> for <samp>here</samp>,
<code>t</code> for <samp>top</samp>, <code>b</code> for <samp>bottom</samp>, and <code>p</code> for
<samp>on a separate page of floats</samp>.  For the effect of these options on
the float placement algorithm, see <ref label="Floats"><xrefnodename>Floats</xrefnodename></ref>.
</para>
<para>The starred form <code>figure*</code> is used when a document is in
double-column mode (<pxref label="_005ctwocolumn"><xrefnodename>\twocolumn</xrefnodename></pxref>).  It produces a figure that
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</var> <code>b</code>
in <ref label="Floats"><xrefnodename>Floats</xrefnodename></ref>.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="338" mergedindex="cp">\caption</indexterm></findex>
<para>The label is optional; it is used for cross references (<pxref label="Cross-references"><xrefnodename>Cross
references</xrefnodename></pxref>).  The optional <code>\caption</code> command specifies caption
text for the figure (<pxref label="_005ccaption"><xrefnodename>\caption</xrefnodename></pxref>).  By default it is numbered.
If <var>loftitle</var> is present, it is used in the list of figures
instead of <var>title</var> (<pxref label="Table-of-contents-etc_002e"><xrefnodename>Table of contents etc.</xrefnodename></pxref>).
</para>
<para>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.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;graphicx&rbrace;  % in preamble
  ...
\begin&lbrace;figure&rbrace;[t]
  \centering
  \includegraphics[width=0.5\textwidth]&lbrace;CTANlion.png&rbrace;
  \caption&lbrace;The CTAN lion, by Duane Bibby&rbrace;
\end&lbrace;figure&rbrace;
</pre></example>


</section>
<node name="filecontents" spaces=" "><nodename>filecontents</nodename><nodenext automatic="on">flushleft</nodenext><nodeprev automatic="on">figure</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>filecontents</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="339" mergedindex="cp"><r>environment</r>, <code>filecontents</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="340" mergedindex="cp"><code>filecontents</code> <r>environment</r></indexterm></findex>
        
<findex index="fn" spaces=" "><indexterm index="fn" number="341" mergedindex="cp"><r>environment</r>, <code>filecontents*</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="342" mergedindex="cp"><code>filecontents*</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="306">external files, writing</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="307">writing external files</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;filecontents&rbrace;[<var>option</var>]&lbrace;<var>filename</var>&rbrace;
  <var>text</var>
\end&lbrace;filecontents&rbrace;
</pre></example>

<noindent></noindent>
<para>or
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;filecontents*&rbrace;[<var>option</var>]&lbrace;<var>filename</var>&rbrace;
  <var>text</var>
\end&lbrace;filecontents*&rbrace;
</pre></example>

<para>Create a file named <var>filename</var> in the current directory (or the
output directory, if specified; <pxref label="output-directory"><xrefnodename>output directory</xrefnodename></pxref>) and write
<var>text</var> to it.  By default, an existing file is not overwritten.
</para>
<para>The unstarred version of the environment
<code>filecontents</code> prefixes the content of the created file with a
header of &tex; comments; see the example below.  The starred
version <code>filecontents*</code> does not include the header.
</para>
<para>The possible options are:
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">force</itemformat></item>
<itemx spaces=" "><itemformat command="code">overwrite</itemformat></itemx>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="308"><code>force</code> option for <code>filecontents</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="309"><code>overwrite</code> option for <code>filecontents</code></indexterm></cindex>
<para>Overwrite an existing file.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">noheader</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="310"><code>noheader</code> option for <code>filecontents</code></indexterm></cindex>
<para>Omit the header. Equivalent to using <code>filecontents*</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">nosearch</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="311"><code>nosearch</code> option for <code>filecontents</code></indexterm></cindex>
<para>Only check the current directory (and the output directory, if
specified) for an existing file, not the entire search path.
</para>
</tableitem></tableentry></table>

<para>These options were added in a 2019 release of &latex;.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="312">self-contained sources</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="313">source files, making self-contained</indexterm></cindex>
<para>This environment can be used anywhere in the preamble, although it
often appears before the <code>\documentclass</code> command.  It is
commonly used to create a <code>.bib</code> or other such data file from the
main document source, to make the source file self-contained.
Similarly, it can be used to create a custom style or class file,
again making the source self-contained.
</para>
<para>For example, this document:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\documentclass&lbrace;article&rbrace;
\begin&lbrace;filecontents&rbrace;&lbrace;JH.sty&rbrace;
\newcommand&lbrace;\myname&rbrace;&lbrace;Jim Hef&lbrace;&rbrace;feron&rbrace;
\end&lbrace;filecontents&rbrace;
\usepackage&lbrace;JH&rbrace;
\begin&lbrace;document&rbrace;
Article by \myname.
\end&lbrace;document&rbrace;
</pre></example>

<noindent></noindent>
<para>produces this file <file>JH.sty</file>:
</para>
<example endspaces=" ">
<pre xml:space="preserve">%% LaTeX2e file `JH.sty'
%% generated by the `filecontents' environment
%% from source `test' on 2015/10/12.
%%
\newcommand&lbrace;\myname&rbrace;&lbrace;Jim Hef&lbrace;&rbrace;feron&rbrace;
</pre></example>


</section>
<node name="flushleft" spaces=" "><nodename>flushleft</nodename><nodenext automatic="on">flushright</nodenext><nodeprev automatic="on">filecontents</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>flushleft</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="343" mergedindex="cp"><r>environment</r>, <code>flushleft</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="344" mergedindex="cp"><code>flushleft</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="314">left-justifying text, environment for</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="315">ragged right text, environment for</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;flushleft&rbrace;
  <var>line1</var> \\
  <var>line2</var> \\
  ...
\end&lbrace;flushleft&rbrace;
</pre></example>

<findex index="fn" spaces=" "><indexterm index="fn" number="345" mergedindex="cp">\\ <r>for <code>flushleft</code></r></indexterm></findex>
<para>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 interword spaces.  To force a new line use a double
backslash, <code>\\</code>.  For the declaration form
see&nbsp;<ref label="_005craggedright"><xrefnodename>\raggedright</xrefnodename></ref>.
</para>
<para>This creates a box of text that is at most 3 inches wide, with the text
flush left and ragged right.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\noindent\begin&lbrace;minipage&rbrace;&lbrace;3in&rbrace;
\begin&lbrace;flushleft&rbrace;
  A long sentence that will be broken by \LaTeX&lbrace;&rbrace;
    at a convenient spot. \\
  And, a fresh line forced by the double backslash.
\end&lbrace;flushleft&rbrace;
\end&lbrace;minipage&rbrace;
</pre></example>


<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::        ">\raggedright</menunode><menudescription><pre xml:space="preserve">Declaration form of the <code>flushleft</code> environment.
</pre></menudescription></menuentry></menu>


<node name="_005craggedright" spaces=" "><nodename>\raggedright</nodename><nodeup automatic="on">flushleft</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\raggedright</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="346" mergedindex="cp">\raggedright</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="316">ragged right text</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="317">left-justifying text</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="318">justification, ragged right</indexterm></cindex>

<para>Synopses:
</para>
<example endspaces=" ">
<pre xml:space="preserve">&lbrace;\raggedright  ... &rbrace;
</pre></example>

<noindent></noindent>
<para>or
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;<var>environment</var>&rbrace; \raggedright
  ...
\end&lbrace;<var>environment</var>&rbrace;
</pre></example>

<para>A declaration which causes lines to be flush to the left margin and
ragged right. It can be used inside an <var>environment</var> such as <code>quote</code>
or in a <code>parbox</code>.  For the environment form
see&nbsp;<ref label="flushleft"><xrefnodename>flushleft</xrefnodename></ref>.
</para>
<para>Unlike the <code>flushleft</code> environment, the <code>\raggedright</code>
command does not start a new paragraph; it only changes how &latex;
formats paragraph units.  To affect a paragraph unit&textrsquo;s format, the
scope of the declaration must contain the blank line or <code>\end</code>
command that ends the paragraph unit.
</para>
<para>Here <code>\raggedright</code> in each second column keeps &latex; from doing
very awkward typesetting to fit the text into the narrow column.  Note
that <code>\raggedright</code> is inside the curly braces <code>&lbrace;...&rbrace;</code> to
delimit its effect.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;tabular&rbrace;&lbrace;rp&lbrace;2in&rbrace;&rbrace;
  Team alpha  &amp;&lbrace;\raggedright This team does all the real work.&rbrace; \\
  Team beta   &amp;&lbrace;\raggedright This team ensures that the water
                cooler is never empty.&rbrace;                         \\
\end&lbrace;tabular&rbrace;
</pre></example>


</subsection>
</section>
<node name="flushright" spaces=" "><nodename>flushright</nodename><nodenext automatic="on">itemize</nodenext><nodeprev automatic="on">flushleft</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>flushright</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="347" mergedindex="cp"><r>environment</r>, <code>flushright</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="348" mergedindex="cp"><code>flushright</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="319">ragged left text, environment for</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="320">right-justifying text, environment for</indexterm></cindex>

<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;flushright&rbrace;
  <var>line1</var> \\
  <var>line2</var> \\
  ...
\end&lbrace;flushright&rbrace;
</pre></example>

<findex index="fn" spaces=" "><indexterm index="fn" number="349" mergedindex="cp">\\ <r>(for <code>flushright</code>)</r></indexterm></findex>
<para>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 inter-word spaces.  To force a new
line use a double backslash, <code>\\</code>.  For the declaration form
see&nbsp;<ref label="_005craggedleft"><xrefnodename>\raggedleft</xrefnodename></ref>.
</para>
<para>For an example related to this environment, see&nbsp;<ref label="flushleft"><xrefnodename>flushleft</xrefnodename></ref>,
where one just have mutatis mutandis to replace <code>flushleft</code> by
<code>flushright</code>.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::   ">\raggedleft</menunode><menudescription><pre xml:space="preserve">Declaration form of the <code>flushright</code> environment.
</pre></menudescription></menuentry></menu>


<node name="_005craggedleft" spaces=" "><nodename>\raggedleft</nodename><nodeup automatic="on">flushright</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\raggedleft</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="350" mergedindex="cp">\raggedleft</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="321">ragged left text</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="322">justification, ragged left</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="323">right-justifying text</indexterm></cindex>

<para>Synopses:
</para>
<example endspaces=" ">
<pre xml:space="preserve">&lbrace;\raggedleft  ... &rbrace;
</pre></example>

<noindent></noindent>
<para>or
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;<var>environment</var>&rbrace; \raggedleft
  ...
\end&lbrace;<var>environment</var>&rbrace;
</pre></example>

<para>A declaration which causes lines to be flush to the right margin and
ragged left. It can be used inside an <var>environment</var> such as <code>quote</code>
or in a <code>parbox</code>.  For the environment form
see&nbsp;<ref label="flushright"><xrefnodename>flushright</xrefnodename></ref>.
</para>
<para>Unlike the <code>flushright</code> environment, the <code>\raggedleft</code>
command does not start a new paragraph; it only changes how &latex;
formats paragraph units.  To affect a paragraph unit&textrsquo;s format, the
scope of the declaration must contain the blank line or <code>\end</code>
command that ends the paragraph unit.
</para>
<para>For an example related to this environment, see&nbsp;<ref label="_005craggedright"><xrefnodename>\raggedright</xrefnodename></ref>,
where one just have mutatis mutandis to replace <code>\raggedright</code> by
<code>\raggedleft</code>.
</para>

</subsection>
</section>
<node name="itemize" spaces=" "><nodename>itemize</nodename><nodenext automatic="on">letter</nodenext><nodeprev automatic="on">flushright</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>itemize</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="351" mergedindex="cp"><r>environment</r>, <code>itemize</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="352" mergedindex="cp"><code>itemize</code> <r>environment</r></indexterm></findex>
        
<findex index="fn" spaces=" "><indexterm index="fn" number="353" mergedindex="cp">\item</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="324">lists of items</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="325">unordered lists</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="326">bulleted lists</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="327">bullet lists</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;itemize&rbrace;
  \item[<var>optional label of first item</var>] <var>text of first item</var>
  \item[<var>optional label of second item</var>] <var>text of second item</var>
  ...
\end&lbrace;itemize&rbrace;
</pre></example>

<para>Produce an <dfn>unordered list</dfn>, sometimes called a bullet list.  There
must be at least one <code>\item</code> within the environment; having none causes the
&latex; error <samp>Something's wrong--perhaps a missing \item</samp>.
</para>
<para>This gives a two-item list.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;itemize&rbrace;
 \item Pencil and watercolor sketch by Cassandra
 \item Rice portrait 
\end&lbrace;itemize&rbrace;
</pre></example>

<noindent></noindent>
<para>With the default locale&textmdash;without loading e.g.&noeos; <code>babel</code> package
with another language than USenglish&textmdash;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.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="354" mergedindex="cp">\item</indexterm></findex>
<para>Start list items with the <code>\item</code> command (<pxref label="_005citem"><xrefnodename>\item</xrefnodename></pxref>).  If you
give <code>\item</code> an optional argument by following it with square
brackets, as in <code>\item[<var>Optional label</var>]</code>, then by default
<var>Optional label</var> will appear in bold and be flush right, so it could
extend into the left margin.  For labels that are flush left see the
<ref label="description"><xrefnodename>description</xrefnodename></ref> environment. Following the <code>\item</code> is the text of
the item, which may be empty or contain multiple paragraphs.
</para>
<para>Unordered 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</code> (<pxref label="enumerate"><xrefnodename>enumerate</xrefnodename></pxref>).
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="355" mergedindex="cp">\labelitemi</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="356" mergedindex="cp">\labelitemii</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="357" mergedindex="cp">\labelitemiii</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="358" mergedindex="cp">\labelitemiv</indexterm></findex>
<anchor name="itemize-labelitemi">itemize labelitemi</anchor>
<anchor name="itemize-labelitemii">itemize labelitemii</anchor>
<anchor name="itemize-labelitemiii">itemize labelitemiii</anchor>
<anchor name="itemize-labelitemiv">itemize labelitemiv</anchor>
<para>The <code>itemize</code> environment uses the commands <code>\labelitemi</code>
through <code>\labelitemiv</code> to produce the default label (note 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.
</para>
<enumerate first="1" endspaces=" ">
<listitem spaces=" "><para>&bullet; (bullet, from <code>\textbullet</code>)
</para></listitem><listitem spaces=" "><para><b>-<w>-</w></b> (bold en-dash, from <code>\normalfont\bfseries\textendash</code>)
</para></listitem><listitem spaces=" "><para>* (asterisk, from <code>\textasteriskcentered</code>)
</para></listitem><listitem spaces=" "><para>. (vertically centered dot, rendered here as a period, from <code>\textperiodcentered</code>)
</para></listitem></enumerate>

<para>Change the labels with <code>\renewcommand</code>.  For instance, this makes
the first level use diamonds.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\renewcommand&lbrace;\labelitemi&rbrace;&lbrace;$\diamond$&rbrace;
</pre></example>

<findex index="fn" spaces=" "><indexterm index="fn" number="359" mergedindex="cp">\leftmargin</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="360" mergedindex="cp">\leftmargini</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="361" mergedindex="cp">\leftmarginii</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="362" mergedindex="cp">\leftmarginiii</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="363" mergedindex="cp">\leftmarginiv</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="364" mergedindex="cp">\leftmarginv</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="365" mergedindex="cp">\leftmarginvi</indexterm></findex>
<anchor name="itemize-leftmargin">itemize leftmargin</anchor>
<anchor name="itemize-leftmargini">itemize leftmargini</anchor>
<anchor name="itemize-leftmarginii">itemize leftmarginii</anchor>
<anchor name="itemize-leftmarginiii">itemize leftmarginiii</anchor>
<anchor name="itemize-leftmarginiv">itemize leftmarginiv</anchor>
<anchor name="itemize-leftmarginv">itemize leftmarginv</anchor>
<anchor name="itemize-leftmarginvi">itemize leftmarginvi</anchor>
<para>The distance between the left margin of the enclosing environment and
the left margin of the <code>itemize</code> list is determined by the
parameters <code>\leftmargini</code> through <code>\leftmarginvi</code>.  (This also
uses the convention of using lowercase roman numerals a the end of the
command name to denote the nesting level.)  The defaults are:
<code>2.5em</code> in level 1 (<code>2em</code> in two-column mode), <code>2.2em</code> in
level 2, <code>1.87em</code> in level 3, and <code>1.7em</code> in level 4, with
smaller values for more deeply nested levels.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="328"><r>package</r>, <code>enumitem</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="329"><code>enumitem</code> <r>package</r></indexterm></cindex>

<para>For other major &latex; labeled list environments, see
<ref label="description"><xrefnodename>description</xrefnodename></ref> and <ref label="enumerate"><xrefnodename>enumerate</xrefnodename></ref>.  The <code>itemize</code>,
<code>enumerate</code> and <code>description</code> environment use the same list
layout parameters. For a description, including the default values, and
for information about customizing list layout, see <ref label="list"><xrefnodename>list</xrefnodename></ref>.  The
package <code>enumitem</code> is useful for customizing lists.
</para>
<para>This example greatly reduces the margin space for outermost itemized
lists.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\setlength&lbrace;\leftmargini&rbrace;&lbrace;1.25em&rbrace; % default 2.5em
</pre></example>

<findex index="fn" spaces=" "><indexterm index="fn" number="366" mergedindex="cp">\parskip <r>example</r></indexterm></findex>
<para>Especially for lists with short items, it may be desirable to elide
space between items.  Here is an example defining an <code>itemize*</code>
environment with no extra spacing between items, or between paragraphs
within a single item (<code>\parskip</code> is not list-specific,
<pxref label="_005cparindent-_0026-_005cparskip"><xrefnodename>\parindent &amp; \parskip</xrefnodename></pxref>):
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newenvironment&lbrace;itemize*&rbrace;%
  &lbrace;\begin&lbrace;itemize&rbrace;%
    \setlength&lbrace;\itemsep&rbrace;&lbrace;0pt&rbrace;%
    \setlength&lbrace;\parsep&rbrace;&lbrace;0pt&rbrace;&rbrace;%
    \setlength&lbrace;\parskip&rbrace;&lbrace;0pt&rbrace;&rbrace;%
  &lbrace;\end&lbrace;itemize&rbrace;&rbrace;
</pre></example>


</section>
<node name="letter" spaces=" "><nodename>letter</nodename><nodenext automatic="on">list</nodenext><nodeprev automatic="on">itemize</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>letter</code> environment: writing letters</sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="367" mergedindex="cp"><r>environment</r>, <code>letter</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="368" mergedindex="cp"><code>letter</code> <r>environment</r></indexterm></findex>
        

<para>This environment is used for creating letters.  <xref label="Letters"><xrefnodename>Letters</xrefnodename></xref>.
</para>

</section>
<node name="list" spaces=" "><nodename>list</nodename><nodenext automatic="on">math</nodenext><nodeprev automatic="on">letter</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>list</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="369" mergedindex="cp"><r>environment</r>, <code>list</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="370" mergedindex="cp"><code>list</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="330">lists of items, generic</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;list&rbrace;&lbrace;<var>labeling</var>&rbrace;&lbrace;<var>spacing</var>&rbrace;
  \item[<var>optional label of first item</var>] <var>text of first item</var>
  \item[<var>optional label of second item</var>] <var>text of second item</var>
  ...
\end&lbrace;list&rbrace;
</pre></example>

<para>An environment for constructing lists.
</para>
<para>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>, <code>enumerate</code>, and <code>itemize</code>
environments (<pxref label="description"><xrefnodename>description</xrefnodename></pxref>, <ref label="enumerate"><xrefnodename>enumerate</xrefnodename></ref>, and <ref label="itemize"><xrefnodename>itemize</xrefnodename></ref>).
</para>
<para>Instead, the <code>list</code> 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</code>, including
<code>quotation</code>, <code>quote</code>, and <code>center</code> (<pxref label="quotation-_0026-quote"><xrefnodename>quotation &amp;
quote</xrefnodename></pxref>, <pxref label="center"><xrefnodename>center</xrefnodename></pxref>).
</para>
<para>This uses the <code>list</code> environment to define a new custom
environment.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcounter&lbrace;namedlistcounter&rbrace;  % number the items
\newenvironment&lbrace;named&rbrace;
  &lbrace;\begin&lbrace;list&rbrace;
     &lbrace;Item~\Roman&lbrace;namedlistcounter&rbrace;.&rbrace; % labeling 
     &lbrace;\usecounter&lbrace;namedlistcounter&rbrace;   % set counter
      \setlength&lbrace;\leftmargin&rbrace;&lbrace;3.5em&rbrace;&rbrace; % set spacing 
  &rbrace;
  &lbrace;\end&lbrace;list&rbrace;&rbrace;

\begin&lbrace;named&rbrace;
  \item Shows as ``Item~I.''
  \item[Special label.] Shows as ``Special label.''
  \item Shows as ``Item~II.''
\end&lbrace;named&rbrace;
</pre></example>

<para>The mandatory first argument <var>labeling</var> specifies the default
labeling of list items.  It can contain text and &latex; commands, as
above where it contains both <samp>Item</samp> and <samp>\Roman&lbrace;&dots;&rbrace;</samp>.
&latex; forms the label by putting the <var>labeling</var> argument in a box
of width <code>\labelwidth</code>.  If the label is wider than that, the
additional material extends to the right.  When making an instance of a
<code>list</code> you can override the default labeling by giving <code>\item</code> an
optional argument by including square braces and the text, as in the
above <code>\item[Special label.]</code>; <pxref label="_005citem"><xrefnodename>\item</xrefnodename></pxref>.
</para>
<para>The mandatory second argument <var>spacing</var> has a list of commands.
This list can be empty.  A command that can go in here is
<code>\usecounter&lbrace;<var>countername</var>&rbrace;</code> (<pxref label="_005cusecounter"><xrefnodename>\usecounter</xrefnodename></pxref>).  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</code> that does not have an optional argument.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="371" mergedindex="cp">\makelabel</indexterm></findex>
<anchor name="list-makelabel">list makelabel</anchor> <para>Another command that can go in <var>spacing</var> is
<code>\makelabel</code>, 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 label="Modes"><xrefnodename>Modes</xrefnodename></pxref>). One example of changing its
definition is that to the above <code>named</code> example, before the
definition of the environment add
<code>\newcommand&lbrace;\namedmakelabel&rbrace;[1]&lbrace;\textsc&lbrace;#1&rbrace;&rbrace;</code>, and between
the <code>\setlength</code> command and the parenthesis that closes the
<var>spacing</var> argument also add <code>\let\makelabel\namedmakelabel</code>.
Then the labels will be typeset in small caps.  Similarly, changing the
second code line to <code>\let\makelabel\fbox</code> puts the labels inside a
framed box.  Another example of the <code>\makelabel</code> command is below,
in the definition of the <code>redlabel</code> environment.
</para>
<para>Also often in <var>spacing</var> 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</code> can be
different than the values shown here.) See also the figure that follows
the list.  Each is a length (<pxref label="Lengths"><xrefnodename>Lengths</xrefnodename></pxref>).  The vertical spaces are
normally rubber lengths, with <code>plus</code> and <code>minus</code> components,
to give &tex; flexibility in setting the page.  Change each with a
command such as <code>\setlength&lbrace;itemsep&rbrace;&lbrace;2pt plus1pt minus1pt&rbrace;</code>.
For some effects these lengths should be zero or negative.
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="372" mergedindex="cp">\itemindent</indexterm>\itemindent</itemformat></item>
</tableterm><tableitem><anchor name="list-itemindent">list itemindent</anchor>
<para>Extra horizontal space indentation, beyond <code>leftmargin</code>, of the
first line each item.  Its default value is <code>0pt</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="373" mergedindex="cp">\itemsep</indexterm>\itemsep</itemformat></item>
</tableterm><tableitem><anchor name="list-itemsep">list itemsep</anchor>
<para>Vertical space between items, beyond the <code>\parsep</code>.  The defaults
for the first three levels in &latex;&textrsquo;s <samp>article</samp>, <samp>book</samp>,
and <samp>report</samp> classes at 10 point size are: <code>4pt plus2pt
minus1pt</code>, <code>\parsep</code> (that is, <code>2pt plus1pt minus1pt</code>), and
<code>\topsep</code> (that is, <code>2pt plus1pt minus1pt</code>).  The defaults at
11 point are: <code>4.5pt plus2pt minus1pt</code>, <code>\parsep</code> (that is,
<code>2pt plus1pt minus1pt</code>), and <code>\topsep</code> (that is, <code>2pt
plus1pt minus1pt</code>).  The defaults at 12 point are: <code>5pt plus2.5pt
minus1pt</code>, <code>\parsep</code> (that is, <code>2.5pt plus1pt minus1pt</code>), and
<code>\topsep</code> (that is, <code>2.5pt plus1pt minus1pt</code>).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="374" mergedindex="cp">\labelsep</indexterm>\labelsep</itemformat></item>
</tableterm><tableitem><anchor name="list-labelsep">list labelsep</anchor>
<para>Horizontal space between the label and text of an item.
The default for &latex;&textrsquo;s <samp>article</samp>, <samp>book</samp>,
and <samp>report</samp> classes is <code>0.5em</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="375" mergedindex="cp">\labelwidth</indexterm>\labelwidth</itemformat></item>
</tableterm><tableitem><anchor name="list-labelwidth">list labelwidth</anchor>
<para>Horizontal width.  The box containing the label is nominally this wide.
If <code>\makelabel</code> returns text that is wider than this then the first
line of the item will be indented to make room for this extra material.
If <code>\makelabel</code> returns text of width less than or equal to
<code>\labelwidth</code> then &latex;&textrsquo;s default is that the label is typeset
flush right in a box of this width.
</para>
<para>The left edge of the label box is
<code>\leftmargin</code>+<code>\itemindent</code>-<code>\labelsep</code>-<code>\labelwidth</code>
from the left margin of the enclosing environment.
</para>
<para>The default for &latex;&textrsquo;s <samp>article</samp>, <samp>book</samp>, and
<samp>report</samp> classes at the top level is
<code>\leftmargini</code>-<code>\labelsep</code>, (which is <code>2em</code> in one column
mode and <code>1.5em</code> in two column mode).  At the second level it is
<code>\leftmarginii</code>-<code>\labelsep</code>, and at the third level it is
<code>\leftmarginiii</code>-<code>\labelsep</code>.  These definitions make the
label&textrsquo;s left edge coincide with the left margin of the enclosing
environment.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="376" mergedindex="cp">\leftmargin</indexterm>\leftmargin</itemformat></item>
</tableterm><tableitem><anchor name="list-leftmargin">list leftmargin</anchor>
<para>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.
</para>
<para>In the standard &latex; document classes, a top-level list has this set
to the value of <code>\leftmargini</code>, while a list that is nested inside
a top-level list has this margin set to <code>\leftmarginii</code>.  More
deeply nested lists get the values of <code>\leftmarginiii</code> through
<code>\leftmarginvi</code>.  (Nesting greater than level five generates the
error message <samp>Too deeply nested</samp>.)
</para>
<para>The defaults for the first three levels in &latex;&textrsquo;s <samp>article</samp>,
<samp>book</samp>, and <samp>report</samp> classes are: <code>\leftmargini</code> is
<code>2.5em</code> (in two column mode, <code>2em</code>), <code>\leftmarginii</code> is
<code>2.2em</code>, and <code>\leftmarginiii</code> is <code>1.87em</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="377" mergedindex="cp">\listparindent</indexterm>\listparindent</itemformat></item>
</tableterm><tableitem><anchor name="list-listparindent">list listparindent</anchor>
<para>Horizontal space of additional line indentation, beyond
<code>\leftmargin</code>, for second and subsequent paragraphs within a list
item.  A negative value makes this an &textldquo;outdent&textrdquo;.  Its default value
is <code>0pt</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="378" mergedindex="cp">\parsep</indexterm>\parsep</itemformat></item>
</tableterm><tableitem><anchor name="list-parsep">list parsep</anchor> <para>Vertical space between paragraphs within an item.
The defaults for the first three levels in &latex;&textrsquo;s <samp>article</samp>,
<samp>book</samp>, and <samp>report</samp> classes at 10 point size are: <code>4pt
plus2pt minus1pt</code>, <code>2pt plus1pt minus1pt</code>, and <code>0pt</code>.  The
defaults at 11 point size are: <code>4.5pt plus2pt minus1pt</code>,
<code>2pt plus1pt minus1pt</code>, and <code>0pt</code>.  The defaults at 12 point
size are: <code>5pt plus2.5pt minus1pt</code>, <code>2.5pt plus1pt
minus1pt</code>, and <code>0pt</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="379" mergedindex="cp">\partopsep</indexterm>\partopsep</itemformat></item>
</tableterm><tableitem><anchor name="list-partopsep">list partopsep</anchor>
<para>Vertical space added, beyond <code>\topsep</code>+<code>\parskip</code>, 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
changes spacing at both the top and bottom of the list; whether the line
following the list is blank does not matter.)
</para>
<para>The defaults for the first three levels in &latex;&textrsquo;s <samp>article</samp>,
<samp>book</samp>, and <samp>report</samp> classes at 10 point size are: <code>2pt
plus1 minus1pt</code>, <code>2pt plus1pt minus1pt</code>, and <code>1pt plus0pt
minus1pt</code>.  The defaults at 11 point are: <code>3pt plus1pt minus1pt</code>,
<code>3pt plus1pt minus1pt</code>, and <code>1pt plus0pt minus1pt</code>).  The
defaults at 12 point are: <code>3pt plus2pt minus3pt</code>, <code>3pt plus2pt
minus2pt</code>, and <code>1pt plus0pt minus1pt</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="380" mergedindex="cp">\rightmargin</indexterm>\rightmargin</itemformat></item>
</tableterm><tableitem><anchor name="list-rightmargin">list rightmargin</anchor>
<para>Horizontal space between the right margin of the list and the right
margin of the enclosing environment.  Its default value is <code>0pt</code>.
It must be non-negative.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="381" mergedindex="cp">\topsep</indexterm>\topsep</itemformat></item>
</tableterm><tableitem><anchor name="list-topsep">list topsep</anchor>
<para>Vertical space added to both the top and bottom of the list, in addition
to <code>\parskip</code> (<pxref label="_005cparindent-_0026-_005cparskip"><xrefnodename>\parindent &amp; \parskip</xrefnodename></pxref>).  The defaults for
the first three levels in &latex;&textrsquo;s <samp>article</samp>, <samp>book</samp>, and
<samp>report</samp> classes at 10 point size are: <code>8pt plus2pt minus4pt</code>,
<code>4pt plus2pt minus1pt</code>, and <code>2pt plus1pt minus1pt</code>.  The
defaults at 11 point are: <code>9pt plus3pt minus5pt</code>, <code>4.5pt
plus2pt minus1pt</code>, and <code>2pt plus1pt minus1pt</code>.  The defaults at 12
point are: <code>10pt plus4pt minus6pt</code>, <code>5pt plus2.5pt minus1pt</code>,
and <code>2.5pt plus1pt minus1pt</code>.
</para>
</tableitem></tableentry></ftable>

<para>This shows the horizontal and vertical distances.
</para>
<float type="" endspaces=" ">
<image><imagefile>latex2e-figures/list</imagefile><imagewidth>3.21in</imagewidth><imageextension>.png</imageextension></image>
</float>

<para>The lengths shown are listed below.  The key relationship is that the
right edge of the bracket for <var>h1</var> equals the right edge of the
bracket for <var>h4</var>, so that the left edge of the label box is at
<var>h3</var>+<var>h4</var>-(<var>h0</var>+<var>h1</var>).
</para>
<table commandarg="var" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="var">v0</itemformat></item>
</tableterm><tableitem><para><math><code>&backslash;topsep</code> + <code>&backslash;parskip</code></math> if
the list environment does not start a new paragraph, and
<code>\topsep</code>+<code>\parskip</code>+<code>\partopsep</code> if it does
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">v1</itemformat></item>
</tableterm><tableitem><para><code>\parsep</code>
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">v2</itemformat></item>
</tableterm><tableitem><para><code>\itemsep</code>+<code>\parsep</code>
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">v3</itemformat></item>
</tableterm><tableitem><para>Same as <var>v0</var>.  (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.)
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">h0</itemformat></item>
</tableterm><tableitem><para><code>\labelwidth</code>
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">h1</itemformat></item>
</tableterm><tableitem><para><code>\labelsep</code>
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">h2</itemformat></item>
</tableterm><tableitem><para><code>\listparindent</code>
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">h3</itemformat></item>
</tableterm><tableitem><para><code>\leftmargin</code>
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">h4</itemformat></item>
</tableterm><tableitem><para><code>\itemindent</code>
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">h5</itemformat></item>
</tableterm><tableitem><para><code>\rightmargin</code>
</para>
</tableitem></tableentry></table>

<para>The list&textrsquo;s left and right margins, shown above as <var>h3</var> and <var>h5</var>,
are with respect to the ones provided by the surrounding environment, or
with respect to the page margins for a top-level list.  The line width
used for typesetting the list items is <code>\linewidth</code> (<pxref label="Page-layout-parameters"><xrefnodename>Page
layout parameters</xrefnodename></pxref>).  For instance, set the list&textrsquo;s left margin to be one
quarter of the distance between the left and right margins of the
enclosing environment with
<code>\setlength&lbrace;\leftmargin&rbrace;&lbrace;0.25\linewidth&rbrace;</code>.
</para>
<para>Page breaking in a list structure is controlled by the three
parameters below. For each, the &latex; default is
<code>-\&arobase;lowpenalty</code>, that is, <code>-51</code>.  Because it is negative,
it somewhat encourages a page break at each spot.  Change it with,
e.g., <code>\&arobase;beginparpenalty=9999</code>; a value of 10000 prohibits a
page break.
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="382" mergedindex="cp">\&arobase;beginparpenalty</indexterm>\&arobase;beginparpenalty</itemformat></item>
</tableterm><tableitem><anchor name="list-beginparpenalty">list beginparpenalty</anchor>
<para>The page breaking penalty for breaking before the list (default <code>-51</code>).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="383" mergedindex="cp">\&arobase;itempenalty</indexterm>\&arobase;itempenalty</itemformat></item>
</tableterm><tableitem><anchor name="list-itempenalty">list itempenalty</anchor>
<para>The page breaking penalty for breaking before a list item (default <code>-51</code>).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="384" mergedindex="cp">\&arobase;endparpenalty</indexterm>\&arobase;endparpenalty</itemformat></item>
</tableterm><tableitem><anchor name="list-endparpenalty">list endparpenalty</anchor>
<para>The page breaking penalty for breaking after a list (default <code>-51</code>).
</para>
</tableitem></tableentry></ftable>

<cindex index="cp" spaces=" "><indexterm index="cp" number="331"><r>package</r>, <code>enumitem</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="332"><code>enumitem</code> <r>package</r></indexterm></cindex>

<para>The package <code>enumitem</code> is useful for customizing lists.
</para>
<para>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 label="_005cusecounter"><xrefnodename>\usecounter</xrefnodename></xref>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;color&rbrace;
\newcounter&lbrace;cnt&rbrace;  
\newcommand&lbrace;\makeredlabel&rbrace;[1]&lbrace;\textcolor&lbrace;red&rbrace;&lbrace;#1.&rbrace;&rbrace;
\newenvironment&lbrace;redlabel&rbrace;
  &lbrace;\begin&lbrace;list&rbrace;
    &lbrace;\arabic&lbrace;cnt&rbrace;&rbrace;
    &lbrace;\usecounter&lbrace;cnt&rbrace;
     \setlength&lbrace;\labelwidth&rbrace;&lbrace;0em&rbrace;
     \setlength&lbrace;\labelsep&rbrace;&lbrace;0.5em&rbrace;
     \setlength&lbrace;\leftmargin&rbrace;&lbrace;1.5em&rbrace;
     \setlength&lbrace;\itemindent&rbrace;&lbrace;0.5em&rbrace; % equals \labelwidth+\labelsep
     \let\makelabel=\makeredlabel
    &rbrace;
  &rbrace;
&lbrace;\end&lbrace;list&rbrace;&rbrace;
</pre></example>

<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::          ">\item</menunode><menudescription><pre xml:space="preserve">An entry in a list.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::       ">trivlist</menunode><menudescription><pre xml:space="preserve">A restricted form of <code>list</code>.
</pre></menudescription></menuentry></menu>


<node name="_005citem" spaces=" "><nodename>\item</nodename><nodenext automatic="on">trivlist</nodenext><nodeup automatic="on">list</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\item</code>: An entry in a list</sectiontitle>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\item text of item
</pre></example>

<noindent></noindent>
<para>or
</para>
<example endspaces=" ">
<pre xml:space="preserve">\item[<var>optional-label</var>] text of item
</pre></example>

<para>An entry in a list.  The entries are prefixed by a label, whose default
depends on the list type.
</para>
<para>Because the optional label is surrounded by square brackets
<samp>[...]</samp>, if you have an item whose text starts with [, you
have to hide the bracket inside curly braces, as in: <code>\item
&lbrace;[&rbrace; is an open square bracket</code>; otherwise, &latex; will think it
marks the start of an optional label.
</para>
<para>Similarly, if the item does have the optional label and you need a
close square bracket inside that label, you must hide it in the same
way: <code>\item[Close square bracket, &lbrace;]&rbrace;]</code>.  <xref label="LaTeX-command-syntax"><xrefnodename>&latex;
command syntax</xrefnodename></xref>.
</para>
<para>In this example the enumerate list has two items that use the default
label and one that uses the optional label.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;enumerate&rbrace;
  \item Moe
  \item[sometimes] Shemp
  \item Larry
\end&lbrace;enumerate&rbrace;
</pre></example>

<para>The first item is labelled <samp>1.</samp>, the second item is labelled
<samp>sometimes</samp>, and the third item is labelled <samp>2.</samp>.  Because
of the optional label in the second item, the third item is not
labelled&nbsp;<samp>3.</samp>.
</para>   

</subsection>
<node name="trivlist" spaces=" "><nodename>trivlist</nodename><nodeprev automatic="on">\item</nodeprev><nodeup automatic="on">list</nodeup></node>
<subsection spaces=" "><sectiontitle><code>trivlist</code>: A restricted form of <code>list</code></sectiontitle>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;trivlist&rbrace;
  ...
\end&lbrace;trivlist&rbrace;
</pre></example>

<para>A restricted version of the list environment, in which margins are not
indented and an <code>\item</code> without an optional argument produces no
text.  It is most often used in macros, to define an environment where
the <code>\item</code> command is part of the environment&textrsquo;s definition.  For
instance, the <code>center</code> environment is defined essentially like
this:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newenvironment&lbrace;center&rbrace;
  &lbrace;\begin&lbrace;trivlist&rbrace;\centering\item\relax&rbrace;
  &lbrace;\end&lbrace;trivlist&rbrace;&rbrace;
</pre></example>

<para>Using <code>trivlist</code> in this way allows the macro to inherit some
common code: combining vertical space of two adjacent environments;
detecting whether the text following the environment should be
considered a new paragraph or a continuation of the previous one;
adjusting the left and right margins for possible nested list
environments.
</para>
<para>Specifically, <code>trivlist</code> uses the current values of the list
parameters (<pxref label="list"><xrefnodename>list</xrefnodename></pxref>), except that <code>\parsep</code> is set to the
value of <code>\parskip</code>, and <code>\leftmargin</code>, <code>\labelwidth</code>,
and <code>\itemindent</code> are set to zero.
</para>
<para>This example outputs the items as two paragraphs, except that (by
default) they have no paragraph indent and are vertically separated.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;trivlist&rbrace;
\item The \textit&lbrace;Surprise&rbrace; is not old; no one would call her old.
\item She has a bluff bow, lovely lines.
\end&lbrace;trivlist&rbrace;
</pre></example>


</subsection>
</section>
<node name="math" spaces=" "><nodename>math</nodename><nodenext automatic="on">minipage</nodenext><nodeprev automatic="on">list</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>math</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="385" mergedindex="cp"><r>environment</r>, <code>math</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="386" mergedindex="cp"><code>math</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="333">inline formulas</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;math&rbrace;
<var>math</var>
\end&lbrace;math&rbrace;
</pre></example>

<findex index="fn" spaces=" "><indexterm index="fn" number="387" mergedindex="cp">$ <r>inline math</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="388" mergedindex="cp">\(...\) <r>inline math</r></indexterm></findex>
<para>The <code>math</code> environment inserts given <var>math</var> material within
the running text.  <code>\(...\)</code> and <code>$...$</code> are synonyms.
<xref label="Math-formulas"><xrefnodename>Math formulas</xrefnodename></xref>.
</para>

</section>
<node name="minipage" spaces=" "><nodename>minipage</nodename><nodenext automatic="on">picture</nodenext><nodeprev automatic="on">math</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>minipage</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="389" mergedindex="cp"><r>environment</r>, <code>minipage</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="390" mergedindex="cp"><code>minipage</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="334">minipage, creating a</indexterm></cindex>

<para>Synopses:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;minipage&rbrace;&lbrace;<var>width</var>&rbrace;
  <var>contents</var>
\end&lbrace;minipage&rbrace;
</pre></example>

<noindent></noindent>
<para>or
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;minipage&rbrace;[<var>position</var>][<var>height</var>][<var>inner-pos</var>]&lbrace;<var>width</var>&rbrace;
  <var>contents</var>
\end&lbrace;minipage&rbrace;
</pre></example>

<para>Put <var>contents</var> into a box that is <var>width</var> 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</code>
is similar to <code>\parbox</code> (<pxref label="_005cparbox"><xrefnodename>\parbox</xrefnodename></pxref>) but here you can have
paragraphs.
</para>
<para>This example will be 3&nbsp;inches wide, and has two paragraphs.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;minipage&rbrace;&lbrace;3in&rbrace;
  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&lbrace;minipage&rbrace;
</pre></example>

<noindent></noindent>
<para>See below for a discussion of the paragraph indent inside a
<code>minipage</code>.
</para>
<para>The required argument <var>width</var> is a rigid length (<pxref label="Lengths"><xrefnodename>Lengths</xrefnodename></pxref>).
It gives the width of the box into which <var>contents</var> are typeset.
</para>
<para>There are three optional arguments, <var>position</var>, <var>height</var>, and
<var>inner-pos</var>.  You need not include all three. For example, get the
default <var>position</var> and set the <var>height</var> with
<code>\begin&lbrace;minipage&rbrace;[c][2.54cm]&lbrace;\columnwidth&rbrace; <var>contents</var>
\end&lbrace;minipage&rbrace;</code>.  (Get the natural height with an empty argument,
<code>[]</code>.)
</para>
<para>The optional argument <var>position</var> governs how the <code>minipage</code>
vertically aligns with the surrounding material.
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">c</itemformat></item>
</tableterm><tableitem><!-- c xx Clarify what it means when adjacent text lines do not have aligned -->
<!-- c vertical center with each other -->
<para>(synonym <code>m</code>) Default.  Positions the <code>minipage</code> so its
vertical center lines up with the center of the adjacent text line.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">t</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="391" mergedindex="cp">\vtop <r>plain &tex;</r></indexterm></findex>
<para>Align the baseline of the top line in the <code>minipage</code> with the
baseline of the surrounding text (plain &tex;&textrsquo;s <code>\vtop</code>).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">b</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="392" mergedindex="cp">\vbox <r>(plain &tex;)</r></indexterm></findex>
<para>Align the baseline of the bottom line in the <code>minipage</code> with the
baseline of the surrounding text (plain &tex;&textrsquo;s <code>\vbox</code>).
</para></tableitem></tableentry></table>

<para>To see the effects of these, contrast running this
</para>
<example endspaces=" ">
<pre xml:space="preserve">---\begin&lbrace;minipage&rbrace;[c]&lbrace;0.25in&rbrace;
  first\\ second\\ third
\end&lbrace;minipage&rbrace;
</pre></example>

<noindent></noindent>
<para>with the results of changing <code>c</code> to <code>b</code> or&nbsp;<code>t</code>.
</para>
<!-- c xx Clarify what happens if user enter a rubber length instead of a -->
<!-- c rigid length. -->
<para>The optional argument <var>height</var> is a rigid length (<pxref label="Lengths"><xrefnodename>Lengths</xrefnodename></pxref>).
It sets the height of the <code>minipage</code>.  You can enter any value
larger than, or equal to, or smaller than the <code>minipage</code>&textrsquo;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.
</para>
<para>The final optional argument <var>inner-pos</var> controls the placement of
<var>contents</var> inside the box. These are the possible values are (the
default is the value of <var>position</var>).
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">t</itemformat></item>
</tableterm><tableitem><para>Place <var>contents</var> at the top of the box.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">c</itemformat></item>
</tableterm><tableitem><para>Place it in the vertical center.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">b</itemformat></item>
</tableterm><tableitem><para>Place it at the box bottom.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">s</itemformat></item>
</tableterm><tableitem><para>Stretch <var>contents</var> out vertically; it must contain vertically
stretchable space.
</para>
</tableitem></tableentry></table>

<para>The <var>inner-pos</var> argument makes sense when the <var>height</var> option
is set to a value larger than the <code>minipage</code>&textrsquo;s natural height.  To
see the effect of the options, run this example with the various choices
in place of <code>b</code>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">Text before
\begin&lbrace;center&rbrace;
  ---\begin&lbrace;minipage&rbrace;[c][3in][b]&lbrace;0.25\textwidth&rbrace;
       first\\ second\\ third
  \end&lbrace;minipage&rbrace;              
\end&lbrace;center&rbrace;
Text after  
</pre></example>

<cindex index="cp" spaces=" "><indexterm index="cp" number="335">indentation of paragraphs, in minipage</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="336">paragraph indentation, in minipage</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="393" mergedindex="cp">\parindent</indexterm></findex>
<para>By default paragraphs are not indented in a <code>minipage</code>.  Change
that with a command such as <code>\setlength&lbrace;\parindent&rbrace;&lbrace;1pc&rbrace;</code> at
the start of <var>contents</var>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="337">footnotes in figures</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="338">figures, footnotes in</indexterm></cindex>
<para>Footnotes in a <code>minipage</code> environment are handled in a way that is
particularly useful for putting footnotes in figures or tables.  A
<code>\footnote</code> or <code>\footnotetext</code> command puts the footnote at
the bottom of the minipage instead of at the bottom of the page, and it
uses the <code>\mpfootnote</code> counter instead of the ordinary
<code>footnote</code> counter (<pxref label="Counters"><xrefnodename>Counters</xrefnodename></pxref>).
</para>
<para>This puts the footnote at the bottom of the table, not the bottom of the
page.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;center&rbrace;           % center the minipage on the line
\begin&lbrace;minipage&rbrace;&lbrace;2.5in&rbrace;
  \begin&lbrace;center&rbrace;         % center the table inside the minipage
    \begin&lbrace;tabular&rbrace;&lbrace;ll&rbrace;
      \textsc&lbrace;Monarch&rbrace;  &amp;\textsc&lbrace;Reign&rbrace;             \\ \hline
      Elizabeth II      &amp;63 years\footnote&lbrace;to date&rbrace; \\
      Victoria          &amp;63 years                   \\
      George III        &amp;59 years
    \end&lbrace;tabular&rbrace;
  \end&lbrace;center&rbrace;  
\end&lbrace;minipage&rbrace;
\end&lbrace;center&rbrace;
</pre></example>

<para>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&lbrace;minipage&rbrace;</code> which may not be their logical place.
</para>
<para>This puts a table containing data side by side with a map graphic.  They
are vertically centered.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="339"><r>package</r>, <code>siunitx</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="340"><code>siunitx</code> <r>package</r></indexterm></cindex>

<example endspaces=" ">
<pre xml:space="preserve">% siunitx to have the S column specifier,
% which aligns numbers on their decimal point.
\usepackage&lbrace;siunitx&rbrace;
\newcommand*&lbrace;\vcenteredhbox&rbrace;[1]&lbrace;\begin&lbrace;tabular&rbrace;&lbrace;&arobase;&lbrace;&rbrace;c&arobase;&lbrace;&rbrace;&rbrace;#1\end&lbrace;tabular&rbrace;&rbrace;
  ...
\begin&lbrace;center&rbrace;
  \vcenteredhbox&lbrace;\includegraphics[width=0.3\textwidth]&lbrace;nyc.png&rbrace;&rbrace;
  \hspace&lbrace;0.1\textwidth&rbrace;
  \begin&lbrace;minipage&rbrace;&lbrace;0.5\textwidth&rbrace;
    \begin&lbrace;tabular&rbrace;&lbrace;r|S&rbrace;
      % \multicolumn to remove vertical bar between column headers
      \multicolumn&lbrace;1&rbrace;&lbrace;r&rbrace;&lbrace;Borough&rbrace; &amp;
      % braces to prevent siunitx from misinterpreting the
      % period as a decimal separator
      &lbrace;Pop. (million)&rbrace;  \\ \hline
      The Bronx      &amp;1.5  \\
      Brooklyn       &amp;2.6  \\
      Manhattan      &amp;1.6  \\
      Queens         &amp;2.3  \\
      Staten Island  &amp;0.5  
    \end&lbrace;tabular&rbrace;
  \end&lbrace;minipage&rbrace;              
\end&lbrace;center&rbrace;
</pre></example>


</section>
<node name="picture" spaces=" "><nodename>picture</nodename><nodenext automatic="on">quotation &amp; quote</nodenext><nodeprev automatic="on">minipage</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>picture</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="394" mergedindex="cp"><r>environment</r>, <code>picture</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="395" mergedindex="cp"><code>picture</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="341">creating pictures</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="342">pictures, creating</indexterm></cindex>

<para>Synopses: 
</para><example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;picture&rbrace;(<var>width</var>,<var>height</var>)
   <var>picture command</var>
\end&lbrace;picture&rbrace;
</pre></example>

<noindent></noindent>
<para>or
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;picture&rbrace;(<var>width</var>,<var>height</var>)(<var>xoffset</var>,<var>yoffset</var>)
  <var>picture command</var>
\end&lbrace;picture&rbrace;
</pre></example>

<noindent></noindent>
<para>Where there may be any number of <var>picture command</var>&textrsquo;s.
</para>
<para>An environment to create simple pictures containing lines, arrows,
boxes, circles, and text.  This environment is not obsolete, but new
documents typically use much more powerful graphics creation systems,
such as TikZ, PSTricks, MetaPost, or Asymptote.  None of these are
covered in this document; see CTAN.
</para>
<para>To start, here&textrsquo;s an example showing the parallelogram law for adding vectors.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="396" mergedindex="cp">\unitlength</indexterm></findex>
<example endspaces=" ">
<pre xml:space="preserve">\setlength&lbrace;\unitlength&rbrace;&lbrace;1cm&rbrace;
\begin&lbrace;picture&rbrace;(6,6)      % picture box will be 6cm wide by 6cm tall
  \put(0,0)&lbrace;\vector(2,1)&lbrace;4&rbrace;&rbrace;  % for every 2 over this vector goes 1 up
    \put(2,1)&lbrace;\makebox(0,0)[l]&lbrace;\ first leg&rbrace;&rbrace;
  \put(4,2)&lbrace;\vector(1,2)&lbrace;2&rbrace;&rbrace;
    \put(5,4)&lbrace;\makebox(0,0)[l]&lbrace;\ second leg&rbrace;&rbrace;  
  \put(0,0)&lbrace;\vector(1,1)&lbrace;6&rbrace;&rbrace;
    \put(3,3)&lbrace;\makebox(0,0)[r]&lbrace;sum\ &rbrace;&rbrace;  
\end&lbrace;picture&rbrace;
</pre></example>

<para>The <code>picture</code> environment has one required argument, a pair of
positive real numbers (<var>width</var>,<var>height</var>).  Multiply these by the
value <code>\unitlength</code> to get the nominal size of the output, i.e.&noeos;
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&textrsquo;s box.
</para>
<para>This environment also has an optional argument
(<var>xoffset</var>,<var>yoffset</var>).  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 a pair of two real
numbers, but these may also be negative or null.  Multiply these
by <code>\unitlength</code> to get the coordinates of the point at the
lower-left corner of the picture.
</para>
<para>For example, if <code>\unitlength</code> has been set to <code>1mm</code>, the
command
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;picture&rbrace;(100,200)(10,20)
</pre></example>

<noindent></noindent>
<para>produces a box of width 100 millimeters and height 200 millimeters.  The
picture&textrsquo;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.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="343">position, in picture</indexterm></cindex>
<para>Each <var>picture command</var> tells &latex; where to put something by
providing its position.  A <dfn>position</dfn> is a pair such as <code>(2.4,-5)</code>
giving the x- and y-coordinates.  A <dfn>coordinate</dfn> 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</code>,
so if <code>\unitlength</code> has been set to <code>1cm</code>, then the coordinate
<code>2.54</code> specifies a length of 2.54 centimeters.
</para>
<para>&latex;&textrsquo;s default for <code>\unitlength</code> is <code>1pt</code>.  It is a rigid
length (<pxref label="Lengths"><xrefnodename>Lengths</xrefnodename></pxref>).  Change it with the <code>\setlength</code> command
(<pxref label="_005csetlength"><xrefnodename>\setlength</xrefnodename></pxref>).  Make this change only outside of a <code>picture</code>
environment.
</para>
<para>The <code>picture</code> environment supports using standard arithmetic
expressions as well as numbers.
</para>
<para>Coordinates are given with respect to an origin, which is by default at
the lower-left corner of the picture.  Note that when a position appears
as an argument, as with <code>\put(1,2)&lbrace;...&rbrace;</code>, 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, for example, <math>y = 1</math> is <emph>above</emph> <math>y = 0</math>.
</para>
<para>There are four ways to put things in a picture: <code>\put</code>,
<code>\multiput</code>, <code>\qbezier</code>, and <code>\graphpaper</code>.  The most
often used is <code>\put</code>. This
</para>
<example endspaces=" ">
<pre xml:space="preserve">\put(11.3,-0.3)&lbrace;...&rbrace;
</pre></example>

<noindent></noindent>
<para>places the object with its reference point at coordinates
<math>(11.3,-0.3)</math>.  The reference points for various objects will be
described below.
<findex index="fn" spaces=" "><indexterm index="fn" number="397" mergedindex="cp">LR box</indexterm></findex>
The <code>\put</code> command creates an <dfn>LR box</dfn> (<pxref label="Modes"><xrefnodename>Modes</xrefnodename></pxref>).
Anything that can go in an <code>\mbox</code> (<pxref label="_005cmbox-_0026-_005cmakebox"><xrefnodename>\mbox &amp; \makebox</xrefnodename></pxref>) can
go in the text argument of the <code>\put</code> command.  The reference point
will be the lower left corner of the box.  In this picture
</para>
<example endspaces=" ">
<pre xml:space="preserve">\setlength&lbrace;\unitlength&rbrace;&lbrace;1cm&rbrace;
...\begin&lbrace;picture&rbrace;(1,1)
  \put(0,0)&lbrace;\line(1,0)&lbrace;1&rbrace;&rbrace;
  \put(0,0)&lbrace;\line(1,1)&lbrace;1&rbrace;&rbrace;
\end&lbrace;picture&rbrace;
</pre></example>

<noindent></noindent>
<para>the three dots are just slightly left of the point of the angle formed
by the two lines.  (Also, <code>\line(1,1)&lbrace;1&rbrace;</code> does not call for a
line of length one; rather the line has a change in the x coordinate of
1.)
</para>
<para>The <code>\multiput</code>, <code>qbezier</code>, and <code>graphpaper</code> commands are
described below.
</para>
<para>You can also use this environment to place arbitrary material at an
exact location. For example:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;color,graphicx&rbrace;  % in preamble
  ...
\begin&lbrace;center&rbrace;
\setlength&lbrace;\unitlength&rbrace;&lbrace;\textwidth&rbrace; 
\begin&lbrace;picture&rbrace;(1,1)      % leave space, \textwidth wide and tall
  \put(0,0)&lbrace;\includegraphics[width=\textwidth]&lbrace;desertedisland.jpg&rbrace;&rbrace;
  \put(0.25,0.35)&lbrace;\textcolor&lbrace;red&rbrace;&lbrace;X Treasure here&rbrace;&rbrace;
\end&lbrace;picture&rbrace;
\end&lbrace;center&rbrace;
</pre></example>

<noindent></noindent>
<para>The red&nbsp;X will be precisely a quarter of the <code>\textwidth</code> from
the left margin, and <code>0.35\textwidth</code> up from the bottom of the
picture.  Another example of this usage is to put similar code in the
page header to get repeat material on each of a document&textrsquo;s pages.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::                ">\put</menunode><menudescription><pre xml:space="preserve">Place an object at a specified place.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::           ">\multiput</menunode><menudescription><pre xml:space="preserve">Draw multiple instances of an object.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::            ">\qbezier</menunode><menudescription><pre xml:space="preserve">Draw a quadratic B<accent type="acute" bracketed="off">e</accent>zier curve.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::         ">\graphpaper</menunode><menudescription><pre xml:space="preserve">Draw graph paper.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::               ">\line</menunode><menudescription><pre xml:space="preserve">Draw a straight line.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::      ">\linethickness</menunode><menudescription><pre xml:space="preserve">Set thickness of horizontal and vertical lines.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::          ">\thinlines</menunode><menudescription><pre xml:space="preserve">The default line thickness.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::         ">\thicklines</menunode><menudescription><pre xml:space="preserve">A heavier line thickness.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::             ">\circle</menunode><menudescription><pre xml:space="preserve">Draw a circle.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::               ">\oval</menunode><menudescription><pre xml:space="preserve">Draw an oval.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::         ">\shortstack</menunode><menudescription><pre xml:space="preserve">Make a stack of objects.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::             ">\vector</menunode><menudescription><pre xml:space="preserve">Draw a line with an arrow.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::  ">\makebox (picture)</menunode><menudescription><pre xml:space="preserve">Draw a box of the specified size.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator=":: ">\framebox (picture)</menunode><menudescription><pre xml:space="preserve">Draw a box with a frame around it.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::              ">\frame</menunode><menudescription><pre xml:space="preserve">Draw a frame around an object.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::            ">\dashbox</menunode><menudescription><pre xml:space="preserve">Draw a dashed box.
</pre></menudescription></menuentry></menu>


<node name="_005cput" spaces=" "><nodename>\put</nodename><nodenext automatic="on">\multiput</nodenext><nodeup automatic="on">picture</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\put</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="398" mergedindex="cp">\put</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\put(<var>xcoord</var>,<var>ycoord</var>)&lbrace;<var>content</var>&rbrace;
</pre></example>

<para>Place <var>content</var> at the coordinate (<var>xcoord</var>,<var>ycoord</var>).  See
the discussion of coordinates and <code>\unitlength</code> in <ref label="picture"><xrefnodename>picture</xrefnodename></ref>.
The <var>content</var> is processed in LR mode (<pxref label="Modes"><xrefnodename>Modes</xrefnodename></pxref>) so it cannot
contain line breaks.
</para>
<para>This includes the text into the <code>picture</code>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\put(4.5,2.5)&lbrace;Apply the \textit&lbrace;unpoke&rbrace; move&rbrace;
</pre></example>

<para>The reference point, the location (4.5,2.5), is the lower left of the
text, at the bottom left of the <samp>A</samp>.
</para>

</subsection>
<node name="_005cmultiput" spaces=" "><nodename>\multiput</nodename><nodenext automatic="on">\qbezier</nodenext><nodeprev automatic="on">\put</nodeprev><nodeup automatic="on">picture</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\multiput</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="399" mergedindex="cp">\multiput</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\multiput(<var>x</var>,<var>y</var>)(<var>delta_x</var>,<var>delta_y</var>)&lbrace;<var>num-copies</var>&rbrace;&lbrace;<var>obj</var>&rbrace;
</pre></example>

<para>Copy <var>obj</var> a total of <var>num-copies</var> times, with an increment of
<var>delta_x,delta_y</var>.  The <var>obj</var> first appears at position
<math>(x,y)</math>, then at <math>(x+\delta_x,y+\delta_y)</math>, and so on.
</para>
<para>This draws a simple grid with every fifth line in bold (see also
<ref label="_005cgraphpaper"><xrefnodename>\graphpaper</xrefnodename></ref>).
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;picture&rbrace;(10,10)
  \linethickness&lbrace;0.05mm&rbrace;
  \multiput(0,0)(1,0)&lbrace;10&rbrace;&lbrace;\line(0,1)&lbrace;10&rbrace;&rbrace; 
  \multiput(0,0)(0,1)&lbrace;10&rbrace;&lbrace;\line(1,0)&lbrace;10&rbrace;&rbrace;
  \linethickness&lbrace;0.5mm&rbrace;
  \multiput(0,0)(5,0)&lbrace;3&rbrace;&lbrace;\line(0,1)&lbrace;10&rbrace;&rbrace;
  \multiput(0,0)(0,5)&lbrace;3&rbrace;&lbrace;\line(1,0)&lbrace;10&rbrace;&rbrace;
\end&lbrace;picture&rbrace;
</pre></example>


</subsection>
<node name="_005cqbezier" spaces=" "><nodename>\qbezier</nodename><nodenext automatic="on">\graphpaper</nodenext><nodeprev automatic="on">\multiput</nodeprev><nodeup automatic="on">picture</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\qbezier</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="400" mergedindex="cp">\qbezier</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\qbezier(<var>x1</var>,<var>y1</var>)(<var>x2</var>,<var>y2</var>)(<var>x3</var>,<var>y3</var>)
\qbezier[<var>num</var>](<var>x1</var>,<var>y1</var>)(<var>x2</var>,<var>y2</var>)(<var>x3</var>,<var>y3</var>)
</pre></example>

<para>Draw a quadratic Bezier curve whose control points are given by the
three required arguments <code>(<var>x1</var>,<var>y1</var>)</code>,
<code>(<var>x2</var>,<var>y2</var>)</code>, and <code>(<var>x3</var>,<var>y3</var>)</code>.  That is,
the curve runs from <var>(x1,y1)</var> to <var>(x3,y3)</var>, is quadratic, and is
such that the tangent line at <var>(x1,y1)</var> passes through
<var>(x2,y2)</var>, as does the tangent line at <var>(x3,y3)</var>.
</para>
<para>This draws a curve from the coordinate (1,1) to (1,0).
</para>
<example endspaces=" ">
<pre xml:space="preserve">\qbezier(1,1)(1.25,0.75)(1,0)  
</pre></example>

<noindent></noindent>
<para>The curve&textrsquo;s tangent line at (1,1) contains (1.25,0.75), as does the
curve&textrsquo;s tangent line at (1,0).
</para>
<para>The optional argument <var>num</var> gives the number of calculated
intermediate points.  The default is to draw a smooth curve whose
maximum number of points is <code>\qbeziermax</code> (change this value with
<code>\renewcommand</code>).
</para>
<para>This draws a rectangle with a wavy top, using <code>\qbezier</code> for
that curve.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;picture&rbrace;(8,4)
  \put(0,0)&lbrace;\vector(1,0)&lbrace;8&rbrace;&rbrace;  % x axis
  \put(0,0)&lbrace;\vector(0,1)&lbrace;4&rbrace;&rbrace;  % y axis
  \put(2,0)&lbrace;\line(0,1)&lbrace;3&rbrace;&rbrace;       % left side
  \put(4,0)&lbrace;\line(0,1)&lbrace;3.5&rbrace;&rbrace;     % 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)&lbrace;\line(4,1)&lbrace;2&rbrace;&rbrace;
  \put(4.5,2.5)&lbrace;\framebox&lbrace;Trapezoidal Rule&rbrace;&rbrace;
\end&lbrace;picture&rbrace;
</pre></example>

</subsection>
<node name="_005cgraphpaper" spaces=" "><nodename>\graphpaper</nodename><nodenext automatic="on">\line</nodenext><nodeprev automatic="on">\qbezier</nodeprev><nodeup automatic="on">picture</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\graphpaper</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="401" mergedindex="cp">\graphpaper</indexterm></findex>
<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\graphpaper(<var>x_init</var>,<var>y_init</var>)(<var>x_dimen</var>,<var>y_dimen</var>)
\graphpaper[<var>spacing</var>](<var>x_init</var>,<var>y_init</var>)(<var>x_dimen</var>,<var>y_dimen</var>)
</pre></example>

<cindex index="cp" spaces=" "><indexterm index="cp" number="344"><r>package</r>, <code>graphpap</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="345"><code>graphpap</code> <r>package</r></indexterm></cindex>

<para>Draw a coordinate grid.  Requires the <code>graphpap</code> package.
The grid&textrsquo;s origin is <code>(<var>x_init</var>,<var>y_init</var>)</code>.
Grid lines come every <var>spacing</var> units (the default is 10).
The grid extends <var>x_dimen</var> units to the right and <var>y_dimen</var> units up.
All arguments must be positive integers.
</para>
<para>This make a grid with seven vertical lines and eleven horizontal lines.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;graphpap&rbrace;    % in preamble
  ...
\begin&lbrace;picture&rbrace;(6,20)    % in document body
  \graphpaper[2](0,0)(12,20)
\end&lbrace;picture&rbrace;
</pre></example>

<noindent></noindent>
<para>The lines are numbered every ten units.
</para>

</subsection>
<node name="_005cline" spaces=" "><nodename>\line</nodename><nodenext automatic="on">\linethickness</nodenext><nodeprev automatic="on">\graphpaper</nodeprev><nodeup automatic="on">picture</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\line</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="402" mergedindex="cp">\line</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\line(<var>x_run</var>,<var>y_rise</var>)&lbrace;<var>travel</var>&rbrace;
</pre></example>

<para>Draw a line.  It slopes such that it vertically rises <var>y_rise</var> for
every horizontal <var>x_run</var>.  The <var>travel</var> is the total horizontal
change&textmdash;it is not the length of the vector, it is the change in
<math>x</math>.  In the special case of vertical lines, where
(<var>x_run</var>,<var>y_rise</var>)=(0,1), the <var>travel</var> gives the change in
<math>y</math>.
</para>
<para>This draws a line starting at coordinates (1,3).
</para>
<example endspaces=" ">
<pre xml:space="preserve">\put(1,3)&lbrace;\line(2,5)&lbrace;4&rbrace;&rbrace;
</pre></example>

<noindent></noindent>
<para>For every over 2, this line will go up 5.  Because <var>travel</var>
specifies that this goes over 4, it must go up&nbsp;10.  Thus its
endpoint is <math>(1,3)+(4,10)=(5,13)</math>.  In particular, note that
<math><var>travel</var>=4</math> is not the length of the line, it is the change in
<math>x</math>.
</para>
<para>The arguments <var>x_run</var> and <var>y_rise</var> 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>,<var>y_init</var>)&lbrace;\line(<var>x_run</var>,<var>y_rise</var>)&lbrace;<var>travel</var>&rbrace;&rbrace;</code>,
if <var>x_run</var> is negative then the line&textrsquo;s ending point has a first
coordinate that is less than <var>x_init</var>.  If <var>y_rise</var> is negative
then the line&textrsquo;s ending point has a second coordinate that is less than
<var>y_init</var>.
</para>
<para>If <var>travel</var> is negative then you get <code>LaTeX Error: Bad \line or
\vector argument.</code>
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="346">graphics packages</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="347"><r>package</r>, <code>pict2e</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="348"><code>pict2e</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="349"><r>package</r>, <code>TikZ</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="350"><code>TikZ</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="351"><r>package</r>, <code>PSTricks</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="352"><code>PSTricks</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="353"><r>package</r>, <code>MetaPost</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="354"><code>MetaPost</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="355"><r>package</r>, <code>Asymptote</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="356"><code>Asymptote</code> <r>package</r></indexterm></cindex>

<para>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</var> and <var>y_rise</var> must have
integer values from &minus;6 through&nbsp;6.  Also, they must be
relatively prime, so that <var>(x_run,y_rise)</var> 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</code>, see the package <code>pict2e</code>
(<url><urefurl>https://ctan.org/pkg/pict2e</urefurl></url>).  Another solution
is to use a full-featured graphics system such as TikZ, PSTricks,
MetaPost, or Asymptote.
</para>

</subsection>
<node name="_005clinethickness" spaces=" "><nodename>\linethickness</nodename><nodenext automatic="on">\thinlines</nodenext><nodeprev automatic="on">\line</nodeprev><nodeup automatic="on">picture</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\linethickness</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="403" mergedindex="cp">\linethickness</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\linethickness&lbrace;<var>dim</var>&rbrace;
</pre></example>

<para>Declares the thickness of subsequent horizontal and vertical lines in a
picture to be <var>dim</var>, which must be a positive length
(<pxref label="Lengths"><xrefnodename>Lengths</xrefnodename></pxref>).  It differs from <code>\thinlines</code> and
<code>\thicklines</code> in that it does not affect the thickness of slanted
lines, circles, or ovals (<pxref label="_005coval"><xrefnodename>\oval</xrefnodename></pxref>).
</para>

</subsection>
<node name="_005cthinlines" spaces=" "><nodename>\thinlines</nodename><nodenext automatic="on">\thicklines</nodenext><nodeprev automatic="on">\linethickness</nodeprev><nodeup automatic="on">picture</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\thinlines</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="404" mergedindex="cp">\thinlines</indexterm></findex>

<para>Declaration to set the thickness of subsequent lines, circles, and ovals
in a picture environment to be 0.4<dmn>pt</dmn>.  This is the default
thickness, so this command is unnecessary unless the thickness has been
changed with either <ref label="_005clinethickness"><xrefnodename>\linethickness</xrefnodename></ref> or <ref label="_005cthicklines"><xrefnodename>\thicklines</xrefnodename></ref>.
</para>

</subsection>
<node name="_005cthicklines" spaces=" "><nodename>\thicklines</nodename><nodenext automatic="on">\circle</nodenext><nodeprev automatic="on">\thinlines</nodeprev><nodeup automatic="on">picture</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\thicklines</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="405" mergedindex="cp">\thicklines</indexterm></findex>

<para>Declaration to set the thickness of subsequent lines, circles, and ovals
in a picture environment to be 0.8<dmn>pt</dmn>.  See also
<ref label="_005clinethickness"><xrefnodename>\linethickness</xrefnodename></ref> and <ref label="_005cthinlines"><xrefnodename>\thinlines</xrefnodename></ref>.  This command is illustrated
in the Trapezoidal Rule example of <ref label="_005cqbezier"><xrefnodename>\qbezier</xrefnodename></ref>.
</para>

</subsection>
<node name="_005ccircle" spaces=" "><nodename>\circle</nodename><nodenext automatic="on">\oval</nodenext><nodeprev automatic="on">\thicklines</nodeprev><nodeup automatic="on">picture</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\circle</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="406" mergedindex="cp">\circle</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\circle&lbrace;<var>diameter</var>&rbrace;
\circle*&lbrace;<var>diameter</var>&rbrace;
</pre></example>

<para>Produces a circle with a diameter as close as possible to the specified
one.  The <code>*</code>&nbsp;form produces a filled-in circle.
</para>
<para>This draws a circle of radius 6, centered at <code>(5,7)</code>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\put(5,7)&lbrace;\circle&lbrace;6&rbrace;&rbrace;
</pre></example>

<para>The available radii for <code>\circle</code> are, in points, the even
numbers from 2 to 20, inclusive.  For <code>\circle*</code> they are all the
integers from 1 to 15.
</para>

</subsection>
<node name="_005coval" spaces=" "><nodename>\oval</nodename><nodenext automatic="on">\shortstack</nodenext><nodeprev automatic="on">\circle</nodeprev><nodeup automatic="on">picture</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\oval</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="407" mergedindex="cp">\oval</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\oval(<var>width</var>,<var>height</var>)
\oval(<var>width</var>,<var>height</var>)[<var>portion</var>]
</pre></example>

<para>Produce a rectangle with rounded corners, hereinafter referred to as an
<dfn>oval</dfn>.  The optional argument <var>portion</var> allows you to produce
only half or a quarter of the oval.  For half an oval take <var>portion</var>
to be one of these.
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">t</itemformat></item>
</tableterm><tableitem><para>top half
</para></tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">b</itemformat></item>
</tableterm><tableitem><para>bottom half
</para></tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">r</itemformat></item>
</tableterm><tableitem><para>right half
</para></tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">l</itemformat></item>
</tableterm><tableitem><para>left half
</para></tableitem></tableentry></table>

<para>Produce only one quarter of the oval by setting <var>portion</var> to
<code>tr</code>, <code>br</code>, <code>bl</code>, or <code>tl</code>.
</para>
<para>This draws the top half of an oval that is 3 wide and 7 tall.  
</para>
<example endspaces=" ">
<pre xml:space="preserve">\put(5,7)&lbrace;\oval(3,7)[t]&rbrace;
</pre></example>

<noindent></noindent>
<para>The (5,7) is the center of the entire oval, not just the center of the
top half.
</para>
<para>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</dmn> (<pxref label="_005ccircle"><xrefnodename>\circle</xrefnodename></pxref> for the sizes).  Thus large ovals are just
frames with a small amount of corner rounding.
</para>

</subsection>
<node name="_005cshortstack" spaces=" "><nodename>\shortstack</nodename><nodenext automatic="on">\vector</nodenext><nodeprev automatic="on">\oval</nodeprev><nodeup automatic="on">picture</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\shortstack</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="408" mergedindex="cp">\shortstack</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\shortstack[<var>position</var>]&lbrace;<var>line 1</var> \\ ... &rbrace;
</pre></example>

<para>Produce a vertical stack of objects.
</para>
<para>This labels the <math>y</math> axis by writing the word <samp><math>y</math></samp> above
the word <samp>axis</samp>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\setlength&lbrace;\unitlength&rbrace;&lbrace;1cm&rbrace;
\begin&lbrace;picture&rbrace;(5,2.5)(-0.75,0)
   \put(0,0)&lbrace;\vector(1,0)&lbrace;4&rbrace;&rbrace;   % x axis
   \put(0,0)&lbrace;\vector(0,1)&lbrace;2&rbrace;&rbrace;   % y
   \put(-0.2,2)&lbrace;\makebox(0,0)[r]&lbrace;\shortstack[r]&lbrace;$y$\\ axis&rbrace;&rbrace;&rbrace;
\end&lbrace;picture&rbrace;
</pre></example>

<noindent></noindent>
<para>For a short stack, the reference point is the lower left of the stack.
In the above example the <code>\makebox</code> (<pxref label="_005cmbox-_0026-_005cmakebox"><xrefnodename>\mbox &amp; \makebox</xrefnodename></pxref>) 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</math>&nbsp;axis.
</para>
<para>The valid positions are:
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">r</itemformat></item>
</tableterm><tableitem><para>Make objects flush right
</para></tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">l</itemformat></item>
</tableterm><tableitem><para>Make objects flush left
</para></tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">c</itemformat></item>
</tableterm><tableitem><para>Center objects (default)
</para></tableitem></tableentry></table>

<findex index="fn" spaces=" "><indexterm index="fn" number="409" mergedindex="cp">\\ <r>(for <code>\shortstack</code> objects)</r></indexterm></findex>
<para>Separate objects into lines with <code>\\</code>.  These stacks are short in
that, unlike in a <code>tabular</code> or <code>array</code> environment, here the
rows are not spaced out to be of even baseline skips.  Thus, in
<code>\shortstack&lbrace;X\\o\\o\\X&rbrace;</code> the first and last rows are taller than
the middle two, and therefore the baseline skip between the two middle
rows is smaller than that between the third and last row.  You can
adjust row heights and depths either by putting in the usual interline
spacing with <code>\shortstack&lbrace;X\\ \strut o\\o\\X&rbrace;</code> (<pxref label="_005cstrut"><xrefnodename>\strut</xrefnodename></pxref>),
or explicitly, via an zero-width box <code>\shortstack&lbrace;X \\
\rule&lbrace;0pt&rbrace;&lbrace;12pt&rbrace; o\\o\\X&rbrace;</code> or by using <code>\\</code>&textrsquo;s optional
argument <code>\shortstack&lbrace;X\\[2pt] o\\o\\X&rbrace;</code>.
</para>
<para>The <code>\shortstack</code> command is also available outside the
<code>picture</code> environment.
</para>

</subsection>
<node name="_005cvector" spaces=" "><nodename>\vector</nodename><nodenext automatic="on">\makebox (picture)</nodenext><nodeprev automatic="on">\shortstack</nodeprev><nodeup automatic="on">picture</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\vector</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="410" mergedindex="cp">\vector</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\vector(<var>x_run</var>,<var>y_rise</var>)&lbrace;<var>travel</var>&rbrace;
</pre></example>

<para>Draw a line ending in an arrow.  The slope of that line is: it
vertically rises <var>y_rise</var> for every horizontal <var>x_run</var>.  The
<var>travel</var> is the total horizontal change&textmdash;it is not the
length of the vector, it is the change in <math>x</math>.  In the special case
of vertical vectors, if (<var>x_run</var>,<var>y_rise</var>)=(0,1), then
<var>travel</var> gives the change in <math>y</math>.
</para>
<para>For an example see <ref label="picture"><xrefnodename>picture</xrefnodename></ref>.
</para>
<para>For elaboration on <var>x_run</var> and <var>y_rise</var> see <ref label="_005cline"><xrefnodename>\line</xrefnodename></ref>.  As
there, the values of <var>x_run</var> and <var>y_rise</var> are limited.  For
<code>\vector</code> you must chooses integers between &minus;4 and 4,
inclusive.  Also, the two you choose must be relatively prime.  Thus,
<code>\vector(2,1)&lbrace;4&rbrace;</code> is acceptable but <code>\vector(4,2)&lbrace;4&rbrace;</code> is
not (if you use the latter then you get a sequence of arrowheads).
</para>

</subsection>
<node name="_005cmakebox-_0028picture_0029" spaces=" "><nodename>\makebox (picture)</nodename><nodenext automatic="on">\framebox (picture)</nodenext><nodeprev automatic="on">\vector</nodeprev><nodeup automatic="on">picture</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\makebox</code> (picture)</sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="411" mergedindex="cp">\makebox <r>(for <code>picture</code>)</r></indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\makebox(<var>rec-width</var>,<var>rec-height</var>)&lbrace;<var>text</var>&rbrace;
\makebox(<var>rec-width</var>,<var>rec-height</var>)[<var>position</var>]&lbrace;<var>text</var>&rbrace;
</pre></example>

<para>Make a box to hold <var>text</var>.  This command fits with the
<code>picture</code> environment, although you can use it outside of there,
because <var>rec-width</var> and <var>rec-height</var> are numbers specifying
distances in terms of the <code>\unitlength</code> (<pxref label="picture"><xrefnodename>picture</xrefnodename></pxref>).  This
command is similar to the normal <code>\makebox</code> command (<pxref label="_005cmbox-_0026-_005cmakebox"><xrefnodename>\mbox &amp;
\makebox</xrefnodename></pxref>) except here that you must specify the width and height.  This
command is fragile (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>This makes a box of length 3.5 times <code>\unitlength</code> and height 4
times <code>\unitlength</code>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\put(1,2)&lbrace;\makebox(3.5,4)&lbrace;...&rbrace;&rbrace;
</pre></example>

<para>The optional argument <code><var>position</var></code> specifies where in the box
the <var>text</var> 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.
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">t</itemformat></item>
</tableterm><tableitem><para>Puts <var>text</var> the top of the box.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">b</itemformat></item>
</tableterm><tableitem><para>Put <var>text</var> at the bottom.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">l</itemformat></item>
</tableterm><tableitem><para>Put <var>text</var> on the left.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">r</itemformat></item>
</tableterm><tableitem><para>Put <var>text</var> on the right.
</para>
</tableitem></tableentry></table>


</subsection>
<node name="_005cframebox-_0028picture_0029" spaces=" "><nodename>\framebox (picture)</nodename><nodenext automatic="on">\frame</nodenext><nodeprev automatic="on">\makebox (picture)</nodeprev><nodeup automatic="on">picture</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\framebox</code> (picture)</sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="412" mergedindex="cp">\framebox</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\framebox(<var>rec-width</var>,<var>rec-height</var>)&lbrace;<var>text</var>&rbrace;
\framebox(<var>rec-width</var>,<var>rec-height</var>)[<var>position</var>]&lbrace;<var>text</var>&rbrace;
</pre></example>

<para>This is the same as <ref label="_005cmakebox-_0028picture_0029"><xrefnodename>\makebox (picture)</xrefnodename></ref> 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</code> environment, although you can use it outside of there,
because lengths are numbers specifying the distance in terms of the
<code>\unitlength</code> (<pxref label="picture"><xrefnodename>picture</xrefnodename></pxref>).  This command is fragile
(<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>This example creates a frame 2.5&nbsp;inches by 3&nbsp;inches and puts
the text in the center.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\setlength&lbrace;\unitlength&rbrace;&lbrace;1in&rbrace;
\framebox(2.5,3)&lbrace;test text&rbrace;
</pre></example>

<para>The required arguments are that the rectangle has overall width
<var>rect-width</var> units and height <var>rect-height</var> units.
</para>
<para>The optional argument <var>position</var> specifies the position of
<var>text</var>; see <ref label="_005cmakebox-_0028picture_0029"><xrefnodename>\makebox (picture)</xrefnodename></ref> for the values that it can
take.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="413" mergedindex="cp">\fboxrule</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="414" mergedindex="cp">\fboxsep</indexterm></findex>
<para>The rule has thickness <code>\fboxrule</code> and there is a blank space
<code>\fboxsep</code> between the frame and the contents of the box.
</para>
<para>For this command, you must specify the <var>width</var> and <var>height</var>.  If
you want to just put a frame around some contents whose dimension is
determined in some other way then either use <code>\fbox</code> (<pxref label="_005cfbox-_0026-_005cframebox"><xrefnodename>\fbox
&amp; \framebox</xrefnodename></pxref>) or <code>\frame</code> (<pxref label="_005cframe"><xrefnodename>\frame</xrefnodename></pxref>).
</para>

</subsection>
<node name="_005cframe" spaces=" "><nodename>\frame</nodename><nodenext automatic="on">\dashbox</nodenext><nodeprev automatic="on">\framebox (picture)</nodeprev><nodeup automatic="on">picture</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\frame</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="415" mergedindex="cp">\frame</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\frame&lbrace;<var>contents</var>&rbrace;
</pre></example>

<para>Puts a rectangular frame around <var>contents</var>.  The reference point is
the bottom left corner of the frame.  In contrast to <code>\framebox</code>
(<pxref label="_005cframebox-_0028picture_0029"><xrefnodename>\framebox (picture)</xrefnodename></pxref>), this command puts no extra space is put
between the frame and the object.  It is fragile (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>

</subsection>
<node name="_005cdashbox" spaces=" "><nodename>\dashbox</nodename><nodeprev automatic="on">\frame</nodeprev><nodeup automatic="on">picture</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\dashbox</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="416" mergedindex="cp">\dashbox</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\dashbox&lbrace;<var>dash-len</var>&rbrace;(<var>rect-width</var>,<var>rect-height</var>)&lbrace;<var>text</var>&rbrace;
\dashbox&lbrace;<var>dash-len</var>&rbrace;(<var>rect-width</var>,<var>rect-height</var>)[<var>position</var>]&lbrace;<var>text</var>&rbrace;
</pre></example>

<para>Create a dashed rectangle around <var>text</var>.  This command fits with the
<code>picture</code> environment, although you can use it outside of there,
because lengths are numbers specifying the distance in terms of the
<code>\unitlength</code> (<pxref label="picture"><xrefnodename>picture</xrefnodename></pxref>).
</para>
<para>The required arguments are: dashes are <var>dash-len</var> units long, with
the same length gap, and the rectangle has overall width
<var>rect-width</var> units and height <var>rect-height</var> units.
</para>
<para>The optional argument <var>position</var> specifies the position of
<var>text</var>; see <ref label="_005cmakebox-_0028picture_0029"><xrefnodename>\makebox (picture)</xrefnodename></ref> for the values that it can
take.
</para>
<para>This shows that you can use non-integer value for <var>dash-len</var>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\put(0,0)&lbrace;\dashbox&lbrace;0.1&rbrace;(5,0.5)&lbrace;My hovercraft is full of eels.&rbrace;&rbrace;
</pre></example>

<noindent></noindent>
<para>Each dash will be <code>0.1\unitlength</code> long, the box&textrsquo;s width is
<code>5\unitlength</code> and its height is <code>0.5\unitlength</code>.
</para>
<para>As in that example, a dashed box looks best when <var>rect-width</var> and
<var>rect-height</var> are multiples of the <var>dash-len</var>.
</para>

</subsection>
</section>
<node name="quotation-_0026-quote" spaces=" "><nodename>quotation &amp; quote</nodename><nodenext automatic="on">tabbing</nodenext><nodeprev automatic="on">picture</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>quotation</code> &amp; <code>quote</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="417" mergedindex="cp"><r>environment</r>, <code>quotation</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="418" mergedindex="cp"><code>quotation</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="357">quoted text with paragraph indentation, displaying</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="358">displaying quoted text with paragraph indentation</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="359">paragraph indentations in quoted text</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="419" mergedindex="cp"><r>environment</r>, <code>quote</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="420" mergedindex="cp"><code>quote</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="360">quoted text without paragraph indentation, displaying</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="361">displaying quoted text without paragraph indentation</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="362">paragraph indentations in quoted text, omitting</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;quotation&rbrace;
  <var>text</var>
\end&lbrace;quotation&rbrace;
</pre></example>

<noindent></noindent>
<para>or 
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;quote&rbrace;
  <var>text</var>
\end&lbrace;quote&rbrace;
</pre></example>

<para>Include a quotation. Both environments indent margins on both sides by
<code>\leftmargin</code> and the text is right-justified.
</para>
<para>They differ in how they treat paragraphs. In the <code>quotation</code>
environment, paragraphs are indented by 1.5<dmn>em</dmn> and the space
between paragraphs is small, <code>0pt plus 1pt</code>.  In the <code>quote</code>
environment, paragraphs are not indented and there is vertical space
between paragraphs (it is the rubber length <code>\parsep</code>).
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;quotation&rbrace; \small\it
  Four score and seven years ago
  ... shall not perish from the earth.
  \hspace&lbrace;1em plus 1fill&rbrace;---Abraham Lincoln
\end&lbrace;quotation&rbrace;
</pre></example>


</section>
<node name="tabbing" spaces=" "><nodename>tabbing</nodename><nodenext automatic="on">table</nodenext><nodeprev automatic="on">quotation &amp; quote</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>tabbing</code></sectiontitle>

<!-- c xx TODO align on the French which is more precise and has more illustrative examples. -->

<findex index="fn" spaces=" "><indexterm index="fn" number="421" mergedindex="cp"><r>environment</r>, <code>tabbing</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="422" mergedindex="cp"><code>tabbing</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="363">tab stops, using</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="364">lining text up using tab stops</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="365">alignment via tabbing</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;tabbing&rbrace;
<var>row1col1</var> \= <var>row1col2</var> ...  \\
<var>row2col1</var> \&gt; <var>row2col2</var> ...  \\
...
\end&lbrace;tabbing&rbrace;
</pre></example>

<para>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</code> (<pxref label="tabular"><xrefnodename>tabular</xrefnodename></pxref>) or <code>array</code> (<pxref label="array"><xrefnodename>array</xrefnodename></pxref>) because
in those the width of each column need not be constant and need not be
known in advance.
</para>
<para>This example has a first line where the tab stops are set to explicit
widths, ended by a <code>\kill</code> command (which is described below):
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;tabbing&rbrace;
\hspace&lbrace;1.2in&rbrace;\=\hspace&lbrace;1in&rbrace;\=\kill
Ship                \&gt;Guns             \&gt;Year    \\ 
\textit&lbrace;Sophie&rbrace;     \&gt;14               \&gt;1800    \\
\textit&lbrace;Polychrest&rbrace; \&gt;24               \&gt;1803    \\
\textit&lbrace;Lively&rbrace;     \&gt;38               \&gt;1804    \\
\textit&lbrace;Surprise&rbrace;   \&gt;28               \&gt;1805    \\
\end&lbrace;tabbing&rbrace;
</pre></example>

<para>Both the <code>tabbing</code> environment and the more widely-used
<code>tabular</code> environment put text in columns.  The most important
distinction is that in <code>tabular</code> the width of columns is
determined automatically by &latex;, while in <code>tabbing</code> the user
sets the tab stops.  Another distinction is that <code>tabular</code>
generates a box, but <code>tabbing</code> can be broken across pages.
Finally, while <code>tabular</code> can be used in any mode, <code>tabbing</code>
can be used only in paragraph mode and it always starts a new paragraph,
without indentation.
</para>
<para>Moreover, as shown in the example above, there is no need
to use the starred form of the <code>\hspace</code> command at the beginning
of a tabbed row.  The right margin of the <code>tabbing</code> environment is
the end of line, so that the width of the environment is
<code>\linewidth</code>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="366">row, <r>tabbing</r></indexterm></cindex>
<para>The <code>tabbing</code> environment contains a sequence of <dfn>tabbed
rows</dfn>.  The first tabbed row begins immediately after
<code>\begin&lbrace;tabbing&rbrace;</code> and each row ends with <code>\\</code> or
<code>\kill</code>. The last row may omit the <code>\\</code> and end with just
<code>\end&lbrace;tabbing&rbrace;</code>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="367">pattern, current tab stops, <r>tabbing</r></indexterm></cindex>
<para>At any point the <code>tabbing</code> environment has a <dfn>current tab stop
pattern</dfn>, a sequence of <math><var>n</var> &gt; 0</math> tab stops, numbered 0, 1,
etc.  These create <var>n</var> corresponding columns.  Tab stop&nbsp;0 is
always the left margin, defined by the enclosing environment.  Tab
stop number&nbsp;<var>i</var> is set if it is assigned a horizontal
position on the page.  Tab stop number&nbsp;<var>i</var> can only be set if
all the stops 0, &dots;, <math>i-1</math> have already been set; normally
later stops are to the right of earlier ones.
</para>
<para>By default any text typeset in a <code>tabbing</code> environment is typeset
ragged right and left-aligned on the current tab stop. Typesetting is
done in LR mode (<pxref label="Modes"><xrefnodename>Modes</xrefnodename></pxref>).
</para>
<para>The following commands can be used inside a <code>tabbing</code> environment.
They are all fragile (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="423" mergedindex="cp">\\ <r>(tabbing)</r></indexterm>\\ <r>(tabbing)</r></itemformat></item>
</tableterm><tableitem><para>End a tabbed line and typeset it.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="424" mergedindex="cp">\= <r>(tabbing)</r></indexterm>\= <r>(tabbing)</r></itemformat></item>
</tableterm><tableitem><para>Sets a tab stop at the current position.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="425" mergedindex="cp">\&gt; <r>(tabbing)</r></indexterm>\&gt; <r>(tabbing)</r></itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="426" mergedindex="cp">\&gt;</indexterm></findex>
<para>Advances to the next tab stop.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="427" mergedindex="cp">\&lt;</indexterm>\&lt;</itemformat></item>
</tableterm><tableitem><para>Put following text to the left of the local margin (without changing
the margin).  Can only be used at the start of the line.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="428" mergedindex="cp">\+</indexterm>\+</itemformat></item>
</tableterm><tableitem><para>Moves the left margin of the next and all the
following commands one tab stop to the right, beginning tabbed line if
necessary.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="429" mergedindex="cp">\-</indexterm>\-</itemformat></item>
</tableterm><tableitem><para>Moves the left margin of the next and all the
following commands one tab stop to the left, beginning tabbed line if
necessary.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="430" mergedindex="cp">\' <r>(tabbing)</r></indexterm>\' <r>(tabbing)</r></itemformat></item>
</tableterm><tableitem><para>Moves everything that you have typed so far in the current column, i.e.,
everything from the most recent <code>\&gt;</code>, <code>\&lt;</code>, <code>\'</code>,
<code>\\</code>, or <code>\kill</code> command, to the previous column and aligned
to the right, flush against the current column&textrsquo;s tab stop.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="431" mergedindex="cp">\` <r>(tabbing)</r></indexterm>\` <r>(tabbing)</r></itemformat></item>
</tableterm><tableitem><para>Allows you to put text flush right against any tab stop, including tab
stop&nbsp;0.  However, it can&textrsquo;t move text to the right of the last
column because there&textrsquo;s no tab stop there.  The <code>\`</code> command moves
all the text that follows it, up to the <code>\\</code> or
<code>\end&lbrace;tabbing&rbrace;</code> command that ends the line, to the right margin
of the <code>tabbing</code> environment.  There must be no <code>\&gt;</code> or
<code>\'</code> command between the <code>\`</code> and the <code>\\</code> or
<code>\end&lbrace;tabbing&rbrace;</code> command that ends the line.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="432" mergedindex="cp">\a <r>(tabbing)</r></indexterm>\a <r>(tabbing)</r></itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="433" mergedindex="cp">\a' <r>(acute accent in tabbing)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="434" mergedindex="cp">\a` <r>(grave accent in tabbing)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="435" mergedindex="cp">\a= <r>(macron accent in tabbing)</r></indexterm></findex>
<para>In a <code>tabbing</code> environment, the commands <code>\=</code>, <code>\'</code> and
<code>\`</code> do not produce accents as usual (<pxref label="Accents"><xrefnodename>Accents</xrefnodename></pxref>).  Instead,
use the commands <code>\a=</code>, <code>\a'</code> and <code>\a`</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="436" mergedindex="cp">\kill</indexterm>\kill</itemformat></item>
</tableterm><tableitem><para>Sets tab stops without producing text.  Works just like <code>\\</code> except
that it throws away the current line instead of producing output for it.
Any <code>\=</code>, <code>\+</code> or <code>\-</code> commands in that line remain in
effect.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="437" mergedindex="cp">\poptabs</indexterm>\poptabs</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="438" mergedindex="cp">\poptabs</indexterm></findex>
<para>Restores the tab stop positions saved by the last <code>\pushtabs</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="439" mergedindex="cp">\pushtabs</indexterm>\pushtabs</itemformat></item>
</tableterm><tableitem><para>Saves all current tab stop positions. Useful for temporarily changing
tab stop positions in the middle of a <code>tabbing</code> environment.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="440" mergedindex="cp">\tabbingsep</indexterm>\tabbingsep</itemformat></item>
</tableterm><tableitem><para>Distance of the text moved by <code>\'</code> to left of current tab stop.
</para>
</tableitem></tableentry></ftable>

<para>This example typesets a Pascal function:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;tabbing&rbrace;
function \= fact(n : integer) : integer;\\
         \&gt; begin \= \+ \\
               \&gt; if \= n &gt; 1 then \+ \\
                        fact := n * fact(n-1) \- \\
                  else \+ \\
                        fact := 1; \-\- \\
            end;\\
\end&lbrace;tabbing&rbrace;
</pre></example>

<noindent></noindent>
<para>The output looks like this.
</para>
<example endspaces=" ">
<pre xml:space="preserve">function fact(n : integer) : integer;
         begin
               if n &gt; 1 then
                  fact := n * fact(n-1);
               else
                  fact := 1;
         end;
</pre></example>

<cindex index="cp" spaces=" "><indexterm index="cp" number="368"><r>package</r>, <code>algorithm2e</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="369"><code>algorithm2e</code> <r>package</r></indexterm></cindex>
 <cindex index="cp" spaces=" "><indexterm index="cp" number="370"><r>package</r>, <code>listings</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="371"><code>listings</code> <r>package</r></indexterm></cindex>
 <cindex index="cp" spaces=" "><indexterm index="cp" number="372"><r>package</r>, <code>minted</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="373"><code>minted</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="374"><r>package</r>, <code>fancyvrb</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="375"><code>fancyvrb</code> <r>package</r></indexterm></cindex>

<noindent></noindent>
<para>This example is just for illustration of the environment.  To actually
typeset computer code in typewriter like this, a verbatim environment
(<pxref label="verbatim"><xrefnodename>verbatim</xrefnodename></pxref>) would normally be best.  For pretty-printed code,
there are quite a few packages, including <code>algorithm2e</code>,
<code>fancyvrb</code>, <code>listings</code>, and <code>minted</code>.
</para>
        
</section>
<node name="table" spaces=" "><nodename>table</nodename><nodenext automatic="on">tabular</nodenext><nodeprev automatic="on">tabbing</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>table</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="441" mergedindex="cp"><r>environment</r>, <code>table</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="442" mergedindex="cp"><code>table</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="376">tables, creating</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="377">creating tables</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;table&rbrace;[<var>placement</var>]
  <var>table body</var>
  \caption[<var>loftitle</var>]&lbrace;<var>title</var>&rbrace;  % optional
  \label&lbrace;<var>label&rbrace;</var>              % also optional
\end&lbrace;table&rbrace;
</pre></example>

<para>A class of floats (<pxref label="Floats"><xrefnodename>Floats</xrefnodename></pxref>).  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.
</para>
<para>This example <code>table</code> environment contains a <code>tabular</code>
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;table&rbrace;
  \centering\small
  \begin&lbrace;tabular&rbrace;&lbrace;ll&rbrace;
    \multicolumn&lbrace;1&rbrace;&lbrace;c&rbrace;&lbrace;\textit&lbrace;Author&rbrace;&rbrace;
      &amp;\multicolumn&lbrace;1&rbrace;&lbrace;c&rbrace;&lbrace;\textit&lbrace;Piece&rbrace;&rbrace;  \\ \hline
    Bach            &amp;Cello Suite Number 1  \\
    Beethoven       &amp;Cello Sonata Number 3 \\
    Brahms          &amp;Cello Sonata Number 1
  \end&lbrace;tabular&rbrace;
  \caption&lbrace;Top cello pieces&rbrace;
  \label&lbrace;tab:cello&rbrace;
\end&lbrace;table&rbrace;
</pre></example>

<noindent></noindent>
<para>but you can put many different kinds of content in a <code>table</code>:
the <var>table body</var> may contain text, &latex; commands, graphics, etc. It is
typeset in a <code>parbox</code> of width <code>\textwidth</code>.
</para>
<para>For the possible values of <var>placement</var> and their effect on the 
float placement algorithm, see <ref label="Floats"><xrefnodename>Floats</xrefnodename></ref>.
</para>
<para>The label is optional; it is used for cross references (<pxref label="Cross-references"><xrefnodename>Cross
references</xrefnodename></pxref>).  
<findex index="fn" spaces=" "><indexterm index="fn" number="443" mergedindex="cp">\caption</indexterm></findex>
The <code>\caption</code> command is also optional.  It specifies caption
text <var>title</var> for the table (<pxref label="_005ccaption"><xrefnodename>\caption</xrefnodename></pxref>).  By default it is
numbered.  If its optional <var>lottitle</var> is present then that text is
used in the list of tables instead of <var>title</var> (<pxref label="Table-of-contents-etc_002e"><xrefnodename>Table of
contents etc.</xrefnodename></pxref>).
</para>
<para>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.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;table&rbrace;[b]
  \centering
  \begin&lbrace;tabular&rbrace;&lbrace;r|p&lbrace;2in&rbrace;&rbrace; \hline
    One &amp;The loneliest number \\
    Two &amp;Can be as sad as one.
         It's the loneliest number since the number one.
  \end&lbrace;tabular&rbrace;
  \caption&lbrace;Cardinal virtues&rbrace;
  \label&lbrace;tab:CardinalVirtues&rbrace;
\end&lbrace;table&rbrace;
</pre></example> 


</section>
<node name="tabular" spaces=" "><nodename>tabular</nodename><nodenext automatic="on">thebibliography</nodenext><nodeprev automatic="on">table</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>tabular</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="444" mergedindex="cp"><r>environment</r>, <code>tabular</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="445" mergedindex="cp"><code>tabular</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="378">lines in tables</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="379">lining text up in tables</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;tabular&rbrace;[<var>pos</var>]&lbrace;<var>cols</var>&rbrace;
  <var>column 1 entry</var>  &amp;<var>column 2 entry</var>  ...  &amp;<var>column n entry</var> \\
  ...
\end&lbrace;tabular&rbrace;
</pre></example>

<noindent></noindent>
<para>or
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;tabular*&rbrace;&lbrace;<var>width</var>&rbrace;[<var>pos</var>]&lbrace;<var>cols</var>&rbrace;
  <var>column 1 entry</var>  &amp;<var>column 2 entry</var>  ...  &amp;<var>column n entry</var> \\
  ...
\end&lbrace;tabular*&rbrace;
</pre></example>

<para>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.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;tabular&rbrace;&lbrace;l|l&rbrace;
  \textit&lbrace;Player name&rbrace;  &amp;\textit&lbrace;Career home runs&rbrace;  \\ 
  \hline
  Hank Aaron  &amp;755 \\
  Babe Ruth   &amp;714
\end&lbrace;tabular&rbrace;
</pre></example>

<noindent></noindent>
<para>The output will have two left-aligned columns with a vertical bar
between them.  This is specified in <code>tabular</code>&textrsquo;s argument
<code>&lbrace;l|l&rbrace;</code>.
<findex index="fn" spaces=" "><indexterm index="fn" number="446" mergedindex="cp">&amp; <r>for table cells</r></indexterm></findex>
Put the entries into different columns by separating them with an
ampersand, <code>&amp;</code>.  The end of each row is marked with a double
backslash, <code>\\</code>.  Put a horizontal rule below a row, after a double
backslash, with <code>\hline</code>.
<findex index="fn" spaces=" "><indexterm index="fn" number="447" mergedindex="cp">\\ <r>for <code>tabular</code></r></indexterm></findex>
After the last row the <code>\\</code> is optional, unless an <code>\hline</code>
command follows to put a rule below the table.
</para>
<para>The required and optional arguments to <code>tabular</code> consist of:
</para>
<table commandarg="var" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="var">pos</itemformat></item>
</tableterm><tableitem><para>Optional.  Specifies the table&textrsquo;s vertical position.  The default is to
align the table so its vertical center matches the baseline of the
surrounding text.  There are two other possible alignments: <code>t</code>
aligns the table so its top row matches the baseline of the surrounding
text, and <code>b</code> aligns on the bottom row.
</para>
<para>This only has an effect if there is other text.  In the common case of a
<code>tabular</code> alone in a <code>center</code> environment this option makes
no difference.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">cols</itemformat></item>
</tableterm><tableitem><para>Required.  Specifies the formatting of columns.  It consists of a
sequence of the following specifiers, corresponding to the types of
column and intercolumn material.
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">l</itemformat></item>
</tableterm><tableitem><para>A column of left-aligned items.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">r</itemformat></item>
</tableterm><tableitem><para>A column of right-aligned items.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">c</itemformat></item>
</tableterm><tableitem><para>A column of centered items.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">|</itemformat></item>
</tableterm><tableitem><para>A vertical line the full height and depth of the environment.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">&arobase;&lbrace;<var>text or space</var>&rbrace;</itemformat></item>
</tableterm><tableitem><para>Insert <var>text or space</var> at this location in every row.  The <var>text
or space</var> material is typeset in LR mode.  This text is fragile
(<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>If between two columns there is no &arobase;-expression then &latex;&textrsquo;s
<code>book</code>, <code>article</code>, and <code>report</code> classes will put on
either side of each column a space of length <code>\tabcolsep</code>, which by
default is 6<dmn>pt</dmn>.  That is, by default adjacent columns are
separated by 12<dmn>pt</dmn> (so <code>\tabcolsep</code> is misleadingly named
since it is only half of the separation between tabular columns).  In
addition, a space of 6<dmn>pt</dmn> also comes before the first column and
after the final column, unless you put a <code>&arobase;&lbrace;...&rbrace;</code> or <code>|</code>
there.
</para>
<para>If you override the default and use an &arobase;-expression then &latex; does
not insert <code>\tabcolsep</code> so you must insert any desired space
yourself, as in <code>&arobase;&lbrace;\hspace&lbrace;1em&rbrace;&rbrace;</code>.
</para>
<para>An empty expression <code>&arobase;&lbrace;&rbrace;</code> will eliminate the space. In
particular, sometimes you want to eliminate 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.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;flushleft&rbrace;
  \begin&lbrace;tabular&rbrace;&lbrace;&arobase;&lbrace;&rbrace;l&rbrace;
    ...
  \end&lbrace;tabular&rbrace;
\end&lbrace;flushleft&rbrace;
</pre></example>

<para>The next example shows text, a decimal point between the columns,
arranged so the numbers in the table are aligned on it.
</para>
<example endspaces=" "> 
<pre xml:space="preserve">\begin&lbrace;tabular&rbrace;&lbrace;r&arobase;&lbrace;$.$&rbrace;l&rbrace;
  $3$ &amp;$14$  \\
  $9$ &amp;$80665$
\end&lbrace;tabular&rbrace;
</pre></example>

<findex index="fn" spaces=" "><indexterm index="fn" number="448" mergedindex="cp">\extracolsep</indexterm></findex>
<para>An <code>\extracolsep&lbrace;<var>wd</var>&rbrace;</code> command in an &arobase;-expression causes an
extra space of width <var>wd</var> to appear to the left of all subsequent
columns, until countermanded by another <code>\extracolsep</code>.  Unlike
ordinary intercolumn space, this extra space is not suppressed by an
&arobase;-expression.  An <code>\extracolsep</code> command can be used only in an
&arobase;-expression in the <code>cols</code> argument.  Below, &latex; inserts the
right amount of intercolumn space to make the entire table 4 inches
wide.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;tabular*&rbrace;&lbrace;4in&rbrace;&lbrace;l&arobase;&lbrace;\extracolsep&lbrace;\fill&rbrace;&rbrace;l&rbrace;
  Seven times down, eight times up \ldots 
  &amp;such is life!
\end&lbrace;tabular*&rbrace;
</pre></example>

<para>To insert commands that are automatically executed before a given
column, load the <code>array</code> package and use the <code>&gt;&lbrace;...&rbrace;</code>
specifier.
<!-- c xx should fully explain array, tabularx, and all other base packages... -->
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">p&lbrace;<var>wd</var>&rbrace;</itemformat></item>
</tableterm><tableitem><para>Each item in the column is typeset in a parbox of width <var>wd</var>, as if
it were the argument of a <code>\parbox[t]&lbrace;wd&rbrace;&lbrace;...&rbrace;</code> command.
</para>
<para>A line break double backslash <code>\\</code> may not appear in the item,
except inside an environment like <code>minipage</code>, <code>array</code>, or
<code>tabular</code>, or inside an explicit <code>\parbox</code>, or in the scope of
a <code>\centering</code>, <code>\raggedright</code>, or <code>\raggedleft</code>
declaration (when used in a <code>p</code>-column element these declarations
must appear inside braces, as with <code>&lbrace;\centering .. \\
..&rbrace;</code>). Otherwise &latex; will misinterpret the double backslash as
ending the tabular row.  Instead, to get a line break in there use
<code>\newline</code> (<pxref label="_005cnewline"><xrefnodename>\newline</xrefnodename></pxref>).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">*&lbrace;<var>num</var>&rbrace;&lbrace;<var>cols</var>&rbrace;</itemformat></item>
</tableterm><tableitem><para>Equivalent to <var>num</var> copies of <var>cols</var>, where <var>num</var> is a
positive integer and <var>cols</var> is a list of specifiers.  Thus the
specifier <code>\begin&lbrace;tabular&rbrace;&lbrace;|*&lbrace;3&rbrace;&lbrace;l|r&rbrace;|&rbrace;</code> is equivalent to
the specifier <code>\begin&lbrace;tabular&rbrace;&lbrace;|l|rl|rl|r|&rbrace;</code>.  Note that
<var>cols</var> may contain another <code>*</code>-expression.
</para> 
</tableitem></tableentry></table>

</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">width</itemformat></item>
</tableterm><tableitem><para>Required for <code>tabular*</code>, not allowed for <code>tabular</code>. Specifies
the width of the <code>tabular*</code> environment.  The space between columns
should be rubber, as with <code>&arobase;&lbrace;\extracolsep&lbrace;\fill&rbrace;&rbrace;</code>, 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
...</code> warning.
</para>
</tableitem></tableentry></table>

<para>Parameters that control formatting:
<!-- c xx defaults, own node (xref from array)? -->
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="449" mergedindex="cp">\arrayrulewidth</indexterm>\arrayrulewidth</itemformat></item>
</tableterm><tableitem><anchor name="tabular-arrayrulewidth">tabular arrayrulewidth</anchor>
<para>A length that is the thickness of the rule created by <code>|</code>,
<code>\hline</code>, and <code>\vline</code> in the <code>tabular</code> and <code>array</code>
environments.  The default is <samp>.4pt</samp>. Change it as in
<code>\setlength&lbrace;\arrayrulewidth&rbrace;&lbrace;0.8pt&rbrace;</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="450" mergedindex="cp">\arraystretch</indexterm>\arraystretch</itemformat></item>
</tableterm><tableitem><anchor name="tabular-arraystrech">tabular arraystrech</anchor>
<para>A factor by which the spacing between rows in the <code>tabular</code> and
<code>array</code> environments is multiplied.  The default is <samp>1</samp>, for
no scaling.  Change it as <code>\renewcommand&lbrace;\arraystretch&rbrace;&lbrace;1.2&rbrace;</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="451" mergedindex="cp">\doublerulesep</indexterm>\doublerulesep</itemformat></item>
</tableterm><tableitem><anchor name="tabular-doublerulesep">tabular doublerulesep</anchor>
<para>A length that is the distance between the vertical rules produced by the
<code>||</code> specifier.  The default is <samp>2pt</samp>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="452" mergedindex="cp">\tabcolsep</indexterm>\tabcolsep</itemformat></item>
</tableterm><tableitem><anchor name="tabular-tabcolsep">tabular tabcolsep</anchor>
<para>A length that is half of the space between columns. The default is
<samp>6pt</samp>.  Change it with <code>\setlength</code>.
</para>
</tableitem></tableentry></ftable>

<para>The following commands can be used inside the body of a <code>tabular</code>
environment, the first two inside an entry and the second two between
lines:
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::        ">\multicolumn</menunode><menudescription><pre xml:space="preserve">Make an item spanning several columns.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::              ">\vline</menunode><menudescription><pre xml:space="preserve">Draw a vertical line.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::              ">\cline</menunode><menudescription><pre xml:space="preserve">Draw a horizontal line spanning some columns.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::              ">\hline</menunode><menudescription><pre xml:space="preserve">Draw a horizontal line spanning all columns.
</pre></menudescription></menuentry></menu>


<node name="_005cmulticolumn" spaces=" "><nodename>\multicolumn</nodename><nodenext automatic="on">\vline</nodenext><nodeup automatic="on">tabular</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\multicolumn</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="453" mergedindex="cp">\multicolumn</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\multicolumn&lbrace;<var>numcols</var>&rbrace;&lbrace;<var>cols</var>&rbrace;&lbrace;<var>text</var>&rbrace;
</pre></example>

<para>Make an <code>array</code> or <code>tabular</code> entry that spans several columns.
The first argument <var>numcols</var> gives the number of columns to span.
The second argument <var>cols</var> specifies the formatting of the entry,
with <code>c</code> for centered, <code>l</code> for flush left, or <code>r</code> for
flush right.  The third argument <var>text</var> gives the contents of that
entry.
</para>
<para>In this example, in the first row, the second and third columns are
spanned by the single heading <samp>Name</samp>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;tabular&rbrace;&lbrace;lccl&rbrace; 
  \textit&lbrace;ID&rbrace;       &amp;\multicolumn&lbrace;2&rbrace;&lbrace;c&rbrace;&lbrace;\textit&lbrace;Name&rbrace;&rbrace; &amp;\textit&lbrace;Age&rbrace; \\
  \hline  
  978-0-393-03701-2 &amp;O'Brian &amp;Patrick                  &amp;55           \\
    ...
\end&lbrace;tabular&rbrace;
</pre></example>

<para>What counts as a column is:&nbsp;the column format specifier for the
<code>array</code> or <code>tabular</code> environment is broken into parts, where
each part (except the first) begins with <code>l</code>, <code>c</code>, <code>r</code>,
or&nbsp;<code>p</code>.  So from <code>\begin&lbrace;tabular&rbrace;&lbrace;|r|ccp&lbrace;1.5in&rbrace;|&rbrace;</code>
the parts are <code>|r|</code>, <code>c</code>, <code>c</code>,
and&nbsp;<code>p&lbrace;1.5in&rbrace;|</code>.
</para>
<para>The <var>cols</var> argument overrides the <code>array</code> or <code>tabular</code>
environment&textrsquo;s intercolumn area default adjoining this multicolumn
entry. To affect that area, this argument can contain vertical bars
<code>|</code> indicating the placement of vertical rules, and <code>&arobase;&lbrace;...&rbrace;</code>
expressions.  Thus if <var>cols</var> is <samp>|c|</samp> then this multicolumn
entry will be centered and a vertical rule will come in the intercolumn
area before it and after it.  This table details the exact behavior.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;tabular&rbrace;&lbrace;|cc|c|c|&rbrace;
  \multicolumn&lbrace;1&rbrace;&lbrace;r&rbrace;&lbrace;w&rbrace;       % entry one
    &amp;\multicolumn&lbrace;1&rbrace;&lbrace;|r|&rbrace;&lbrace;x&rbrace;  % entry two 
    &amp;\multicolumn&lbrace;1&rbrace;&lbrace;|r&rbrace;&lbrace;y&rbrace;   % entry three
    &amp;z                        % entry four
\end&lbrace;tabular&rbrace;
</pre></example>

<noindent></noindent>
<para>Before the first entry the output will not have a vertical rule because
the <code>\multicolumn</code> has the <var>cols</var> specifier <samp>r</samp> with no
initial vertical bar.  Between entry one and entry two there will be a
vertical rule; although the first <var>cols</var> does not have an ending
vertical bar, the second <var>cols</var> does have a starting one.  Between
entry two and entry three there is a single vertical rule; despite that
the <var>cols</var> in both of the surrounding <code>multicolumn</code>&textrsquo;s call for
a vertical rule, you only get one rule.  Between entry three and entry
four there is no vertical rule; the default calls for one but the
<var>cols</var> in the entry three <code>\multicolumn</code> leaves it out, and
that takes precedence.  Finally, following entry four there is a
vertical rule because of the default.
</para>
<para>The number of spanned columns <var>numcols</var> can be 1.  Besides giving
the ability to change the horizontal alignment, this also is useful to
override for one row the <code>tabular</code> definition&textrsquo;s default intercolumn
area specification, including the placement of vertical rules.
</para>
<para>In the example below, in the <code>tabular</code> definition the first column
is specified to default to left justified but in the first row the entry
is centered with <code>\multicolumn&lbrace;1&rbrace;&lbrace;c&rbrace;&lbrace;\textsc&lbrace;Period&rbrace;&rbrace;</code>.
Also in the first row, the second and third columns are spanned by a
single entry with <code>\multicolumn&lbrace;2&rbrace;&lbrace;c&rbrace;&lbrace;\textsc&lbrace;Span&rbrace;&rbrace;</code>,
overriding the specification to center those two columns on the page
range en-dash.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;tabular&rbrace;&lbrace;l|r&arobase;&lbrace;--&rbrace;l&rbrace; 
  \multicolumn&lbrace;1&rbrace;&lbrace;c&rbrace;&lbrace;\textsc&lbrace;Period&rbrace;&rbrace;  
    &amp;\multicolumn&lbrace;2&rbrace;&lbrace;c&rbrace;&lbrace;\textsc&lbrace;Span&rbrace;&rbrace; \\ \hline
  Baroque          &amp;1600           &amp;1760         \\
  Classical        &amp;1730           &amp;1820         \\
  Romantic         &amp;1780           &amp;1910         \\
  Impressionistic  &amp;1875           &amp;1925
\end&lbrace;tabular&rbrace;
</pre></example>

<noindent></noindent>
<para>Although the <code>tabular</code> specification by default puts a vertical
rule between the first and second columns, no such vertical rule appears
in the first row here.  That&textrsquo;s because there is no vertical bar in the
<var>cols</var> part of the first row&textrsquo;s first <code>\multicolumn</code> command.
</para>

</subsection>
<node name="_005cvline" spaces=" "><nodename>\vline</nodename><nodenext automatic="on">\cline</nodenext><nodeprev automatic="on">\multicolumn</nodeprev><nodeup automatic="on">tabular</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\vline</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="454" mergedindex="cp">\vline</indexterm></findex>
<para>Draw a vertical line in a <code>tabular</code> or <code>array</code> environment
extending the full height and depth of an entry&textrsquo;s row.  Can also be
used in an &arobase;-expression, although its synonym vertical
bar&nbsp;<code>|</code> is more common.  This command is rarely used in the
body of a table; typically a table&textrsquo;s vertical lines are specified in
<code>tabular</code>&textrsquo;s <var>cols</var> argument and overridden as needed with
<code>\multicolumn</code> (<pxref label="tabular"><xrefnodename>tabular</xrefnodename></pxref>).
</para>
<para>The example below illustrates some pitfalls.  In the first row&textrsquo;s second
entry the <code>\hfill</code> moves the <code>\vline</code> to the left edge of the
cell.  But that is different than putting it halfway between the two
columns, so between the first and second columns there are two vertical
rules, with the one from the <code>&lbrace;c|cc&rbrace;</code> specifier coming before the
one produced by the <code>\vline\hfill</code>.  In contrast, the first row&textrsquo;s
third entry shows the usual way to put a vertical bar between two
columns.  In the second row, the <code>ghi</code> is the widest entry in its
column so in the <code>\vline\hfill</code> the <code>\hfill</code> has no effect and
the vertical line in that entry appears immediately next to the
<code>g</code>, with no whitespace.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;tabular&rbrace;&lbrace;c|cc&rbrace;
  x   &amp;\vline\hfill y   &amp;\multicolumn&lbrace;1&rbrace;&lbrace;|r&rbrace;&lbrace;z&rbrace; \\ % row 1  
  abc &amp;def &amp;\vline\hfill ghi                       % row 2  
\end&lbrace;tabular&rbrace;
</pre></example>


</subsection>
<node name="_005ccline" spaces=" "><nodename>\cline</nodename><nodenext automatic="on">\hline</nodenext><nodeprev automatic="on">\vline</nodeprev><nodeup automatic="on">tabular</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\cline</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="455" mergedindex="cp">\cline</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\cline&lbrace;<var>i</var>-<var>j</var>&rbrace;
</pre></example>

<para>In an <code>array</code> or <code>tabular</code> environment, draw a horizontal rule
beginning in column&nbsp;<var>i</var> and ending in column&nbsp;<var>j</var>. The
dash, <code>-</code>, must appear in the mandatory argument. To span a single
column use the number twice, as with <code>\cline&lbrace;2-2&rbrace;</code>.
</para>
<para>This example puts two horizontal lines between the first and second
rows, one line in the first column only, and the other spanning the
third and fourth columns.  The two lines are side-by-side, at the same
height.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;tabular&rbrace;&lbrace;llrr&rbrace; 
  a &amp;b &amp;c &amp;d \\ \cline&lbrace;1-1&rbrace; \cline&lbrace;3-4&rbrace; 
  e &amp;f &amp;g &amp;h 
\end&lbrace;tabular&rbrace;
</pre></example>


</subsection>
<node name="_005chline" spaces=" "><nodename>\hline</nodename><nodeprev automatic="on">\cline</nodeprev><nodeup automatic="on">tabular</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\hline</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="456" mergedindex="cp">\hline</indexterm></findex>

<para>Draw a horizontal line the width of the enclosing <code>tabular</code> or
<code>array</code> environment.  It&textrsquo;s most commonly used to draw a line at the
top, bottom, and between the rows of a table.
</para>
<para>In this example the top of the table has two horizontal rules, one above
the other, that span both columns.  The bottom of the table has a single
rule spanning both columns.  Because of the <code>\hline</code>, the
<code>tabular</code> second row&textrsquo;s line ending double backslash&nbsp;<code>\\</code>
is required.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;tabular&rbrace;&lbrace;ll&rbrace; \hline\hline
  Baseball   &amp;Red Sox  \\
  Basketball &amp;Celtics  \\ \hline
\end&lbrace;tabular&rbrace;
</pre></example>


</subsection>
</section>
<node name="thebibliography" spaces=" "><nodename>thebibliography</nodename><nodenext automatic="on">theorem</nodenext><nodeprev automatic="on">tabular</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>thebibliography</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="457" mergedindex="cp"><r>environment</r>, <code>thebibliography</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="458" mergedindex="cp"><code>thebibliography</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="380">bibliography, creating (manually)</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;thebibliography&rbrace;&lbrace;<var>widest-label</var>&rbrace;
  \bibitem[<var>label</var>]&lbrace;<var>cite_key&rbrace;</var>
  ...
\end&lbrace;thebibliography&rbrace;
</pre></example>

<para>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 label="Using-BibTeX"><xrefnodename>Using BibTeX</xrefnodename></xref>,
for a more sophisticated approach.
</para>
<para>This shows the environment with two entries.
</para>
<example endspaces=" ">
<pre xml:space="preserve">This work is based on \cite&lbrace;latexdps&rbrace;.
Together they are \cite&lbrace;latexdps, texbook&rbrace;.
  ...
\begin&lbrace;thebibliography&rbrace;&lbrace;9&rbrace;
\bibitem&lbrace;latexdps&rbrace; 
  Leslie Lamport. 
  \textit&lbrace;\LaTeX&lbrace;&rbrace;: a document preparation system&rbrace;. 
  Addison-Wesley, Reading, Massachusetts, 1993.
\bibitem&lbrace;texbook&rbrace; 
  Donald Ervin Knuth. 
  \textit&lbrace;The \TeX book&rbrace;. 
  Addison-Wesley, Reading, Massachusetts, 1983.
\end&lbrace;thebibliography&rbrace;
</pre></example>

<noindent></noindent>
<para>This styles the first reference as <samp>[1] Leslie ...</samp>, and so that
<code>... based on \cite&lbrace;latexdps&rbrace;</code> produces the matching
<samp>... based on [1]</samp>.  The second <code>\cite</code> produces <samp>[1,
2]</samp>.  You must compile the document twice to resolve these references.
</para>
<para>The mandatory argument <var>widest-label</var> is text that, when typeset, is
as wide as the widest item label produced by the <code>\bibitem</code>
commands.  The tradition is to use <code>9</code> for bibliographies with less
than 10 references, <code>99</code> for ones with less than 100, etc.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="459" mergedindex="cp">\bibname</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="460" mergedindex="cp">\refname</indexterm></findex>
<para>The bibliographic list is headed by a title such as <samp>Bibliography</samp>.
To change it there are two cases.  In the <file>book</file> and <file>report</file>
classes, where the top level sectioning is <code>\chapter</code> and the
default title is <samp>Bibliography</samp>, that title is in the macro
<code>\bibname</code>.  For <file>article</file>, where the class&textrsquo;s top level
sectioning is <code>\section</code> and the default is <samp>References</samp>, the
title is in macro <code>\refname</code>.  Change it by redefining the command,
as with <code>\renewcommand&lbrace;\refname&rbrace;&lbrace;Cited references&rbrace;</code>, after
<code>\begin&lbrace;document&rbrace;</code>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="381"><r>package</r>, <code>babel</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="382"><code>babel</code> <r>package</r></indexterm></cindex>

<para>Language support packages such as <code>babel</code> will automatically
redefine <code>\refname</code> or <code>\bibname</code> to fit the selected
language.
</para>
<para><xref label="list"><xrefnodename>list</xrefnodename></xref>, for the list layout control parameters.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::            ">\bibitem</menunode><menudescription><pre xml:space="preserve">Specify a bibliography item.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::               ">\cite</menunode><menudescription><pre xml:space="preserve">Refer to a bibliography item.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::             ">\nocite</menunode><menudescription><pre xml:space="preserve">Include an item in the bibliography.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::        ">Using BibTeX</menunode><menudescription><pre xml:space="preserve">Automatic generation of bibliographies.
</pre></menudescription></menuentry></menu>


<node name="_005cbibitem" spaces=" "><nodename>\bibitem</nodename><nodenext automatic="on">\cite</nodenext><nodeup automatic="on">thebibliography</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\bibitem</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="461" mergedindex="cp">\bibitem</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\bibitem&lbrace;<var>cite_key</var>&rbrace;
</pre></example>

<noindent></noindent>
<para>or
</para>
<example endspaces=" ">
<pre xml:space="preserve">\bibitem[<var>label</var>]&lbrace;<var>cite_key</var>&rbrace;
</pre></example>

<para>Generate an entry labeled by default by a number generated using the
<code>enumi</code> counter.  The <dfn>citation key</dfn>
<cindex index="cp" spaces=" "><indexterm index="cp" number="383">citation key</indexterm></cindex>
<var>cite_key</var> can be any string of
letters, numbers, and punctuation symbols (but not comma).
</para>
<para><xref label="thebibliography"><xrefnodename>thebibliography</xrefnodename></xref>, for an example.
</para>
<para>When provided, the optional <var>label</var> becomes the entry label and the
<code>enumi</code> counter is not incremented.  With this
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;thebibliography&rbrace;
\bibitem[Lamport 1993]&lbrace;latexdps&rbrace; 
  Leslie Lamport. 
  \textit&lbrace;\LaTeX&lbrace;&rbrace;: a document preparation system&rbrace;. 
  Addison-Wesley, Reading, Massachusetts, 1993.
\bibitem&lbrace;texbook&rbrace; 
  Donald Ervin Knuth. 
  \textit&lbrace;The \TeX book&rbrace;. 
  Addison-Wesley, Reading, Massachusetts, 1983.
\end&lbrace;thebibliography&rbrace;
</pre></example>

<noindent></noindent>
<para>the first entry will be styled as <samp>[Lamport 1993] Leslie ...</samp>  (The
amount of horizontal space that &latex; leaves for the label depends on
the <var>widest-label</var> argument of the <code>thebibliography</code>
environment; see <ref label="thebibliography"><xrefnodename>thebibliography</xrefnodename></ref>.)  Similarly, <code>... based on
\cite&lbrace;latexdps&rbrace;</code> will produce <samp>... based on [Lamport 1994]</samp>.
</para>
<para>If you mix <code>\bibitem</code> entries having a <var>label</var> with those that
do not then &latex; will number the unlabelled ones sequentially.  In
the example above the <code>texbook</code> entry will appear as <samp>[1]
Donald ...</samp>, despite that it is the second entry.
</para>
<para>If you use the same <var>cite_key</var> twice then you get <samp>LaTeX
Warning: There were multiply-defined labels</samp>.
</para>
<para>Under the hood, &latex; remembers the <var>cite_key</var> and <var>label</var>
information because <code>\bibitem</code> writes it to the auxiliary file
<file><var>jobname</var>.aux</file> (<pxref label="Jobname"><xrefnodename>Jobname</xrefnodename></pxref>).  For instance, the above
example causes the two <code>\bibcite&lbrace;latexdps&rbrace;&lbrace;Lamport, 1993&rbrace;</code> and
<code>\bibcite&lbrace;texbook&rbrace;&lbrace;1&rbrace;</code> to appear in that file.  The <file>.aux</file>
file is read by the <code>\begin&lbrace;document&rbrace;</code> command and then the
information is available for <code>\cite</code> commands.  This explains why
you need to run &latex; twice to resolve references: once to write it
out and once to read it in.
</para>
<para>Because of this two-pass algorithm, when you add a <code>\bibitem</code> or
change its <var>cite_key</var> you may get <samp>LaTeX Warning: Label(s) may
have changed. Rerun to get cross-references right</samp>.  Fix it by
recompiling.
</para>

</subsection>
<node name="_005ccite" spaces=" "><nodename>\cite</nodename><nodenext automatic="on">\nocite</nodenext><nodeprev automatic="on">\bibitem</nodeprev><nodeup automatic="on">thebibliography</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\cite</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="462" mergedindex="cp">\cite</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\cite&lbrace;<var>keys</var>&rbrace;
</pre></example>

<noindent></noindent>
<para>or
</para>
<example endspaces=" ">
<pre xml:space="preserve">\cite[<var>subcite</var>]&lbrace;<var>keys</var>&rbrace;
</pre></example>

<para>Generate as output a citation to the references associated with
<var>keys</var>.  The mandatory <var>keys</var> is a citation key, or a
comma-separated list of citation keys (<pxref label="_005cbibitem"><xrefnodename>\bibitem</xrefnodename></pxref>).
</para>
<para>This 
</para>
<example endspaces=" ">
<pre xml:space="preserve">The ultimate source is \cite&lbrace;texbook&rbrace;.
  ...
\begin&lbrace;thebibliography&rbrace;
\bibitem&lbrace;texbook&rbrace; 
  Donald Ervin Knuth. 
  \textit&lbrace;The \TeX book&rbrace;. 
  Addison-Wesley, Reading, Massachusetts, 1983.
\end&lbrace;thebibliography&rbrace;
</pre></example>

<noindent></noindent>
<para>produces output like <samp>... source is [1]</samp>.  You can change the
appearance of the citation and of the reference by using bibliography
styles if you generate automatically the <code>thebibliography</code>
environment.  More information in <ref label="Using-BibTeX"><xrefnodename>Using BibTeX</xrefnodename></ref>.
</para>
<para>The optional argument <var>subcite</var> is appended to the citation.  For
example, <code>See 14.3 in \cite[p.~314]&lbrace;texbook&rbrace;</code> might produce
<samp>See 14.3 in [1, p.&nbsp;314]</samp>.
</para>
<para>In addition to what appears in the output, <code>\cite</code> writes
information to the auxiliary file <file><var>jobname</var>.aux</file>
(<pxref label="Jobname"><xrefnodename>Jobname</xrefnodename></pxref>).  For instance, <code>\cite&lbrace;latexdps&rbrace;</code> writes
<samp>\citation&lbrace;latexdps&rbrace;</samp> 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 label="_005cnocite"><xrefnodename>\nocite</xrefnodename></ref> also.
</para>
<para>If <var>keys</var> is not in your bibliography information then you get
<samp>LaTeX Warning: There were undefined references</samp>, 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&lbrace;texbok&rbrace;</code> 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> file (<pxref label="_005cbibitem"><xrefnodename>\bibitem</xrefnodename></pxref>) then
the fix may be to run &latex; again.
</para>

</subsection>
<node name="_005cnocite" spaces=" "><nodename>\nocite</nodename><nodenext automatic="on">Using BibTeX</nodenext><nodeprev automatic="on">\cite</nodeprev><nodeup automatic="on">thebibliography</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\nocite</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="463" mergedindex="cp">\nocite</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve"><code>\nocite&lbrace;<var>keys</var>&rbrace;</code>
</pre></example>

<para>Produces no output but writes <var>keys</var> to the auxiliary file
<file><var>jobname</var>.aux</file> (<pxref label="Jobname"><xrefnodename>Jobname</xrefnodename></pxref>).
</para>
<para>The mandatory argument <var>keys</var> is a comma-separated list of one or
more citation keys (<pxref label="_005cbibitem"><xrefnodename>\bibitem</xrefnodename></pxref>).  This information is used by
Bib&tex; to include these works in your reference list even though you
have not explicitly cited them (<pxref label="_005ccite"><xrefnodename>\cite</xrefnodename></pxref>).
</para>

</subsection>
<node name="Using-BibTeX" spaces=" "><nodename>Using BibTeX</nodename><nodeprev automatic="on">\nocite</nodeprev><nodeup automatic="on">thebibliography</nodeup></node>
<subsection spaces=" "><sectiontitle>Using Bib&tex;</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="384">using Bib&tex;</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="385">bib&tex;, using</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="386">bibliography, creating (automatically)</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="464" mergedindex="cp">\bibliographystyle</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="465" mergedindex="cp">\bibliography</indexterm></findex>

<para>As described in <code>thebibliography</code> (<pxref label="thebibliography"><xrefnodename>thebibliography</xrefnodename></pxref>), a
sophisticated approach to managing bibliographies is provided by the
Bib&tex; program.  This is only an introduction; see the full
documentation on CTAN (<pxref label="CTAN"><xrefnodename>CTAN</xrefnodename></pxref>).
</para>
<para>With Bib&tex;, you don&textrsquo;t use the <code>thebibliography</code> environment
directly (<pxref label="thebibliography"><xrefnodename>thebibliography</xrefnodename></pxref>). Instead, include these lines:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\bibliographystyle&lbrace;<var>bibstyle</var>&rbrace;
\bibliography&lbrace;<var>bibfile1</var>, <var>bibfile2</var>, ...&rbrace;
</pre></example>

<noindent></noindent>
<para>The <var>bibstyle</var> refers to a file <file><var>bibstyle</var>.bst</file>, which
defines how your citations will look.  The standard <var>bibstyle</var>&textrsquo;s
distributed with Bib&tex; are:
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">alpha</itemformat></item>
</tableterm><tableitem><para>Labels are formed from name of author and year of publication.
The bibliographic items are sorted alphabetically.
</para></tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">plain</itemformat></item>
</tableterm><tableitem><para>Labels are integers.
Sort the  bibliographic items alphabetically.
</para></tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">unsrt</itemformat></item>
</tableterm><tableitem><para>Like <code>plain</code>, but entries are in order of citation.
</para></tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">abbrv</itemformat></item>
</tableterm><tableitem><para>Like <code>plain</code>, but more compact labels.
</para></tableitem></tableentry></table>

<noindent></noindent><para>Many, many other Bib&tex; style files exist,
tailored to the demands of various publications.  See the CTAN topic
<url><urefurl>https://ctan.org/topic/bibtex-sty</urefurl></url>.
</para>
<para>The <code>\bibliography</code> command is what actually produces the
bibliography.  Its argument is a comma-separated list, referring to
files named <file><var>bibfile1</var>.bib</file>, <file><var>bibfile2</var>.bib</file>,
&dots; These contain your database in Bib&tex; format.  This shows a
typical couple of entries in that format.
</para>
<example endspaces=" ">
<pre xml:space="preserve">&arobase;book&lbrace;texbook,
  title     = &lbrace;The &lbrace;&lbrace;\TeX&rbrace;&rbrace;book&rbrace;,
  author    = &lbrace;D.E. Knuth&rbrace;,
  isbn      = &lbrace;0201134489&rbrace;,
  series    = &lbrace;Computers \&amp; typesetting&rbrace;,
  year      = &lbrace;1983&rbrace;,
  publisher = &lbrace;Addison-Wesley&rbrace;
&rbrace;
&arobase;book&lbrace;sexbook,
    author    = &lbrace;W.H. Masters and V.E. Johnson&rbrace;,
    title     = &lbrace;Human Sexual Response&rbrace;,
    year      = &lbrace;1966&rbrace;,
    publisher = &lbrace;Bantam Books&rbrace;
&rbrace;
</pre></example>

<para>Only the bibliographic entries referred to via <code>\cite</code> and
<code>\nocite</code> will be listed in the document&textrsquo;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.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="387"><samp>*</samp>, to <code>\nocite</code> all keys</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="466" mergedindex="cp">\nocite <r>&lbrace;*&rbrace;, for all keys</r></indexterm></findex>
<para>With Bib&tex;, the <var>keys</var> argument to <code>\nocite</code> can also be
the single character <samp>*</samp>.  This means to implicitly cite all
entries from all given bibliographies.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::">Bib&tex; error messages</menunode><menudescription><pre xml:space="preserve">
</pre></menudescription></menuentry></menu>

<node name="BibTeX-error-messages" spaces=" "><nodename>Bib&tex; error messages</nodename><nodeup automatic="on">Using BibTeX</nodeup></node>
<subsubsection spaces=" "><sectiontitle>Bib&tex; error messages</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="388">Bib&tex; error messages</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="389">error messages, from Bib&tex;</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="467" mergedindex="cp">.aux <r>file and Bib&tex; commands</r></indexterm></findex>

<para>If you forget to use <code>\bibliography</code> or <code>\bibliographystyle</code>
in your document (or, less likely, any <code>\cite</code> or <code>\nocite</code>
command), Bib&tex; will issue an error message.  Because Bib&tex;
can be used with any program, not just &latex;, the error messages
refer to the internal commands read by Bib&tex; (from the <file>.aux</file>
file), rather than the user-level commands described above.
</para>
<para>Here is a table showing internal commands mentioned in the Bib&tex;
errors, and the corresponding user-level commands.
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="468" mergedindex="cp">\bibdata</indexterm>\bibdata</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="469" mergedindex="cp">\bibliography <r>and internal <code>\bibdata</code></r></indexterm></findex>
<para><code>\bibliography</code>
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="470" mergedindex="cp">\bibstyle</indexterm>\bibstyle</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="471" mergedindex="cp">\bibliographystyle <r>and internal <code>\bibstyle</code></r></indexterm></findex>
<para><code>\bibliographystyle</code>
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="472" mergedindex="cp">\citation</indexterm>\citation</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="473" mergedindex="cp">\cite <r>and internal <code>\citation</code></r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="474" mergedindex="cp">\nocite <r>and internal <code>\citation</code></r></indexterm></findex>
<para><code>\cite</code>, <code>\nocite</code>
</para></tableitem></tableentry></ftable>

<para>For example, if your document has no <code>\bibliographystyle</code>
command, Bib&tex; complains as follows:
</para>
<example endspaces=" ">
<pre xml:space="preserve">I found no \bibstyle command---while reading file <var>document</var>.aux
</pre></example>


</subsubsection>
</subsection>
</section>
<node name="theorem" spaces=" "><nodename>theorem</nodename><nodenext automatic="on">titlepage</nodenext><nodeprev automatic="on">thebibliography</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>theorem</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="475" mergedindex="cp"><r>environment</r>, <code>theorem</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="476" mergedindex="cp"><code>theorem</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="390">theorems, typesetting</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;theorem&rbrace;
  <var>theorem body</var>
\end&lbrace;theorem&rbrace;
</pre></example>

<para>Produces <samp>Theorem <var>n</var></samp> in boldface followed by <var>theorem
body</var> in italics.  The numbering possibilities for <var>n</var> are described under
<code>\newtheorem</code> (<pxref label="_005cnewtheorem"><xrefnodename>\newtheorem</xrefnodename></pxref>).
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newtheorem&lbrace;lem&rbrace;&lbrace;Lemma&rbrace;      % in preamble
\newtheorem&lbrace;thm&rbrace;&lbrace;Theorem&rbrace;    
  ...
\begin&lbrace;lem&rbrace;                  % in  document body
  text of lemma
\end&lbrace;lem&rbrace;

The next result follows immediately.
\begin&lbrace;thm&rbrace;[Gauss]   %  put `Gauss' in parens after theorem head
  text of theorem
\end&lbrace;thm&rbrace;
</pre></example>

<cindex index="cp" spaces=" "><indexterm index="cp" number="391"><r>package</r>, <code>amsmath</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="392"><code>amsmath</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="393"><r>package</r>, <code>amsthm</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="394"><code>amsthm</code> <r>package</r></indexterm></cindex>

<para>Most new documents use the packages <code>amsthm</code> and <code>amsmath</code>
from the American Mathematical Society.  Among other things these
packages include a large number of options for theorem environments,
such as styling options.
</para>

</section>
<node name="titlepage" spaces=" "><nodename>titlepage</nodename><nodenext automatic="on">verbatim</nodenext><nodeprev automatic="on">theorem</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>titlepage</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="477" mergedindex="cp"><r>environment</r>, <code>titlepage</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="478" mergedindex="cp"><code>titlepage</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="395">making a title page</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="396">title pages, creating</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;titlepage&rbrace;
  ... text and spacing ...
\end&lbrace;titlepage&rbrace;
</pre></example>

<para>Create a title page, a page with no printed page number or heading and
with succeeding pages numbered starting with page one.
</para>
<para>In this example all formatting, including vertical spacing, is left to
the author.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;titlepage&rbrace;
\vspace*&lbrace;\stretch&lbrace;1&rbrace;&rbrace;
\begin&lbrace;center&rbrace;
  &lbrace;\huge\bfseries Thesis \\[1ex] 
                  title&rbrace;                  \\[6.5ex]
  &lbrace;\large\bfseries Author name&rbrace;           \\
  \vspace&lbrace;4ex&rbrace;
  Thesis  submitted to                    \\[5pt]
  \textit&lbrace;University name&rbrace;                \\[2cm]
  in partial fulfilment for the award of the degree of \\[2cm]
  \textsc&lbrace;\Large Doctor of Philosophy&rbrace;    \\[2ex]
  \textsc&lbrace;\large Mathematics&rbrace;             \\[12ex]
  \vfill
  Department of Mathematics               \\
  Address                                 \\
  \vfill
  \today
\end&lbrace;center&rbrace;
\vspace&lbrace;\stretch&lbrace;2&rbrace;&rbrace;
\end&lbrace;titlepage&rbrace;
</pre></example>

<para>To instead produce a standard title page without a <code>titlepage</code>
environment, use <code>\maketitle</code> (<pxref label="_005cmaketitle"><xrefnodename>\maketitle</xrefnodename></pxref>).
</para>

</section>
<node name="verbatim" spaces=" "><nodename>verbatim</nodename><nodenext automatic="on">verse</nodenext><nodeprev automatic="on">titlepage</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>verbatim</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="479" mergedindex="cp"><r>environment</r>, <code>verbatim</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="480" mergedindex="cp"><code>verbatim</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="397">verbatim text</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="398">simulating typed text</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="399">typed text, simulating</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="400">code, typesetting</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="401">computer programs, typesetting</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;verbatim&rbrace;
<var>literal-text</var>
\end&lbrace;verbatim&rbrace;
</pre></example>

<para>A paragraph-making environment in which &latex; produces as output
exactly what you type as input.  For instance inside <var>literal-text</var>
the backslash&nbsp;<code>\</code> character does not start commands, it
produces a printed <samp>\</samp>, and carriage returns and blanks are taken
literally.  The output appears in a monospaced typewriter-like font
(<code>\tt</code>).
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;verbatim&rbrace;
Symbol swearing: %&amp;$#?&eosexcl;.
\end&lbrace;verbatim&rbrace;
</pre></example>

<para>The only restriction on <code>literal-text</code> is that it cannot include
the string <code>\end&lbrace;verbatim&rbrace;</code>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="402"><r>package</r>, <code>cprotect</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="403"><code>cprotect</code> <r>package</r></indexterm></cindex>

<para>You cannot use the verbatim environment in the argument to macros, for
instance in the argument to a <code>\section</code>.  This is not the same as
commands being fragile (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>), instead it just cannot work,
as the <code>verbatim</code> environment changes the catcode regime before
processing its contents, and restore it immediately afterward,
nevertheless with a macro argument the content of the argument has
already be converted to a token list along the catcode regime in effect
when the macro was called.  However, the <code>cprotect</code> package can
help with this.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="404"><r>package</r>, <code>listings</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="405"><code>listings</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="406"><r>package</r>, <code>minted</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="407"><code>minted</code> <r>package</r></indexterm></cindex>

<para>One common use of verbatim input is to typeset computer code.  There are
packages that are an improvement the <code>verbatim</code> environment.  For
instance, one improvement is to allow the verbatim inclusion of external
files, or parts of those files.  Such packages include <code>listings</code>,
and <code>minted</code>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="408"><r>package</r>, <code>fancyvrb</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="409"><code>fancyvrb</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="410"><r>package</r>, <code>verbatimbox</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="411"><code>verbatimbox</code> <r>package</r></indexterm></cindex>

<para>A package that provides many more options for verbatim environments is
<code>fancyvrb</code>.  Another is <code>verbatimbox</code>.
</para>
<para>For a list of all the relevant packages, see CTAN (<pxref label="CTAN"><xrefnodename>CTAN</xrefnodename></pxref>).
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::       ">\verb</menunode><menudescription><pre xml:space="preserve">The macro form of the <code>verbatim</code> environment.
</pre></menudescription></menuentry></menu>


<node name="_005cverb" spaces=" "><nodename>\verb</nodename><nodeup automatic="on">verbatim</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\verb</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="481" mergedindex="cp">\verb</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="412">verbatim text, inline</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\verb <var>char</var> <var>literal-text</var> <var>char</var>
\verb* <var>char</var> <var>literal-text</var> <var>char</var>
</pre></example>

<para>Typeset <var>literal-text</var> as it is input, including special characters
and spaces, using the typewriter (<code>\tt</code>) font.
</para>
<para>This example shows two different invocations of <code>\verb</code>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">This is \verb!literally! the biggest pumpkin ever.
And this is the best squash, \verb+literally!+
</pre></example>

<noindent></noindent>
<para>The first <code>\verb</code> has its <var>literal-text</var> surrounded with
exclamation point, <code>!</code>.  The second instead uses plus, <code>+</code>,
because the exclamation point is part of <code>literal-text</code>.
</para>
<para>The single-character delimiter <var>char</var> surrounds
<var>literal-text</var>&textmdash;it must be the same character before and after.
No spaces come between <code>\verb</code> or <code>\verb*</code> and <var>char</var>,
or between <var>char</var> and <var>literal-text</var>, or between
<var>literal-text</var> and the second occurrence of <var>char</var> (the
synopsis shows a space only to distinguish one component from the
other).  The delimiter must not appear in <var>literal-text</var>. The
<var>literal-text</var> cannot include a line break.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="413">visible space</indexterm></cindex>
<para>The <code>*</code>-form differs only in that spaces are printed with a visible
space character.
<tex endspaces=" ">
</tex>
</para>
<para>The output from this will include a visible space on both side of word
<samp>with</samp>:
</para>
<example endspaces=" ">
<pre xml:space="preserve">The command's first argument is \verb*!filename with extension! and ...
</pre></example>

<cindex index="cp" spaces=" "><indexterm index="cp" number="414"><r>package</r>, <code>url</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="415"><code>url</code> <r>package</r></indexterm></cindex>

<para>For typesetting Internet addresses, urls, the package <code>url</code>
is a better option than the <code>\verb</code> command, since
it allows line breaks.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="416"><r>package</r>, <code>listings</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="417"><code>listings</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="418"><r>package</r>, <code>minted</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="419"><code>minted</code> <r>package</r></indexterm></cindex>

<para>For computer code there are many packages with advantages over
<code>\verb</code>.  One is <code>listings</code>, another is <code>minted</code>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="420"><r>package</r>, <code>cprotect</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="421"><code>cprotect</code> <r>package</r></indexterm></cindex>

<para>You cannot use <code>\verb</code> in the argument to a macro, for instance in
the argument to a <code>\section</code>.  It is not a question of <code>\verb</code>
being fragile (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>), instead it just cannot work, as the
<code>\verb</code> command changes the catcode regime before reading its
argument, and restore it immediately afterward, nevertheless with a
macro argument the content of the argument has already be converted to a
token list along the catcode regime in effect when the macro was called.
However, the <code>cprotect</code> package can help with this.
</para>

</subsection>
</section>
<node name="verse" spaces=" "><nodename>verse</nodename><nodeprev automatic="on">verbatim</nodeprev><nodeup automatic="on">Environments</nodeup></node>
<section spaces=" "><sectiontitle><code>verse</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="482" mergedindex="cp"><r>environment</r>, <code>verse</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="483" mergedindex="cp"><code>verse</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="422">poetry, an environment for</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;verse&rbrace;
  <var>line1</var> \\
  <var>line2</var> \\
  ...
\end&lbrace;verse&rbrace;
</pre></example>

<para>An environment for poetry.
</para>
<para>Here are two lines from Shakespeare&textrsquo;s Romeo and Juliet.
</para>
<example endspaces=" ">
<pre xml:space="preserve">Then plainly know my heart's dear love is set \\
On the fair daughter of rich Capulet.
</pre></example>

<findex index="fn" spaces=" "><indexterm index="fn" number="484" mergedindex="cp">\\ <r>for <code>verse</code></r></indexterm></findex>
<para>Separate the lines of each stanza with <code>\\</code>, and use one or more
blank lines to separate the stanzas.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;verse&rbrace;
\makebox[\linewidth][c]&lbrace;\textit&lbrace;Shut Not Your Doors&rbrace; ---Walt Whitman&rbrace;
  \\[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&lbrace;verse&rbrace;
</pre></example>

<noindent></noindent>
<para>The output has margins indented on the left and the right, paragraphs
are not indented, and the text is not right-justified.
</para>

</section>
</chapter>
<node name="Line-breaking" spaces=" "><nodename>Line breaking</nodename><nodenext automatic="on">Page breaking</nodenext><nodeprev automatic="on">Environments</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Line breaking</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="423">line breaking</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="424">breaking lines</indexterm></cindex>

<para>The first thing &latex; does when processing ordinary text is to
translate your input file into a sequence of glyphs and spaces.  To
produce a printed document, this sequence must be broken into lines
(and these lines must be broken into pages).
</para>
<para>&latex; usually does the line (and page) breaking in the text body for
you but in some environments you manually force line breaks.
</para>
<para>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.
<!-- c Alernative text proposed here: https://tug.org/pipermail/latexrefman/2021q3/000803.html -->
<!-- c this text is that of the French version. -->
<ignore>
A common workflow with LaTeX is to get a final version of the document
content before taking a final pass through and considering line breaks
(and page breaks). Most people do not consider LaTeX as a word
processor, because it does not show the output instantly. However
differing the output encourages the user to put off until the end
formatting adjustments, and thus it prevents a lot of fiddling with
breaks that will change anyway.
@noindent
Differing the output has other advantages: it enables to make no
compromise about the typesetting, which ensures that what you see it
exactly what you get, and it also helps authors concentrate their mind
on either writing or reading rather than distract it by doing both a the
same time.
</ignore>
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::                         ">\\</menunode><menudescription><pre xml:space="preserve">Start a new line.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::       ">\obeycr &amp; \restorecr</menunode><menudescription><pre xml:space="preserve">Make each input line start a new output line.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                   ">\newline</menunode><menudescription><pre xml:space="preserve">Break the line
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::           ">\- (hyphenation)</menunode><menudescription><pre xml:space="preserve">Insert explicit hyphenation.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::             ">\discretionary</menunode><menudescription><pre xml:space="preserve">Explicit control of the hyphen character.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::           ">\fussy &amp; \sloppy</menunode><menudescription><pre xml:space="preserve">Be more or less particular with line breaking.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::               ">\hyphenation</menunode><menudescription><pre xml:space="preserve">Tell &latex; how to hyphenate a word.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::  ">\linebreak &amp; \nolinebreak</menunode><menudescription><pre xml:space="preserve">Forcing &amp; avoiding line breaks.
</pre></menudescription></menuentry></menu>


<node name="_005c_005c" spaces=" "><nodename>\\</nodename><nodenext automatic="on">\obeycr &amp; \restorecr</nodenext><nodeup automatic="on">Line breaking</nodeup></node>
<section spaces=" "><sectiontitle><code>\\</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="485" mergedindex="cp">\\ <r>force line break</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="425">new line, starting</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="426">line break, forcing</indexterm></cindex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\\
\\[<var>morespace</var>]
</pre></example>

<noindent></noindent>
<para>or one of: 
</para>
<example endspaces=" ">
<pre xml:space="preserve">\\*
\\*[<var>morespace</var>]
</pre></example>

<para>End the current line.  The optional argument <var>morespace</var> specifies
extra vertical space to be inserted before the next line.  This is a
rubber length (<pxref label="Lengths"><xrefnodename>Lengths</xrefnodename></pxref>) 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 label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<example endspaces=" ">
<pre xml:space="preserve">\title&lbrace;My story: \\[0.25in]
       a tale of woe&rbrace;
</pre></example>

<noindent></noindent>
<para>The starred form, <code>\\*</code>, tells &latex; not to start a new page
between the two lines, by issuing a <code>\nobreak</code>.
</para>
<para>Explicit line breaks in the main text body are unusual in &latex;.  In
particular, don&textrsquo;t start new paragraphs with <code>\\</code>.  Instead leave a
blank line between the two paragraphs.  And don&textrsquo;t put in a sequence of
<code>\\</code>&textrsquo;s to make vertical space. Instead use
<code>\vspace&lbrace;<var>length</var>&rbrace;</code>, or
<code>\leavevmode\vspace&lbrace;<var>length</var>&rbrace;</code>, or
<code>\vspace*&lbrace;<var>length</var>&rbrace;</code> if you want the space to not be thrown
out at the top of a new page (<pxref label="_005cvspace"><xrefnodename>\vspace</xrefnodename></pxref>).
</para>
<para>The <code>\\</code> command is mostly used outside of the main flow of text
such as in a <code>tabular</code> or <code>array</code> environment or in an
equation environment.
</para>
<para>The <code>\\</code> command is a synonym for <code>\newline</code>
(<pxref label="_005cnewline"><xrefnodename>\newline</xrefnodename></pxref>) under ordinary circumstances (an example of an
exception is the <code>p&lbrace;...&rbrace;</code> column in a <code>tabular</code>
environment; <pxref label="tabular"><xrefnodename>tabular</xrefnodename></pxref>).
</para>
<!-- c credit: David Carlisle https://tex.stackexchange.com/a/82666 -->
<para>The <code>\\</code> command is a macro, and its definition changes by context
so that its definition in normal text, a <code>center</code> environment, a
<code>flushleft</code> environment, and a <code>tabular</code> are all different.
In normal text when it forces a linebreak it is essentially a shorthand
for <code>\newline</code>.  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.
</para>
<para>You get <samp>LaTeX Error: There's no line here to end</samp> if you use
<code>\\</code> to ask for a new line, rather than to end the current line.
An example is if you have <code>\begin&lbrace;document&rbrace;\\</code> or, more likely,
something like this.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;center&rbrace;
  \begin&lbrace;minipage&rbrace;&lbrace;0.5\textwidth&rbrace;
  \\
  In that vertical space put your mark.
  \end&lbrace;minipage&rbrace;
\end&lbrace;center&rbrace;
</pre></example>

<noindent></noindent>
<para>Fix it by replacing the double backslash with something like
<code>\vspace&lbrace;\baselineskip&rbrace;</code>.
</para>

</section>
<node name="_005cobeycr-_0026-_005crestorecr" spaces=" "><nodename>\obeycr &amp; \restorecr</nodename><nodenext automatic="on">\newline</nodenext><nodeprev automatic="on">\\</nodeprev><nodeup automatic="on">Line breaking</nodeup></node>
<section spaces=" "><sectiontitle><code>\obeycr</code> &amp; <code>\restorecr</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="486" mergedindex="cp">\obeycr</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="487" mergedindex="cp">\restorecr</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="427">new line, output as input</indexterm></cindex>

<para>The <code>\obeycr</code> command makes a return in the input file (<samp>^^M</samp>,
internally) the same as <code>\\</code>, followed by <code>\relax</code>.  So each
new line in the input will also be a new line in the output.  The
<code>\restorecr</code> command restores normal line-breaking behavior.
</para>
<para>This is not the way to show verbatim text or computer code.  Use
<code>verbatim</code> (<pxref label="verbatim"><xrefnodename>verbatim</xrefnodename></pxref>) instead.
</para>
<para>With &latex;&textrsquo;s usual defaults, this
</para>
<example endspaces=" ">
<pre xml:space="preserve">aaa
bbb

\obeycr
ccc
ddd
   eee

\restorecr
fff
ggg

hhh
iii
</pre></example>

<noindent></noindent>
<para>produces output like this.
</para>
<example endspaces=" ">
<pre xml:space="preserve">  aaa bbb
  ccc
ddd
eee

fff ggg
  hhh iii
</pre></example>

<noindent></noindent>
<para>The indents are paragraph indents.
</para>

</section>
<node name="_005cnewline" spaces=" "><nodename>\newline</nodename><nodenext automatic="on">\- (hyphenation)</nodenext><nodeprev automatic="on">\obeycr &amp; \restorecr</nodeprev><nodeup automatic="on">Line breaking</nodeup></node>
<section spaces=" "><sectiontitle><code>\newline</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="488" mergedindex="cp">\newline</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="428">new line, starting (paragraph mode)</indexterm></cindex>

<para>In ordinary text, this ends a line in a way that does not right-justify
it, so the text before the end of line is not stretched. That is, in
paragraph mode (<pxref label="Modes"><xrefnodename>Modes</xrefnodename></pxref>), the <code>\newline</code> command is
equivalent to double-backslash (<pxref label="_005c_005c"><xrefnodename>\\</xrefnodename></pxref>).  This command is fragile
(<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>However, the two commands are different inside a <code>tabular</code> or
<code>array</code> environment. In a column with a specifier producing a
paragraph box such as typically <code>p&lbrace;...&rbrace;</code>, <code>\newline</code> 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>\\</code> or its
equivalent <code>\tabularnewline</code>.
</para>
<para>This will print <samp>Name:</samp> and <samp>Address:</samp> as two lines in a
single cell of the table.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;tabular&rbrace;&lbrace;p&lbrace;1in&rbrace;&arobase;&lbrace;\hspace&lbrace;2in&rbrace;&rbrace;p&lbrace;1in&rbrace;&rbrace;
  Name: \newline Address: &amp;Date: \\ \hline
\end&lbrace;tabular&rbrace;
</pre></example>

<noindent></noindent>
<para>The <samp>Date:</samp> will be baseline-aligned with <samp>Name:</samp>.
</para>

</section>
<node name="_005c_002d-_0028hyphenation_0029" spaces=" "><nodename>\- (hyphenation)</nodename><nodenext automatic="on">\discretionary</nodenext><nodeprev automatic="on">\newline</nodeprev><nodeup automatic="on">Line breaking</nodeup></node>
<section spaces=" "><sectiontitle><code>\-</code> (discretionary hyphen)</sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="489" mergedindex="cp">\- <r>(hyphenation)</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="429">hyphenation, forcing</indexterm></cindex>

<para>Tell &latex; that it may hyphenate the word at that point.  When you
insert <code>\-</code> commands in a word, the word will only be hyphenated at
those points and not at any of the other hyphenation points that
&latex; might otherwise have chosen.  This command is robust
(<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>&latex; is good at hyphenating and usually finds most of the correct
hyphenation points, while almost never using an incorrect one.  The
<code>\-</code> command is for exceptional cases.
</para>
<para>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.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;tabular&rbrace;&lbrace;rp&lbrace;1.75in&rbrace;&rbrace;
  Isaac Asimov &amp;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&lbrace;tabular&rbrace;
</pre></example>

<noindent></noindent>
<para>Commenting out the third line and uncommenting the fourth makes a much
better fit.
</para>
<para>The <code>\-</code> command only allows &latex; to break there, it does not
require that it break there.  You can force a split with something like
<code>Hef-\linebreak feron</code>.  Of course, if you later change the text
then this forced break may look very odd, so this approach requires
care.
</para>

</section>
<node name="_005cdiscretionary" spaces=" "><nodename>\discretionary</nodename><nodenext automatic="on">\fussy &amp; \sloppy</nodenext><nodeprev automatic="on">\- (hyphenation)</nodeprev><nodeup automatic="on">Line breaking</nodeup></node>
<section spaces=" "><sectiontitle><code>\discretionary</code> (generalized hyphenation point)</sectiontitle>
<cindex index="cp" spaces=" "><indexterm index="cp" number="430">hyphenation, discretionary</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="431">discretionary hyphenation</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\discretionary&lbrace;<var>pre-break</var>&rbrace;&lbrace;<var>post-break</var>&rbrace;&lbrace;<var>no-break</var>&rbrace;
</pre></example>

<para>Handle word changes around hyphens.  This command is not often used in
&latex; documents.
</para>
<para>If a line break occurs at the point where <code>\discretionary</code> appears
then &tex; puts <var>pre-break</var> at the end of the current line and puts
<var>post-break</var> at the start of the next line.  If there is no line
break here then &tex; puts <var>no-break</var>.
</para>
<para>In <samp>difficult</samp> the three letters <code>ffi</code> form a ligature.  But
&tex; can nonetheless break between the two <samp>f</samp>&textrsquo;s with this.
</para>
<example endspaces=" ">
<pre xml:space="preserve">di\discretionary&lbrace;f-&rbrace;&lbrace;fi&rbrace;&lbrace;ffi&rbrace;cult
</pre></example>

<para>Note that users do not have to do this.  It is typically handled
automatically by &tex;&textrsquo;s hyphenation algorithm.
</para>
<!-- c xxx TODO, complete this node, see LaTeX-fr (copied & pasted below, -->
<!-- c with accented letter escaped) -->

<ignore>
@c Les arguments de @code{\discretionary} ne peuvent contenir que des
@c caract@`eres, des bo@^{@dotless{i}}tes ou des cr@'enages.
@c 
@c La commande @code{\discretionary} permet de contr@^oler
@c finement la c@'esure dans les cas o@`u ne suffisent ni le contr@^ole standard
@c de la c@'esure fait l'algorithme de c@'esure de @TeX{} et les r@`egles de
@c c@'esures donn@'ees par les paquetages de gestion linguistiques, ni les
@c moyens de contr@^ole explicites offerts par les commandes
@c @code{\hyphenation} (@pxref{\hyphenation}) et @code{\-} (@pxref{\-
@c (hyphenation),\- (c@'esure @`a gr@'e)}).
@c 
@c L'usage typique de @code{\discretionary} est par exemple de contr@^oler la
@c c@'esure au sein d'une formule math@'ematique en mode ligne (voir aussi
@c @ref{Math miscellany,Miscellan@'ees math@'ematique (entr@'ee \*)}). Ci-dessous
@c un exemple de contr@^ole de la c@'esure au sein d'une adresse r@'eticulaire,
@c o@`u l'on autorise la c@'esure sur les obliques mais en utilisant une
@c contr'oblique violette en lieu de trait d'union@tie{}:
@c 
@c @example
@c \documentclass@{article@}
@c \usepackage[T1]@{fontenc@}
@c \usepackage[utf8]@{inputenc@}
@c \usepackage@{xcolor@}
@c \usepackage@{hyperref@}
@c \usepackage@{french@}
@c \newcommand*\DiscrSlash@{\discretionary@{\mbox@{\textcolor
@c  @{purple@}@{\textbackslash@}@}@}@{/@}@{/@}@}
@c \begin@{document@}
@c Allez donc @`a \href@{http://une/tr\%c3\%A8s/tr\%c3\%A8s/longue%
@c   /mais/vraiment/tr\%c3\%A8s/longue/adresse/r\%C3\%A9ticulaire%
@c   /index.html@}@{http://une\DiscrSlash tr@`es\DiscrSlash tr@`es\DiscrSlash
@c   longue\DiscrSlash mais\DiscrSlash vraiment\DiscrSlash
@c   tr@`es\DiscrSlash longue\DiscrSlash adresse\DiscrSlash
@c   r@'eticulaire\DiscrSlash index.html@}
@c \end@{document@}
@c @end example
</ignore>

</section>
<node name="_005cfussy-_0026-_005csloppy" spaces=" "><nodename>\fussy &amp; \sloppy</nodename><nodenext automatic="on">\hyphenation</nodenext><nodeprev automatic="on">\discretionary</nodeprev><nodeup automatic="on">Line breaking</nodeup></node>
<section spaces=" "><sectiontitle><code>\fussy</code> &amp; <code>\sloppy</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="490" mergedindex="cp">\fussy</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="491" mergedindex="cp">\sloppy</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="432">line breaks, changing</indexterm></cindex>

<para>Declarations to make &tex; more picky or less picky about line
breaking.  Declaring <code>\fussy</code> usually avoids too much space between
words, at the cost of an occasional overfull box.  Conversely,
<code>\sloppy</code> avoids overfull boxes while suffering loose interword
spacing.
</para>
<para>The default is <code>\fussy</code>.  Line breaking in a paragraph is
controlled by whichever declaration is current at the end of the
paragraph, i.e., at the blank line or <code>\par</code> or displayed
equation ending that paragraph.  So to affect the line breaks, include
that paragraph-ending material in the scope of the command.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::          ">sloppypar</menunode><menudescription><pre xml:space="preserve">Environment version of \sloppy command.
</pre></menudescription></menuentry></menu>


<node name="sloppypar" spaces=" "><nodename>sloppypar</nodename><nodeup automatic="on">\fussy &amp; \sloppy</nodeup></node>
<subsection spaces=" "><sectiontitle><code>sloppypar</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="492" mergedindex="cp"><r>environment</r>, <code>sloppypar</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="493" mergedindex="cp"><code>sloppypar</code> <r>environment</r></indexterm></findex>
        
<cindex index="cp" spaces=" "><indexterm index="cp" number="433">sloppypar environment</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;sloppypar&rbrace;
  ... paragraphs ...
\end&lbrace;sloppypar&rbrace;
</pre></example>

<para>Typeset the paragraphs with <code>\sloppy</code> in effect (<pxref label="_005cfussy-_0026-_005csloppy"><xrefnodename>\fussy &amp;
\sloppy</xrefnodename></pxref>).  Use this to locally adjust line breaking, to avoid
<samp>Overfull box</samp> or <samp>Underfull box</samp> errors.
</para>
<para>The example is simple.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;sloppypar&rbrace;
  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&lbrace;sloppypar&rbrace;
</pre></example>


</subsection>
</section>
<node name="_005chyphenation" spaces=" "><nodename>\hyphenation</nodename><nodenext automatic="on">\linebreak &amp; \nolinebreak</nodenext><nodeprev automatic="on">\fussy &amp; \sloppy</nodeprev><nodeup automatic="on">Line breaking</nodeup></node>
<section spaces=" "><sectiontitle><code>\hyphenation</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="494" mergedindex="cp">\hyphenation</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="434">hyphenation, defining</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\hyphenation&lbrace;<var>word1</var> ...&rbrace;
</pre></example>

<para>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>-</code>.
</para>
<para>Here is an example:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\hyphenation&lbrace;hat-er il-lit-e-ra-ti tru-th-i-ness&rbrace;
</pre></example>

<para>Use lowercase letters.  &tex; will only hyphenate if the word matches
exactly, no inflections are tried.  Multiple <code>\hyphenation</code>
commands accumulate.
</para>
<!-- c xx Re-align on LaTeX-fr which also mentions fontenc, and that -->
<!-- c babel/polyglossia already load hyphenation patterns, and you have to -->
<!-- c declare only non existing words. -->


</section>
<node name="_005clinebreak-_0026-_005cnolinebreak" spaces=" "><nodename>\linebreak &amp; \nolinebreak</nodename><nodeprev automatic="on">\hyphenation</nodeprev><nodeup automatic="on">Line breaking</nodeup></node>
<section spaces=" "><sectiontitle><code>\linebreak</code> &amp; <code>\nolinebreak</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="495" mergedindex="cp">\linebreak</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="496" mergedindex="cp">\nolinebreak</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="435">line breaks, forcing</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="436">line breaks, preventing</indexterm></cindex>

<para>Synopses, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\linebreak
\linebreak[<var>zero-to-four</var>]
</pre></example>

<noindent></noindent>
<para>or one of these.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\nolinebreak
\nolinebreak[<var>zero-to-four</var>]
</pre></example>

<para>Encourage or discourage a line break.  The optional <var>zero-to-four</var>
is an integer lying between 0 and 4 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]</code> is a suggestion that another place may be better.
The higher the number, the more insistent the request.  Both commands
are fragile (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>Here we tell &latex; that a good place to put a linebreak is after the
standard legal text.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\boilerplatelegal&lbrace;&rbrace; \linebreak[2]
We especially encourage applications from members of traditionally
underrepresented groups.
</pre></example>

<para>When you issue <code>\linebreak</code>, the spaces in the line are stretched
out so that the break point reaches the right margin.  <xref label="_005c_005c"><xrefnodename>\\</xrefnodename></xref>
and&nbsp;<ref label="_005cnewline"><xrefnodename>\newline</xrefnodename></ref>, to have the spaces not stretched out.
</para>

</section>
</chapter>
<node name="Page-breaking" spaces=" "><nodename>Page breaking</nodename><nodenext automatic="on">Footnotes</nodenext><nodeprev automatic="on">Line breaking</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Page breaking</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="437">page breaking</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="438">breaking pages</indexterm></cindex>

<para>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.
</para>
<!-- c credit: H Vogt https://tex.stackexchange.com/a/115563 -->
<para>&latex;&textrsquo;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.
</para>
<para>But &latex; does not optimize over the entire document&textrsquo;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&textrsquo;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.
</para>
<para><xref label="Layout"><xrefnodename>Layout</xrefnodename></xref>, for more material that is relevant to page breaking.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::   ">\clearpage &amp; \cleardoublepage</menunode><menudescription><pre xml:space="preserve">Start a new page; eject floats.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                        ">\newpage</menunode><menudescription><pre xml:space="preserve">Start a new page.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                ">\enlargethispage</menunode><menudescription><pre xml:space="preserve">Enlarge the current page a bit.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::       ">\pagebreak &amp; \nopagebreak</menunode><menudescription><pre xml:space="preserve">Forcing &amp; avoiding page breaks.
</pre></menudescription></menuentry></menu>


<node name="_005cclearpage-_0026-_005ccleardoublepage" spaces=" "><nodename>\clearpage &amp; \cleardoublepage</nodename><nodenext automatic="on">\newpage</nodenext><nodeup automatic="on">Page breaking</nodeup></node>
<section spaces=" "><sectiontitle><code>\clearpage</code> &amp; <code>\cleardoublepage</code> </sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="497" mergedindex="cp">\clearpage</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="439">flushing floats and starting a page</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="440">starting a new page and clearing floats</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="498" mergedindex="cp">\cleardoublepage</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="441">starting on a right-hand page</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\clearpage
</pre></example>

<noindent></noindent>
<para>or
</para>
<example endspaces=" ">
<pre xml:space="preserve">\cleardoublepage
</pre></example>

<para>End the current page and output all of the pending floating figures and
tables (<pxref label="Floats"><xrefnodename>Floats</xrefnodename></pxref>).  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</code> also makes the next page of
content a right-hand page, an odd-numbered page, if necessary inserting
a blank page.  The <code>\clearpage</code> command is robust while
<code>\cleardoublepage</code> is fragile (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>&latex;&textrsquo;s page breaks are optimized so ordinarily you only use this
command in a document body to polish the final version, or inside
commands.
</para>
<!-- c credit: https://www.tex.ac.uk/FAQ-reallyblank.html -->
<para>The <code>\cleardoublepage</code> 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.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\let\origdoublepage\cleardoublepage
\newcommand&lbrace;\clearemptydoublepage&rbrace;&lbrace;%
  \clearpage
  &lbrace;\pagestyle&lbrace;empty&rbrace;\origdoublepage&rbrace;%
&rbrace;
</pre></example>

<noindent></noindent>
<para>If you want &latex;&textrsquo;s standard <code>\chapter</code> command to do this then
add the line <code>\let\cleardoublepage\clearemptydoublepage</code>.
</para>
<para>The command <code>\newpage</code> (<pxref label="_005cnewpage"><xrefnodename>\newpage</xrefnodename></pxref>) also ends the current
page, but without clearing pending floats.  And, if &latex; is in
two-column mode then <code>\newpage</code> ends the current column while
<code>\clearpage</code> and <code>\cleardoublepage</code> end the current page.
</para>


</section>
<node name="_005cnewpage" spaces=" "><nodename>\newpage</nodename><nodenext automatic="on">\enlargethispage</nodenext><nodeprev automatic="on">\clearpage &amp; \cleardoublepage</nodeprev><nodeup automatic="on">Page breaking</nodeup></node>
<section spaces=" "><sectiontitle><code>\newpage</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="499" mergedindex="cp">\newpage</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="442">new page, starting</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="443">starting a new page</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newpage
</pre></example>

<para>End the current page.  This command is robust (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>&latex;&textrsquo;s page breaks are optimized so ordinarily you only use this
command in a document body to polish the final version, or inside
commands.
</para>
<para>While the commands <code>\clearpage</code> and <code>\cleardoublepage</code> also
end the current page, in addition they clear pending floats
(<pxref label="_005cclearpage-_0026-_005ccleardoublepage"><xrefnodename>\clearpage &amp; \cleardoublepage</xrefnodename></pxref>).  And, if &latex; is in
two-column mode then <code>\clearpage</code> and <code>\cleardoublepage</code> end
the current page, possibly leaving an empty column, while
<code>\newpage</code> only ends the current column.
</para>
<para>In contrast with <code>\pagebreak</code> (<pxref label="_005cpagebreak-_0026-_005cnopagebreak"><xrefnodename>\pagebreak &amp; \nopagebreak</xrefnodename></pxref>),
the <code>\newpage</code> command will cause the new page to start right where
requested.  This
</para>
<example endspaces=" ">
<pre xml:space="preserve">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.
</pre></example>

<noindent></noindent>
<para>makes a new page start after <samp>continent</samp>, and the cut-off line is
not right justified.  In addition, <code>\newpage</code> does not vertically
stretch out the page, as <code>\pagebreak</code> does.
</para>

</section>
<node name="_005cenlargethispage" spaces=" "><nodename>\enlargethispage</nodename><nodenext automatic="on">\pagebreak &amp; \nopagebreak</nodenext><nodeprev automatic="on">\newpage</nodeprev><nodeup automatic="on">Page breaking</nodeup></node>
<section spaces=" "><sectiontitle><code>\enlargethispage</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="500" mergedindex="cp">\enlargethispage</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="444">enlarge current page</indexterm></cindex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\enlargethispage&lbrace;size&rbrace;
\enlargethispage*&lbrace;size&rbrace;
</pre></example>

<para>Enlarge the <code>\textheight</code> for the current page.  The required
argument <var>size</var> must be a rigid length (<pxref label="Lengths"><xrefnodename>Lengths</xrefnodename></pxref>).  It may be
positive or negative.  This command is fragile (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>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.
</para>
<para>This will allow one extra line on the current page.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\enlargethispage&lbrace;\baselineskip&rbrace;
</pre></example>

<para>The starred form <code>\enlargesthispage*</code> 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</code>.
</para>

</section>
<node name="_005cpagebreak-_0026-_005cnopagebreak" spaces=" "><nodename>\pagebreak &amp; \nopagebreak</nodename><nodeprev automatic="on">\enlargethispage</nodeprev><nodeup automatic="on">Page breaking</nodeup></node>
<section spaces=" "><sectiontitle><code>\pagebreak</code> &amp; <code>\nopagebreak</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="501" mergedindex="cp">\pagebreak</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="502" mergedindex="cp">\nopagebreak</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="445">page break, forcing</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="446">page break, preventing</indexterm></cindex>

<para>Synopses:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\pagebreak
\pagebreak[<var>zero-to-four</var>]
</pre></example>

<noindent></noindent>
<para>or
</para>
<example endspaces=" ">
<pre xml:space="preserve">\nopagebreak
\nopagebreak[<var>zero-to-four</var>]
</pre></example>

<para>Encourage or discourage a page break.  The optional <var>zero-to-four</var>
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]</code> suggests to
&latex; that another spot might be preferable.  The higher the number,
the more insistent the request.  Both commands are fragile
(<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>&latex;&textrsquo;s page endings are optimized so ordinarily you only use this
command in a document body to polish the final version, or inside
commands.
</para>
<para>If you use these inside a paragraph, they apply to the point following
the line in which they appear.  So this
</para>
<example endspaces=" ">
<pre xml:space="preserve">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.
</pre></example>

<noindent></noindent>
<para>does not give a page break at <samp>continent</samp>, but instead at
<samp>nation</samp>, since that is where &latex; breaks that line.  In
addition, with <code>\pagebreak</code> 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</code> is in effect
this can cause you to get <samp>Underfull \vbox (badness 10000) has
occurred while \output is active</samp>.  <xref label="_005cnewpage"><xrefnodename>\newpage</xrefnodename></xref>, for a command that
does not have these effects.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="503" mergedindex="cp">\samepage</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="504" mergedindex="cp">samepage <r>environment</r></indexterm></findex>
<para>(There is an obsolete declaration <code>\samepage</code>, which tries to only
allow a break between two paragraphs.  There is a related environment
<code>samepage</code>, also obsolete.  Neither of these work reliably.  For
more on keeping material on the same page, see the FAQ entry
<url><urefurl>https://texfaq.org/FAQ-nopagebrk</urefurl></url>.)
</para>

</section>
</chapter>
<node name="Footnotes" spaces=" "><nodename>Footnotes</nodename><nodenext automatic="on">Definitions</nodenext><nodeprev automatic="on">Page breaking</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Footnotes</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="447">footnotes, creating</indexterm></cindex>

<para>Place a footnote at the bottom of the current page, as here.
</para>
<example endspaces=" ">
<pre xml:space="preserve">No<accent type="uml">e</accent>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&lbrace;%
  I wouldn't know, I don't read footnotes.&rbrace;
</pre></example>

<para>You can put multiple footnotes on a page. If the footnote text becomes
too long then it will flow to the next page.
</para>
<para>You can also produce footnotes by combining the <code>\footnotemark</code> and
the <code>\footnotetext</code> commands, which is useful in special
circumstances.
</para>
<para>To make bibliographic references come out as footnotes you need to
include a bibliographic style with that behavior (<pxref label="Using-BibTeX"><xrefnodename>Using BibTeX</xrefnodename></pxref>).
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::                ">\footnote</menunode><menudescription><pre xml:space="preserve">Insert a footnote.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::            ">\footnotemark</menunode><menudescription><pre xml:space="preserve">Insert footnote mark only.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::            ">\footnotetext</menunode><menudescription><pre xml:space="preserve">Insert footnote text only.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::     ">Footnotes in section headings</menunode><menudescription><pre xml:space="preserve">Chapter or section titles.  
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::     ">Footnotes in a table</menunode><menudescription><pre xml:space="preserve">Table footnotes.  
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::   ">Footnotes of footnotes</menunode><menudescription><pre xml:space="preserve">Multiple classes of footnotes.  
</pre></menudescription></menuentry></menu>


<node name="_005cfootnote" spaces=" "><nodename>\footnote</nodename><nodenext automatic="on">\footnotemark</nodenext><nodeup automatic="on">Footnotes</nodeup></node>
<section spaces=" "><sectiontitle><code>\footnote</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="505" mergedindex="cp">\footnote</indexterm></findex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\footnote&lbrace;<var>text</var>&rbrace;
\footnote[<var>number</var>]&lbrace;<var>text</var>&rbrace;
</pre></example>

<para>Place a footnote <var>text</var> at the bottom of the current page.
</para>
<example endspaces=" ">
<pre xml:space="preserve">There are over a thousand footnotes in Gibbon's 
\textit&lbrace;Decline and Fall of the Roman Empire&rbrace;.\footnote&lbrace;%
  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.''&rbrace;
</pre></example>

<para>The optional argument <var>number</var> allows you to specify the number of
the footnote.  If you use this then &latex; does not increment the
<code>footnote</code> counter.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="448">footnotes, symbols instead of numbers</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="506" mergedindex="cp">\fnsymbol<r>, and footnotes</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="507" mergedindex="cp">\&arobase;fnsymbol</indexterm></findex>
<para>By default, &latex; uses arabic numbers as footnote markers.  Change
this with something like
<code>\renewcommand&lbrace;\thefootnote&rbrace;&lbrace;\fnsymbol&lbrace;footnote&rbrace;&rbrace;</code>, which
uses a sequence of symbols (<pxref label="_005calph-_005cAlph-_005carabic-_005croman-_005cRoman-_005cfnsymbol"><xrefnodename>\alph \Alph \arabic \roman \Roman
\fnsymbol</xrefnodename></pxref>).  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&lbrace;footnote&rbrace;&lbrace;0&rbrace;</code>.
</para>
<para>&latex; determines the spacing of footnotes with two parameters.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="449">footnote parameters</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="450">parameters, for footnotes</indexterm></cindex>

<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="508" mergedindex="cp">\footnoterule</indexterm>\footnoterule</itemformat></item>
</tableterm><tableitem><anchor name="footnote-footnoterule">footnote footnoterule</anchor>
<para>Produces the rule separating the main text on a page from the page&textrsquo;s
footnotes.  Default dimensions in the standard document classes (except
<code>slides</code>, where it does not appear) is: vertical thickness of
<code>0.4pt</code>, and horizontal size of <code>0.4\columnwidth</code> long.
Change the rule with something like this.
</para>
<!-- c Credit egreg: https://tex.stackexchange.com/a/21917 -->
<example endspaces=" ">
<pre xml:space="preserve">\renewcommand&lbrace;\footnoterule&rbrace;&lbrace;% Kerns avoid vertical space
  \kern -3pt                         % This -3 is negative
  \hrule width \textwidth height 1pt % of the sum of this 1
  \kern 2pt&rbrace;                         % and this 2
</pre></example>

</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="509" mergedindex="cp">\footnotesep</indexterm>\footnotesep</itemformat></item>
</tableterm><tableitem><anchor name="footnote-footnotesep">footnote footnotesep</anchor>
<cindex index="cp" spaces=" "><indexterm index="cp" number="451">strut</indexterm></cindex>
<para>The height of the strut placed at the beginning of the footnote
(<pxref label="_005cstrut"><xrefnodename>\strut</xrefnodename></pxref>).  By default, this is set to the normal strut for
<code>\footnotesize</code> fonts (<pxref label="Font-sizes"><xrefnodename>Font sizes</xrefnodename></pxref>), therefore there is no
extra space between footnotes.  This is <samp>6.65pt</samp> for <samp>10pt</samp>,
<samp>7.7pt</samp> for <samp>11pt</samp>, and <samp>8.4pt</samp> for <samp>12pt</samp>.  Change
it as with <code>\setlength&lbrace;\footnotesep&rbrace;&lbrace;11pt&rbrace;</code>.
</para>
</tableitem></tableentry></ftable>

<para>The <code>\footnote</code> command is fragile (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>&latex;&textrsquo;s default puts many restrictions on where you can use a
<code>\footnote</code>; for instance, you cannot use it in an argument to a
sectioning command such as <code>\chapter</code> (it can only be used in outer
paragraph mode; <pxref label="Modes"><xrefnodename>Modes</xrefnodename></pxref>).  There are some workarounds; see
following sections.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="452">footnotes, in a minipage</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="453">mpfootnote counter</indexterm></cindex>
<para>In a <code>minipage</code> environment the <code>\footnote</code> command uses the
<code>mpfootnote</code> counter instead of the <code>footnote</code> 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 label="minipage"><xrefnodename>minipage</xrefnodename></xref> and <ref label="Footnotes-in-a-table"><xrefnodename>Footnotes in a table</xrefnodename></ref>.
</para>

</section>
<node name="_005cfootnotemark" spaces=" "><nodename>\footnotemark</nodename><nodenext automatic="on">\footnotetext</nodenext><nodeprev automatic="on">\footnote</nodeprev><nodeup automatic="on">Footnotes</nodeup></node>
<section spaces=" "><sectiontitle><code>\footnotemark</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="510" mergedindex="cp">\footnotemark</indexterm></findex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\footnotemark
\footnotemark[<var>number</var>]
</pre></example>

<para>Put the current footnote mark in the text. To specify associated text
for the footnote see&nbsp;<ref label="_005cfootnotetext"><xrefnodename>\footnotetext</xrefnodename></ref>.  The optional argument
<var>number</var> causes the command to use that number to determine the
footnote mark. This command can be used in inner paragraph mode
(<pxref label="Modes"><xrefnodename>Modes</xrefnodename></pxref>).
</para>
<para>If you use <code>\footnotemark</code> without the optional argument then it
increments the <code>footnote</code> counter, but if you use the optional
<var>number</var> then it does not. The next example produces several
consecutive footnote markers referring to the same footnote.
</para>
<example endspaces=" ">
<pre xml:space="preserve">The first theorem\footnote&lbrace;Due to Gauss.&rbrace; 
and the second theorem\footnotemark[\value&lbrace;footnote&rbrace;] 
and the third theorem.\footnotemark[\value&lbrace;footnote&rbrace;]
</pre></example>

<para>If there are intervening footnotes then you must remember the value of
the number of the common mark.  This example gives the same
institutional affiliation to both the first and third authors
(<code>\thanks</code> is a version of <code>\footnote</code>), by-hand giving the
number of the footnote.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\title&lbrace;A Treatise on the Binomial Theorem&rbrace;
\author&lbrace;J Moriarty\thanks&lbrace;University of Leeds&rbrace; 
  \and A C Doyle\thanks&lbrace;Durham University&rbrace; 
  \and S Holmes\footnotemark[1]&rbrace;
\begin&lbrace;document&rbrace;
\maketitle
</pre></example> 

<para>This uses a counter to remember the footnote number.  The third sentence
is followed by the same footnote marker as the first.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcounter&lbrace;footnoteValueSaver&rbrace;
All babies are illogical.\footnote&lbrace;%
  Lewis Carroll.&rbrace;\setcounter&lbrace;footnoteValueSaver&rbrace;&lbrace;\value&lbrace;footnote&rbrace;&rbrace;
Nobody is despised who can manage a crocodile.\footnote&lbrace;%
  Captain Hook.&rbrace;
Illogical persons are despised.\footnotemark[\value&lbrace;footnoteValueSaver&rbrace;]
Therefore, anyone who can manage a crocodile is not a baby.
</pre></example>

<cindex index="cp" spaces=" "><indexterm index="cp" number="454"><r>package</r>, <code>cleveref</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="455"><code>cleveref</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="456"><r>package</r>, <code>hyperref</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="457"><code>hyperref</code> <r>package</r></indexterm></cindex>

<para>This example accomplishes the same by using the package <code>cleveref</code>.
</para>
<!-- c from SE user Jake http://tex.stackexchange.com/a/10116/339 -->
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;cleveref&rbrace;[2012/02/15]   % in preamble 
\crefformat&lbrace;footnote&rbrace;&lbrace;#2\footnotemark[#1]#3&rbrace;
...
The theorem is from Evers.\footnote&lbrace;\label&lbrace;fn:TE&rbrace;Tinker, Evers, 1994.&rbrace;
The corollary is from Chance.\footnote&lbrace;Evers, Chance, 1990.&rbrace;
But the key lemma is from Tinker.\cref&lbrace;fn:TE&rbrace;
</pre></example>

<cindex index="cp" spaces=" "><indexterm index="cp" number="458"><r>package</r>, <code>hyperref</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="459"><code>hyperref</code> <r>package</r></indexterm></cindex>

<para>It will work with the package <code>hyperref</code>.
</para>

</section>
<node name="_005cfootnotetext" spaces=" "><nodename>\footnotetext</nodename><nodenext automatic="on">Footnotes in section headings</nodenext><nodeprev automatic="on">\footnotemark</nodeprev><nodeup automatic="on">Footnotes</nodeup></node>
<section spaces=" "><sectiontitle><code>\footnotetext</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="511" mergedindex="cp">\footnotetext</indexterm></findex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\footnotetext&lbrace;<var>text</var>&rbrace;
\footnotetext[<var>number</var>]&lbrace;<var>text</var>&rbrace;
</pre></example>

<para>Place <var>text</var> at the bottom of the page as a footnote.  It pairs with
<code>\footnotemark</code> (<pxref label="_005cfootnotemark"><xrefnodename>\footnotemark</xrefnodename></pxref>) and can come anywhere after
that command, but must appear in outer paragraph mode (<pxref label="Modes"><xrefnodename>Modes</xrefnodename></pxref>).
The optional argument <var>number</var> changes the number of the footnote
mark.
</para>
<para><xref label="_005cfootnotemark"><xrefnodename>\footnotemark</xrefnodename></xref> and&nbsp;<ref label="Footnotes-in-a-table"><xrefnodename>Footnotes in a table</xrefnodename></ref>, for usage
examples.
</para>

</section>
<node name="Footnotes-in-section-headings" spaces=" "><nodename>Footnotes in section headings</nodename><nodenext automatic="on">Footnotes in a table</nodenext><nodeprev automatic="on">\footnotetext</nodeprev><nodeup automatic="on">Footnotes</nodeup></node>
<section spaces=" "><sectiontitle>Footnotes in section headings</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="460">footnote, in section headings</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="461">table of contents, avoiding footnotes</indexterm></cindex>

<para>Putting a footnote in a section heading, as in:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\section&lbrace;Full sets\protect\footnote&lbrace;This material due to ...&rbrace;&rbrace;
</pre></example>

<noindent></noindent>
<para>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</code>
</para>
<example endspaces=" ">
<pre xml:space="preserve">\section[Please]&lbrace;Please\footnote&lbrace;%
  Don't footnote in chapter and section headers!&rbrace;&rbrace;
</pre></example>

<noindent></noindent>
<para>No <code>\protect</code> is needed in front of <code>\footnote</code> here because
what gets moved to the table of contents is the optional argument.
</para>

</section>
<node name="Footnotes-in-a-table" spaces=" "><nodename>Footnotes in a table</nodename><nodenext automatic="on">Footnotes of footnotes</nodenext><nodeprev automatic="on">Footnotes in section headings</nodeprev><nodeup automatic="on">Footnotes</nodeup></node>
<section spaces=" "><sectiontitle>Footnotes in a table</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="462">footnote, in a table</indexterm></cindex>

<para>Inside a <code>tabular</code> or <code>array</code> environment the <code>\footnote</code>
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</code> environment as here (<pxref label="minipage"><xrefnodename>minipage</xrefnodename></pxref>).
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;center&rbrace;
  \begin&lbrace;minipage&rbrace;&lbrace;\textwidth&rbrace; \centering
     \begin&lbrace;tabular&rbrace;&lbrace;l|l&rbrace;
       \textsc&lbrace;Ship&rbrace;           &amp;\textsc&lbrace;Book&rbrace; \\ \hline 
       \textit&lbrace;HMS Sophie&rbrace;     &amp;Master and Commander  \\ 
       \textit&lbrace;HMS Polychrest&rbrace; &amp;Post Captain  \\  
       \textit&lbrace;HMS Lively&rbrace;     &amp;Post Captain \\
       \textit&lbrace;HMS Surprise&rbrace;   &amp;A number of books\footnote&lbrace;%
                                  Starting with \textit&lbrace;HMS Surprise&rbrace;.&rbrace;
     \end&lbrace;tabular&rbrace;
  \end&lbrace;minipage&rbrace;                              
\end&lbrace;center&rbrace;
</pre></example>

<para>Inside a <code>minipage</code>, footnote marks are lowercase letters.  Change
that with something like
<code>\renewcommand&lbrace;\thempfootnote&rbrace;&lbrace;\arabic&lbrace;mpfootnote&rbrace;&rbrace;</code>
(<pxref label="_005calph-_005cAlph-_005carabic-_005croman-_005cRoman-_005cfnsymbol"><xrefnodename>\alph \Alph \arabic \roman \Roman \fnsymbol</xrefnodename></pxref>).
</para>
<para>The footnotes in the prior example appear at the bottom of the
<code>minipage</code>.  To have them appear at the bottom of the main page, as
part of the regular footnote sequence, use the <code>\footnotemark</code> and
<code>\footnotetext</code> pair and make a new counter.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcounter&lbrace;mpFootnoteValueSaver&rbrace;
\begin&lbrace;center&rbrace;
  \begin&lbrace;minipage&rbrace;&lbrace;\textwidth&rbrace;
    \setcounter&lbrace;mpFootnoteValueSaver&rbrace;&lbrace;\value&lbrace;footnote&rbrace;&rbrace; \centering
     \begin&lbrace;tabular&rbrace;&lbrace;l|l&rbrace;
       \textsc&lbrace;Woman&rbrace;             &amp;\textsc&lbrace;Relationship&rbrace; \\ \hline 
       Mona                       &amp;Attached\footnotemark  \\ 
       Diana Villiers             &amp;Eventual wife  \\  
       Christine Hatherleigh Wood &amp;Fiance\footnotemark 
     \end&lbrace;tabular&rbrace;
  \end&lbrace;minipage&rbrace;%  percent sign keeps footnote text close to minipage
  \stepcounter&lbrace;mpFootnoteValueSaver&rbrace;%
    \footnotetext[\value&lbrace;mpFootnoteValueSaver&rbrace;]&lbrace;%
      Little is known other than her death.&rbrace;%
  \stepcounter&lbrace;mpFootnoteValueSaver&rbrace;%
    \footnotetext[\value&lbrace;mpFootnoteValueSaver&rbrace;]&lbrace;%
      Relationship is unresolved in XXI.&rbrace;
\end&lbrace;center&rbrace;
</pre></example>

<cindex index="cp" spaces=" "><indexterm index="cp" number="463"><r>package</r>, <code>tablefootnote</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="464"><code>tablefootnote</code> <r>package</r></indexterm></cindex>

<para>For a floating <code>table</code> environment (<pxref label="table"><xrefnodename>table</xrefnodename></pxref>), use the
<code>tablefootnote</code> package.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;tablefootnote&rbrace;  % in preamble
   ...
\begin&lbrace;table&rbrace;
  \centering
     \begin&lbrace;tabular&rbrace;&lbrace;l|l&rbrace;
     \textsc&lbrace;Date&rbrace;  &amp;\textsc&lbrace;Campaign&rbrace; \\ \hline 
     1862           &amp;Fort Donelson \\ 
     1863           &amp;Vicksburg     \\  
     1865           &amp;Army of Northern Virginia\tablefootnote&lbrace;%
                      Ending the war.&rbrace;
     \end&lbrace;tabular&rbrace;
    \caption&lbrace;Forces captured by US Grant&rbrace;
\end&lbrace;table&rbrace;
</pre></example>

<noindent></noindent>
<para>The footnote appears at the page bottom and is numbered in sequence with
other footnotes.
</para>

</section>
<node name="Footnotes-of-footnotes" spaces=" "><nodename>Footnotes of footnotes</nodename><nodeprev automatic="on">Footnotes in a table</nodeprev><nodeup automatic="on">Footnotes</nodeup></node>
<section spaces=" "><sectiontitle>Footnotes of footnotes</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="465">footnote, of a footnote</indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="466"><r>package</r>, <code>bigfoot</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="467"><code>bigfoot</code> <r>package</r></indexterm></cindex>

<para>Particularly in the humanities, authors can have multiple classes of
footnotes, including having footnotes of footnotes.  The package
<code>bigfoot</code> extends &latex;&textrsquo;s default footnote mechanism in many
ways, including allow these two, as in this example.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;bigfoot&rbrace;    % in preamble
\DeclareNewFootnote&lbrace;Default&rbrace;
\DeclareNewFootnote&lbrace;from&rbrace;[alph]   % create class \footnotefrom&lbrace;&rbrace;
 ...
The third theorem is a partial converse of the 
second.\footnotefrom&lbrace;%
  Noted in Wilson.\footnote&lbrace;Second edition only.&rbrace;&rbrace;
</pre></example>


</section>
</chapter>
<node name="Definitions" spaces=" "><nodename>Definitions</nodename><nodenext automatic="on">Counters</nodenext><nodeprev automatic="on">Footnotes</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Definitions</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="468">definitions</indexterm></cindex>

<para>&latex; has support for making new commands of many different kinds.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::    ">\newcommand &amp; \renewcommand</menunode><menudescription><pre xml:space="preserve">(Re)define a new command.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                ">\providecommand</menunode><menudescription><pre xml:space="preserve">Define a new command, if name not used.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::   ">\makeatletter &amp; \makeatother</menunode><menudescription><pre xml:space="preserve">Change the status of the at-sign character.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                      ">\&arobase;ifstar</menunode><menudescription><pre xml:space="preserve">Define your own commands with *-variants.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                    ">\newcounter</menunode><menudescription><pre xml:space="preserve">Define a new counter.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                     ">\newlength</menunode><menudescription><pre xml:space="preserve">Define a new length.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                    ">\newsavebox</menunode><menudescription><pre xml:space="preserve">Define a new box.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::   ">\newenvironment &amp; \renewenvironment</menunode><menudescription><pre xml:space="preserve">Define a new environment.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                    ">\newtheorem</menunode><menudescription><pre xml:space="preserve">Define a new theorem-like environment.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                       ">\newfont</menunode><menudescription><pre xml:space="preserve">Define a new font name.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                       ">\protect</menunode><menudescription><pre xml:space="preserve">Using tricky commands.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator=":: ">\ignorespaces &amp; \ignorespacesafterend</menunode><menudescription><pre xml:space="preserve">Discard extra spaces.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                 ">xspace package</menunode><menudescription><pre xml:space="preserve">Space after a macro, conditionally.
</pre></menudescription></menuentry></menu>


<node name="_005cnewcommand-_0026-_005crenewcommand" spaces=" "><nodename>\newcommand &amp; \renewcommand</nodename><nodenext automatic="on">\providecommand</nodenext><nodeup automatic="on">Definitions</nodeup></node>
<section spaces=" "><sectiontitle><code>\newcommand</code> &amp; <code>\renewcommand</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="512" mergedindex="cp">\newcommand</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="469">commands, defining new ones</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="470">commands, redefining</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="471">defining a new command</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="472">new commands, defining</indexterm></cindex>

<para>Synopses, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcommand&lbrace;\<var>cmd</var>&rbrace;&lbrace;<var>defn</var>&rbrace;
\newcommand&lbrace;\<var>cmd</var>&rbrace;[<var>nargs</var>]&lbrace;<var>defn</var>&rbrace;
\newcommand&lbrace;\<var>cmd</var>&rbrace;[<var>nargs</var>][<var>optargdefault</var>]&lbrace;<var>defn</var>&rbrace;
\newcommand*&lbrace;\<var>cmd</var>&rbrace;&lbrace;<var>defn</var>&rbrace;
\newcommand*&lbrace;\<var>cmd</var>&rbrace;[<var>nargs</var>]&lbrace;<var>defn</var>&rbrace;
\newcommand*&lbrace;\<var>cmd</var>&rbrace;[<var>nargs</var>][<var>optargdefault</var>]&lbrace;<var>defn</var>&rbrace;
</pre></example>

<noindent></noindent>
<para>or one of these.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\renewcommand&lbrace;\<var>cmd</var>&rbrace;[<var>nargs</var>]&lbrace;<var>defn</var>&rbrace;
\renewcommand&lbrace;\<var>cmd</var>&rbrace;[<var>nargs</var>]&lbrace;<var>defn</var>&rbrace;
\renewcommand&lbrace;\<var>cmd</var>&rbrace;[<var>nargs</var>][<var>optargdefault</var>]&lbrace;<var>defn</var>&rbrace;
\renewcommand*&lbrace;\<var>cmd</var>&rbrace;&lbrace;<var>defn</var>&rbrace;
\renewcommand*&lbrace;\<var>cmd</var>&rbrace;[<var>nargs</var>]&lbrace;<var>defn</var>&rbrace;
\renewcommand*&lbrace;\<var>cmd</var>&rbrace;[<var>nargs</var>][<var>optargdefault</var>]&lbrace;<var>defn</var>&rbrace;
</pre></example>

<para>Define or redefine a command (see also the discussion of
<code>\DeclareRobustCommand</code> in <ref label="Class-and-package-commands"><xrefnodename>Class and package commands</xrefnodename></ref>).
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="473">starred form, defining new commands</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="474">*-form, defining new commands</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="513" mergedindex="cp">\long</indexterm></findex>
<para>The starred form of these two forbids the arguments from containing
multiple paragraphs of text (in plain &tex; terms, the commands
are not <code>\long</code>).  With the default form, arguments can be
multiple paragraphs.
</para>
<para>These are the parameters:
</para>
<table commandarg="var" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="var">cmd</itemformat></item>
</tableterm><tableitem>
<para>Required; <code>\<var>cmd</var></code> is the command name.  It must begin with a backslash, <code>\</code>,
and must not begin with the four character string <code>\end</code>.  For
<code>\newcommand</code>, it must not be already defined.  For
<code>\renewcommand</code>, this name must already be defined.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">nargs</itemformat></item>
</tableterm><tableitem><para>Optional; an integer from 0 to 9, specifying the number of arguments
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.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">optargdefault</itemformat></item>
</tableterm><tableitem><para>Optional; if this argument is present then the first argument of
<code>\<var>cmd</var></code> is optional, with default value <var>optargdefault</var>
(which may be the empty string).  If <var>optargsdefault</var> is not present
then <code>\<var>cmd</var></code> does not take an optional argument.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="475">positional parameter</indexterm></cindex>
<para>That is, if <code>\<var>cmd</var></code> is used with square brackets, as in
<code>\<var>cmd</var>[<var>optval</var>]&lbrace;...&rbrace;...</code>, then within <var>defn</var> the
parameter&nbsp;<code>#1</code> is set to the value of <var>optval</var>.  On the
other hand, if <code>\<var>cmd</var></code> is called without the square brackets
then within <var>defn</var> the parameter <code>#1</code> is set to the value of
<var>optargdefault</var>.  In either case, the required arguments start with
<code>#2</code>.
</para>
<para>Omitting <code>[<var>optargdefault</var>]</code> is different from having the
square brackets with no contents, as in <code>[]</code>.  The former sets
<code>#1</code> to the value of <var>optargdefault</var>; the latter sets <code>#1</code>
to the empty string.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">defn</itemformat></item>
</tableterm><tableitem><para>Required; the text to be substituted for every occurrence of
<code>\<var>cmd</var></code>. The parameters <code>#1</code>, <code>#2</code>,
... <code>#<var>nargs</var></code> 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&textrsquo;t exercise the option).
</para>
</tableitem></tableentry></table>

<para>&tex; ignores blanks in the source following a control word
(<pxref label="Control-sequences"><xrefnodename>Control sequences</xrefnodename></pxref>), as in <samp>\cmd </samp>.  If you actually want a
space there, one solution is to type <code>&lbrace;&rbrace;</code> after the command
(<samp>\cmd&lbrace;&rbrace; </samp>, and another solution is to use an explicit control
space (<samp>\cmd\ </samp>).
</para>
<para>A simple example of defining a new command:
<code>\newcommand&lbrace;\RS&rbrace;&lbrace;Robin Smith&rbrace;</code> results in <code>\RS</code> being
replaced by the longer text.  Redefining an existing command is similar:
<code>\renewcommand&lbrace;\qedsymbol&rbrace;&lbrace;&lbrace;\small QED&rbrace;&rbrace;</code>.
</para>
<para>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</samp>.  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</samp>.
</para>
<para>Here the first definition creates a command with no arguments, and the
second, one with one required argument.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcommand&lbrace;\student&rbrace;&lbrace;Ms~O'Leary&rbrace;
\newcommand&lbrace;\defref&rbrace;[1]&lbrace;Definition~\ref&lbrace;#1&rbrace;&rbrace;
</pre></example>

<noindent></noindent>
<para>Use the first as in <code>I highly recommend \student&lbrace;&rbrace; to you</code>.  The
second has a variable argument, so that <code>\defref&lbrace;def:basis&rbrace;</code> expands to
<code>Definition~\ref&lbrace;def:basis&rbrace;</code>, which ultimately expands to
something like <samp>Definition~3.14</samp>.
</para>
<para>Similarly, but with two required arguments:
<code>\newcommand&lbrace;\nbym&rbrace;[2]&lbrace;$#1 \times #2$&rbrace;</code> is invoked as
<code>\nbym&lbrace;2&rbrace;&lbrace;k&rbrace;</code>.
</para>
<para>This example has an optional argument.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcommand&lbrace;\salutation&rbrace;[1][Sir or Madam]&lbrace;Dear #1:&rbrace;
</pre></example>

<noindent></noindent>
<para>Then <code>\salutation</code> gives <samp>Dear Sir or Madam:</samp> while
<code>\salutation[John]</code> gives <samp>Dear John:</samp>.  And
<code>\salutation[]</code> gives <samp>Dear :</samp>.
</para>
<para>This example has an optional argument and two required arguments.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcommand&lbrace;\lawyers&rbrace;[3][company]&lbrace;#2, #3, and~#1&rbrace;
I employ \lawyers[Howe]&lbrace;Dewey&rbrace;&lbrace;Cheatem&rbrace;.
</pre></example>

<noindent></noindent>
<para>The output is <samp>I employ Dewey, Cheatem, and Howe</samp>.  The optional
argument, the <code>Howe</code>, is associated with <code>#1</code>, while
<code>Dewey</code> and <code>Cheatem</code> are associated with <code>#2</code>
and&nbsp;<code>#3</code>.  Because of the optional argument,
<code>\lawyers&lbrace;Dewey&rbrace;&lbrace;Cheatem&rbrace;</code> will give the output <samp>I employ
Dewey, Cheatem, and company</samp>.
</para>
<para>The braces around <var>defn</var> do not define a group, that is, they do not
delimit the scope of the result of expanding <var>defn</var>.  For example,
with <code>\newcommand&lbrace;\shipname&rbrace;[1]&lbrace;\it #1&rbrace;</code>, in this sentence,
</para>
<example endspaces=" ">
<pre xml:space="preserve">The \shipname&lbrace;Monitor&rbrace; met the \shipname&lbrace;Merrimac&rbrace;.
</pre></example>

<noindent></noindent>
<para>the words <samp>met the</samp> would incorrectly be in italics.  The solution
is to put another pair of braces inside the definition:
<code>\newcommand&lbrace;\shipname&rbrace;[1]&lbrace;&lbrace;\it #1&rbrace;&rbrace;</code>.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator=":: ">Control sequences</menunode><menudescription><pre xml:space="preserve">Control sequence, control word and control symbol.
</pre></menudescription></menuentry></menu>

<node name="Control-sequences" spaces=" "><nodename>Control sequences</nodename><nodeup automatic="on">\newcommand &amp; \renewcommand</nodeup></node>
<subsection spaces=" "><sectiontitle>Control sequence, control word and control symbol</sectiontitle>

<para>When reading input &tex; converts the sequences of read characters into
a sequence of <dfn>tokens</dfn>. When &tex; sees a backslash <code>\</code>, it
will handle the following characters in a special way in order to make a
<dfn>control sequence</dfn> token.
</para>
<para>The control sequences fall into two categories:
</para>
<itemize commandarg="bullet" endspaces=" "><itemprepend>&bullet;</itemprepend>
<listitem><prepend>&bullet;</prepend>
<para><dfn>control word</dfn>, when the control sequence is gathered from a
<code>\</code> followed by at least one ASCII letter, followed by at least one
blank. The sequence of at least one ASCII letter is called the
<dfn>control sequence name</dfn>.
</para></listitem><listitem><prepend>&bullet;</prepend>
<para><dfn>control symbol</dfn>, when the control sequence is gathered from a
<code>\</code> followed by one non-letter character.
</para></listitem></itemize>

<para>Blanks after a control word are ignored and do not produce any
whitespace in the output (<pxref label="_005cnewcommand-_0026-_005crenewcommand"><xrefnodename>\newcommand &amp; \renewcommand</xrefnodename></pxref> and
<ref label="_005c_0028SPACE_0029"><xrefnodename>\(SPACE)</xrefnodename></ref>).
</para>
<para>Just as the <code>\relax</code> command does nothing, the following will print
<samp>Hello!</samp><inlinefmt><inlinefmtformat>tex</inlinefmtformat></inlinefmt><inlinefmt><inlinefmtformat>info</inlinefmtformat></inlinefmt>:
</para>
<example endspaces=" ">
<pre xml:space="preserve">Hel\relax<w> </w><w> </w><w> </w>
<w> </w><w> </w><w> </w>lo!
</pre></example>

<noindent></noindent>
<para>This is because blanks after <code>\relax</code>, including the newline are
ignored, and blanks at the beginning of a line are also ignored
(<pxref label="Leading-blanks"><xrefnodename>Leading blanks</xrefnodename></pxref>).
</para>
</subsection>
</section>
<node name="_005cprovidecommand" spaces=" "><nodename trailingspaces=" ">\providecommand</nodename><nodenext automatic="on">\makeatletter &amp; \makeatother</nodenext><nodeprev automatic="on">\newcommand &amp; \renewcommand</nodeprev><nodeup automatic="on">Definitions</nodeup></node>
<section spaces=" "><sectiontitle><code>\providecommand</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="514" mergedindex="cp">\providecommand</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="476">commands, defining new ones</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="477">defining a new command</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="478">new commands, defining</indexterm></cindex>

<para>Synopses, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\providecommand&lbrace;\<var>cmd</var>&rbrace;&lbrace;<var>defn</var>&rbrace;
\providecommand&lbrace;\<var>cmd</var>&rbrace;[<var>nargs</var>]&lbrace;<var>defn</var>&rbrace;
\providecommand&lbrace;\<var>cmd</var>&rbrace;[<var>nargs</var>][<var>optargdefault</var>]&lbrace;<var>defn</var>&rbrace;
\providecommand*&lbrace;\<var>cmd</var>&rbrace;&lbrace;<var>defn</var>&rbrace;
\providecommand*&lbrace;\<var>cmd</var>&rbrace;[<var>nargs</var>]&lbrace;<var>defn</var>&rbrace;
\providecommand*&lbrace;\<var>cmd</var>&rbrace;[<var>nargs</var>][<var>optargdefault</var>]&lbrace;<var>defn</var>&rbrace;
</pre></example>

<para>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</code>.  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 label="_005cnewcommand-_0026-_005crenewcommand"><xrefnodename>\newcommand &amp; \renewcommand</xrefnodename></xref>, for the description of the arguments.
</para>
<para>This example
</para>
<example endspaces=" ">
<pre xml:space="preserve">\providecommand&lbrace;\myaffiliation&rbrace;&lbrace;Saint Michael's College&rbrace;
\providecommand&lbrace;\myaffiliation&rbrace;&lbrace;Lyc\'ee Henri IV&rbrace;
From \myaffiliation.
</pre></example>

<noindent></noindent>
<para>outputs <samp>From Saint Michael's College</samp>.  Unlike <code>\newcommand</code>,
the repeated use of <code>\providecommand</code> does not give an error.
</para>

</section>
<node name="_005cmakeatletter-_0026-_005cmakeatother" spaces=" "><nodename>\makeatletter &amp; \makeatother</nodename><nodenext automatic="on">\&arobase;ifstar</nodenext><nodeprev automatic="on">\providecommand</nodeprev><nodeup automatic="on">Definitions</nodeup></node>
<section spaces=" "><sectiontitle><code>\makeatletter</code> &amp; <code>\makeatother</code></sectiontitle>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\makeatletter
  ... definition of commands with &arobase; in their name ..
\makeatother
</pre></example>

<para>Use this pair when you redefine &latex; commands that are named with an
at-sign character&nbsp;<samp><code>&arobase;</code></samp>.  The <code>\makeatletter</code>
declaration makes the at-sign character have the category code of a
letter, code&nbsp;11.  The <code>\makeatother</code> declaration sets the
category code of the at-sign to code&nbsp;12, its default value.
</para>
<para>As &tex; reads characters, it assigns each one a category code, or
<cindex index="cp" spaces=" "><indexterm index="cp" number="479">catcode</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="480">character category code</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="481">category code, character</indexterm></cindex>
<dfn>catcode</dfn>. For instance, it assigns the backslash
character&nbsp;<samp><code>\</code></samp> the catcode&nbsp;0.  Command names
consist of a category&nbsp;0 character, ordinarily backslash, followed
by letters, category&nbsp;11 characters (except that a command name can
also consist of a category&nbsp;0 character followed by a single
non-letter symbol).
</para>
<para>&latex;&textrsquo;s source code has the convention that some commands use
<code>&arobase;</code> in their name.  These commands are mainly intended for package
or class writers.  The convention prevents authors who are just using a
package or class from accidentally replacing such a command with one of
their own, because by default the at-sign has catcode&nbsp;12.
</para>
<para>Use the pair <code>\makeatletter</code> and <code>\makeatother</code> inside a
<file>.tex</file> file, typically in the preamble, when you are defining or
redefining commands named with <code>&arobase;</code>, by having them surround your
definition.  Don&textrsquo;t use these inside <file>.sty</file> or <file>.cls</file> files
since the <code>\usepackage</code> and <code>\documentclass</code> commands already
arrange that the at-sign has the character code of a letter,
catcode&nbsp;11.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="482"><r>package</r>, <code>macros2e</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="483"><code>macros2e</code> <r>package</r></indexterm></cindex>

<para>For a comprehensive list of macros with an at-sign in their names see
<url><urefurl>https://ctan.org/pkg/macros2e</urefurl></url>.
</para>
<para>In this example the class file has a command
<code>\thesis&arobase;universityname</code> that the user wants to change.  These
three lines should go in the preamble, before the
<code>\begin&lbrace;document&rbrace;</code>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\makeatletter
\renewcommand&lbrace;\thesis&arobase;universityname&rbrace;&lbrace;Saint Michael's College&rbrace;
\makeatother
</pre></example>


</section>
<node name="_005c_0040ifstar" spaces=" "><nodename>\&arobase;ifstar</nodename><nodenext automatic="on">\newcounter</nodenext><nodeprev automatic="on">\makeatletter &amp; \makeatother</nodeprev><nodeup automatic="on">Definitions</nodeup></node>
<section spaces=" "><sectiontitle><code>\&arobase;ifstar</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="515" mergedindex="cp">\&arobase;ifstar</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="484">commands, star-variants</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="485">star-variants, commands</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcommand&lbrace;\mycmd&rbrace;&lbrace;\&arobase;ifstar&lbrace;\mycmd&arobase;star&rbrace;&lbrace;\mycmd&arobase;nostar&rbrace;&rbrace;
\newcommand&lbrace;\mycmd&arobase;nostar&rbrace;[<var>nostar-num-args</var>]&lbrace;<var>nostar-body</var>&rbrace; 
\newcommand&lbrace;\mycmd&arobase;star&rbrace;[<var>star-num-args</var>]&lbrace;<var>star-body</var>&rbrace;
</pre></example>

<para>Many standard &latex; environments or commands have a variant with the
same name but ending with a star character&nbsp;<code>*</code>, an asterisk.
Examples are the <code>table</code> and <code>table*</code> environments and the
<code>\section</code> and <code>\section*</code> commands.
</para>
<para>When defining environments, following this pattern is straightforward
because <code>\newenvironment</code> and <code>\renewenvironment</code> allow the
environment name to contain a star.  So you just have to write
<code>\newenvironment&lbrace;<var>myenv</var>&rbrace;</code> or
<code>\newenvironment&lbrace;<var>myenv</var>*&rbrace;</code> and continue the definition as
usual. For commands the situation is more complex as the star not being
a letter cannot be part of the command name.  As in the synopsis above,
there will be a user-called command, given above as <code>\mycmd</code>, which
peeks ahead to see if it is followed by a star.  For instance, &latex;
does not really have a <code>\section*</code> command; instead, the
<code>\section</code> command peeks ahead.  This command does not accept
arguments but instead expands to one of two commands that do accept
arguments.  In the synopsis these two are <code>\mycmd&arobase;nostar</code> and
<code>\mycmd&arobase;star</code>.  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 an at-sign&nbsp;<code>&arobase;</code> in its name must be
enclosed inside a <code>\makeatletter ... \makeatother</code> block
(<pxref label="_005cmakeatletter-_0026-_005cmakeatother"><xrefnodename>\makeatletter &amp; \makeatother</xrefnodename></pxref>).
</para>
<para>This example of <code>\&arobase;ifstar</code> defines the command <code>\ciel</code> and a
variant <code>\ciel*</code>.  Both have one required argument.  A call to
<code>\ciel&lbrace;blue&rbrace;</code> will return &quot;not starry blue sky&quot; while
<code>\ciel*&lbrace;night&rbrace;</code> will return &quot;starry night sky&quot;.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\makeatletter
\newcommand*&lbrace;\ciel&arobase;unstarred&rbrace;[1]&lbrace;not starry #1 sky&rbrace;
\newcommand*&lbrace;\ciel&arobase;starred&rbrace;[1]&lbrace;starry #1 sky&rbrace;
\newcommand*&lbrace;\ciel&rbrace;&lbrace;\&arobase;ifstar&lbrace;\ciel&arobase;starred&rbrace;&lbrace;\ciel&arobase;unstarred&rbrace;&rbrace;
\makeatother
</pre></example>

<para>In the next example, the starred variant takes a different number of
arguments than the unstarred one.  With this definition, Agent 007&textrsquo;s
<code>``My name is \agentsecret*&lbrace;Bond&rbrace;,
\agentsecret&lbrace;James&rbrace;&lbrace;Bond&rbrace;.''</code> is equivalent to entering the commands
<code>``My name is \textsc&lbrace;Bond&rbrace;, \textit&lbrace;James&rbrace; textsc&lbrace;Bond&rbrace;.''</code>
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcommand*&lbrace;\agentsecret&arobase;unstarred&rbrace;[2]&lbrace;\textit&lbrace;#1&rbrace; \textsc&lbrace;#2&rbrace;&rbrace;
\newcommand*&lbrace;\agentsecret&arobase;starred&rbrace;[1]&lbrace;\textsc&lbrace;#1&rbrace;&rbrace;
\newcommand*&lbrace;\agentsecret&rbrace;&lbrace;%
  \&arobase;ifstar&lbrace;\agentsecret&arobase;starred&rbrace;&lbrace;\agentsecret&arobase;unstarred&rbrace;&rbrace;
</pre></example>

<para>After a command name, a star is handled similarly to an optional
argument.  (This differs from environment names in which the star is
part of the name itself and as such could be in any position.)  Thus,
it is technically possible to put any number of spaces between the
command and the star. Thus <code>\agentsecret*&lbrace;Bond&rbrace;</code> and
<code>\agentsecret<w> *</w>&lbrace;Bond&rbrace;</code> are equivalent. However, the
standard practice is not to insert any such spaces.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="486"><r>package</r>, <code>suffix</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="487"><code>suffix</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="488"><r>package</r>, <code>xparse</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="489"><code>xparse</code> <r>package</r></indexterm></cindex>

<para>There are two alternative ways to accomplish the work of
<code>\&arobase;ifstar</code>.  (1)&nbsp;The <code>suffix</code> package allows the
construct <code>\newcommand\mycommand&lbrace;<var>unstarred-variant</var>&rbrace;</code>
followed by
<code>\WithSuffix\newcommand\mycommand*&lbrace;<var>starred-variant</var>&rbrace;</code>.
(2)&nbsp;&latex; provides the <code>xparse</code> package, which allows
this code:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\NewDocumentCommand\foo&lbrace;s&rbrace;&lbrace;\IfBooleanTF#1
  &lbrace;<var>starred-variant</var>&rbrace;%
  &lbrace;<var>unstarred-variant</var>&rbrace;% 
  &rbrace;
</pre></example>


</section>
<node name="_005cnewcounter" spaces=" "><nodename>\newcounter</nodename><nodenext automatic="on">\newlength</nodenext><nodeprev automatic="on">\&arobase;ifstar</nodeprev><nodeup automatic="on">Definitions</nodeup></node>
<section spaces=" "><sectiontitle><code>\newcounter</code>: Allocating a counter</sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="516" mergedindex="cp">\newcounter</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="490">counters, defining new</indexterm></cindex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcounter&lbrace;<var>countername</var>&rbrace;
\newcounter&lbrace;<var>countername</var>&rbrace;[<var>supercounter</var>]
</pre></example>

<para>Globally defines a new counter named <var>countername</var> and initialize it
to zero (<pxref label="Counters"><xrefnodename>Counters</xrefnodename></pxref>).
</para>
<para>The name <var>countername</var> must consist of letters only. It does not
begin with a backslash.  This name must not already be in use by another
counter.
</para>
<para>When you use the optional argument <code>[<var>supercounter</var>]</code> then the
counter <var>countername</var> will be reset to zero whenever
<var>supercounter</var> is incremented.  For example, ordinarily
<code>subsection</code> is numbered within <code>section</code> so that any time you
increment <var>section</var>, either with <code>\stepcounter</code>
(<pxref label="_005cstepcounter"><xrefnodename>\stepcounter</xrefnodename></pxref>) or <code>\refstepcounter</code>
(<pxref label="_005crefstepcounter"><xrefnodename>\refstepcounter</xrefnodename></pxref>), then &latex; will reset <var>subsection</var> to
zero.
</para>
<para>This example
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcounter&lbrace;asuper&rbrace;  \setcounter&lbrace;asuper&rbrace;&lbrace;1&rbrace;
\newcounter&lbrace;asub&rbrace;[asuper] \setcounter&lbrace;asub&rbrace;&lbrace;3&rbrace;   % Note `asuper'
The value of asuper is \arabic&lbrace;asuper&rbrace; and of asub is \arabic&lbrace;asub&rbrace;.
\stepcounter&lbrace;asuper&rbrace;
Now asuper is \arabic&lbrace;asuper&rbrace; while asub is \arabic&lbrace;asub&rbrace;.
</pre></example>

<para>produces <samp>The value of asuper is 1 and that of asub is 3</samp> and
<samp>Now asuper is 2 while asub is 0</samp>.
</para>
<para>If the counter already exists, for instance by entering <code>asuper</code>
twice, then you get something like <samp>LaTeX Error: Command \c&arobase;asuper
already defined.  Or name \end... illegal, see p.192 of the manual.</samp>.
</para>
<para>If you use the optional argument then the super counter must already
exist. Entering <code>\newcounter&lbrace;jh&rbrace;[lh]</code> when <code>lh</code> is not a
defined counter will get you <samp>LaTeX Error: No counter 'lh'
defined.</samp>
</para>

</section>
<node name="_005cnewlength" spaces=" "><nodename>\newlength</nodename><nodenext automatic="on">\newsavebox</nodenext><nodeprev automatic="on">\newcounter</nodeprev><nodeup automatic="on">Definitions</nodeup></node>
<section spaces=" "><sectiontitle><code>\newlength</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="517" mergedindex="cp">\newlength</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="491">lengths, allocating new</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="492">rubber lengths, defining new</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="493">skip register, plain &tex;</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="494">glue register, plain &tex;</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newlength&lbrace;\<var>len</var>&rbrace;
</pre></example>

<para>Allocate a new length register (<pxref label="Lengths"><xrefnodename>Lengths</xrefnodename></pxref>).  The required argument
<code>\<var>len</var></code> has to be a control sequence (<pxref label="Control-sequences"><xrefnodename>Control
sequences</xrefnodename></pxref>), and as such must begin with a backslash, <code>\</code> under
normal circumstances.  The new register holds rubber lengths such as
<code>72.27pt</code> or <code>1in plus.2in minus.1in</code> (a &latex; length
register is what plain &tex; calls a <code>skip</code> register).  The
initial value is zero.  The control sequence <code>\<var>len</var></code> must not
be already defined.
</para>
<para>An example:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newlength&lbrace;\graphichgt&rbrace;
</pre></example>

<para>If you forget the backslash then you get <samp>Missing control sequence
inserted</samp>.  If the control 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</samp>.
</para>

</section>
<node name="_005cnewsavebox" spaces=" "><nodename>\newsavebox</nodename><nodenext automatic="on">\newenvironment &amp; \renewenvironment</nodenext><nodeprev automatic="on">\newlength</nodeprev><nodeup automatic="on">Definitions</nodeup></node>
<section spaces=" "><sectiontitle><code>\newsavebox</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="518" mergedindex="cp">\newsavebox</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="495">box, allocating new</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newsavebox&lbrace;\<var>cmd</var>&rbrace;
</pre></example>

<para>Define \<var>cmd</var>, the string consisting of a backslash followed by
<var>cmd</var>, to refer to a new bin for storing material.  These bins hold
material that has been typeset, to use multiple times or to measure or
manipulate (<pxref label="Boxes"><xrefnodename>Boxes</xrefnodename></pxref>).  The bin name \<var>cmd</var> is required, must
start with a backslash, \, and must not already be a defined command.
This command is fragile (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>This allocates a bin and then puts typeset material into it.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newsavebox&lbrace;\logobox&rbrace;
\savebox&lbrace;\logobox&rbrace;&lbrace;LoGo&rbrace;
Our logo is \usebox&lbrace;\logobox&rbrace;. 
</pre></example>

<noindent></noindent>
<para>The output is <samp>Our logo is LoGo</samp>.
</para>
<para>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</samp>.
</para>
<para>The allocation of a box is global.
</para>

</section>
<node name="_005cnewenvironment-_0026-_005crenewenvironment" spaces=" "><nodename>\newenvironment &amp; \renewenvironment</nodename><nodenext automatic="on">\newtheorem</nodenext><nodeprev automatic="on">\newsavebox</nodeprev><nodeup automatic="on">Definitions</nodeup></node>
<section spaces=" "><sectiontitle><code>\newenvironment</code> &amp; <code>\renewenvironment</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="519" mergedindex="cp">\newenvironment</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="520" mergedindex="cp">\renewenvironment</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="496">environments, defining</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="497">defining new environments</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="498">redefining environments</indexterm></cindex>

<para>Synopses, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newenvironment&lbrace;<var>env</var>&rbrace;&lbrace;<var>begdef</var>&rbrace;&lbrace;<var>enddef</var>&rbrace;
\newenvironment&lbrace;<var>env</var>&rbrace;[<var>nargs</var>]&lbrace;<var>begdef</var>&rbrace;&lbrace;<var>enddef</var>&rbrace;
\newenvironment&lbrace;<var>env</var>&rbrace;[<var>nargs</var>][<var>optargdefault</var>]&lbrace;<var>begdef</var>&rbrace;&lbrace;<var>enddef</var>&rbrace;
\newenvironment*&lbrace;<var>env</var>&rbrace;&lbrace;<var>begdef</var>&rbrace;&lbrace;<var>enddef</var>&rbrace;
\newenvironment*&lbrace;<var>env</var>&rbrace;[<var>nargs</var>]&lbrace;<var>begdef</var>&rbrace;&lbrace;<var>enddef</var>&rbrace;
\newenvironment*&lbrace;<var>env</var>&rbrace;[<var>nargs</var>][<var>optargdefault</var>]&lbrace;<var>begdef</var>&rbrace;&lbrace;<var>enddef</var>&rbrace;
</pre></example>

<noindent></noindent>
<para>or one of these.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\renewenvironment&lbrace;<var>env</var>&rbrace;&lbrace;<var>begdef</var>&rbrace;&lbrace;<var>enddef</var>&rbrace;
\renewenvironment&lbrace;<var>env</var>&rbrace;[<var>nargs</var>]&lbrace;<var>begdef</var>&rbrace;&lbrace;<var>enddef</var>&rbrace;
\renewenvironment&lbrace;<var>env</var>&rbrace;[<var>nargs</var>][<var>optargdefault</var>]&lbrace;<var>begdef</var>&rbrace;&lbrace;<var>enddef</var>&rbrace;
\renewenvironment*&lbrace;<var>env</var>&rbrace;&lbrace;<var>begdef</var>&rbrace;&lbrace;<var>enddef</var>&rbrace;
\renewenvironment*&lbrace;<var>env</var>&rbrace;[<var>nargs</var>]&lbrace;<var>begdef</var>&rbrace;&lbrace;<var>enddef</var>&rbrace;
\renewenvironment*&lbrace;<var>env</var>&rbrace;[<var>nargs</var>][<var>optargdefault</var>]&lbrace;<var>begdef</var>&rbrace;&lbrace;<var>enddef</var>&rbrace;
</pre></example>

<para>Define or redefine the environment <var>env</var>, that is, create the
construct <code>\begin&lbrace;<var>env</var>&rbrace; ... <var>body</var> ... \end&lbrace;<var>env</var>&rbrace;</code>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="499"><code>*</code>-form of environment commands</indexterm></cindex>
<para>The starred form of these commands requires that the arguments not
contain multiple paragraphs of text.  However, the body of these
environments can contain multiple paragraphs.
</para>
<table commandarg="var" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="var">env</itemformat></item>
</tableterm><tableitem><para>Required; the environment name.  It consists only of letters or the
<code>*</code> character, and thus does not begin with backslash, <code>\</code>.
It must not begin with the string <code>end</code>.  For
<code>\newenvironment</code>, the name <var>env</var> must not be the name of an
already existing environment, and also the command <code>\<var>env</var></code>
must be undefined.  For <code>\renewenvironment</code>, <var>env</var> must be the
name of an existing environment.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">nargs</itemformat></item>
</tableterm><tableitem><para>Optional; an integer from 0 to 9 denoting the number of arguments of
that the environment takes.  When you use the environment these
arguments appear after the <code>\begin</code>, as in
<code>\begin&lbrace;<var>env</var>&rbrace;&lbrace;<var>arg1</var>&rbrace; ... &lbrace;<var>argn</var>&rbrace;</code>.  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.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">optargdefault</itemformat></item>
</tableterm><tableitem><para>Optional; if this is present then the first argument of the defined
environment is optional, with default value <var>optargdefault</var> (which
may be the empty string).  If this is not in the definition then the
environment does not take an optional argument.
</para>
<para>That is, when <var>optargdefault</var> is present in the definition of the
environment then you can start the environment with square brackets, as
in <code>\begin&lbrace;<var>env</var>&rbrace;[<var>optval</var>]&lbrace;...&rbrace; ... \end&lbrace;<var>env</var>&rbrace;</code>.
In this case, within <var>begdefn</var> the parameter <code>#1</code> is set to the
value of <var>optval</var>.  If you call <code>\begin&lbrace;<var>env</var>&rbrace;</code> without
square brackets, then within <var>begdefn</var> the parameter <code>#1</code> is
set to the value of the default <var>optargdefault</var>.  In either case,
any required arguments start with <code>#2</code>.
</para>
<para>Omitting <code>[<var>myval</var>]</code> in the call is different than having the
square brackets with no contents, as in <code>[]</code>.  The former results
in <code>#1</code> expanding to <var>optargdefault</var>; the latter results in
<code>#1</code> expanding to the empty string.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">begdef</itemformat></item>
</tableterm><tableitem><para>Required; the text expanded at every occurrence of
<code>\begin&lbrace;<var>env</var>&rbrace;</code>.  Within <var>begdef</var>, the parameters
<code>#1</code>, <code>#2</code>, ... <code>#<var>nargs</var></code>, are replaced by the
values that you supply when you call the environment; see the examples
below.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">enddef</itemformat></item>
</tableterm><tableitem><para>Required; the text expanded at every occurrence of
<code>\end&lbrace;<var>env</var>&rbrace;</code>.  This may not contain any parameters, that is,
you cannot use <code>#1</code>, <code>#2</code>, etc., here (but see the final
example below).
</para>
</tableitem></tableentry></table>

<para>All environments, that is to say the <var>begdef</var> code, the environment
body, and the <var>enddef</var> code, are processed within a group.  Thus, in
the first example below, the effect of the <code>\small</code> is limited to
the quote and does not extend to material following the environment.
</para>
<para>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</samp>.  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.</samp>.
</para>
<para>This example gives an environment like &latex;&textrsquo;s <code>quotation</code>
except that it will be set in smaller type.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newenvironment&lbrace;smallquote&rbrace;&lbrace;%
  \small\begin&lbrace;quotation&rbrace;
&rbrace;&lbrace;%
  \end&lbrace;quotation&rbrace;
&rbrace;
</pre></example>

<para>This has an argument, which is set in boldface at the start of a
paragraph.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newenvironment&lbrace;point&rbrace;[1]&lbrace;%
  \noindent\textbf&lbrace;#1&rbrace;
&rbrace;&lbrace;%
&rbrace;
</pre></example> 

<para>This one shows the use of a optional argument; it gives a quotation
environment that cites the author.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newenvironment&lbrace;citequote&rbrace;[1][Shakespeare]&lbrace;%
  \begin&lbrace;quotation&rbrace;
  \noindent\textit&lbrace;#1&rbrace;: 
&rbrace;&lbrace;%
  \end&lbrace;quotation&rbrace;
&rbrace;
</pre></example>

<noindent></noindent>
<para>The author&textrsquo;s name is optional, and defaults to <samp>Shakespeare</samp>.  In
the document, use the environment like this.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;citequote&rbrace;[Lincoln]
  ...
\end&lbrace;citequote&rbrace;
</pre></example>

<para>The final example shows how to save the value of an argument to use in 
<var>enddef</var>, in this case in a box (<pxref label="_005csbox-_0026-_005csavebox"><xrefnodename>\sbox &amp; \savebox</xrefnodename></pxref>).
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newsavebox&lbrace;\quoteauthor&rbrace;
\newenvironment&lbrace;citequote&rbrace;[1][Shakespeare]&lbrace;%
  \sbox\quoteauthor&lbrace;#1&rbrace;%
  \begin&lbrace;quotation&rbrace; 
&rbrace;&lbrace;%
  \hspace&lbrace;1em plus 1fill&rbrace;---\usebox&lbrace;\quoteauthor&rbrace;
  \end&lbrace;quotation&rbrace;
&rbrace;
</pre></example>


</section>
<node name="_005cnewtheorem" spaces=" "><nodename>\newtheorem</nodename><nodenext automatic="on">\newfont</nodenext><nodeprev automatic="on">\newenvironment &amp; \renewenvironment</nodeprev><nodeup automatic="on">Definitions</nodeup></node>
<section spaces=" "><sectiontitle><code>\newtheorem</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="521" mergedindex="cp">\newtheorem</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="500">theorems, defining</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="501">defining new theorems</indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="502">theorem-like environment</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="503">environment, theorem-like</indexterm></cindex>
<para>Synopses:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newtheorem&lbrace;<var>name</var>&rbrace;&lbrace;<var>title</var>&rbrace;
\newtheorem&lbrace;<var>name</var>&rbrace;&lbrace;<var>title</var>&rbrace;[<var>numbered_within</var>]
\newtheorem&lbrace;<var>name</var>&rbrace;[<var>numbered_like</var>]&lbrace;<var>title</var>&rbrace;
</pre></example>

<para>Define a new theorem-like environment.  You can specify one of
<var>numbered_within</var> and <var>numbered_like</var>, or neither, but not both.
</para>
<para>The first form, <code>\newtheorem&lbrace;<var>name</var>&rbrace;&lbrace;<var>title</var>&rbrace;</code>, creates
an environment that will be labelled with <var>title</var>; see the first
example below.
</para>
<para>The second form,
<code>\newtheorem&lbrace;<var>name</var>&rbrace;&lbrace;<var>title</var>&rbrace;[<var>numbered_within</var>]</code>,
creates an environment whose counter is subordinate to the existing
counter <var>numbered_within</var>, so this counter will be reset when
<var>numbered_within</var> is reset.  See the second example below.
</para>
<para>The third form
<code>\newtheorem&lbrace;<var>name</var>&rbrace;[<var>numbered_like</var>]&lbrace;<var>title</var>&rbrace;</code>,
with optional argument between the two required arguments, creates an
environment whose counter will share the previously defined counter
<var>numbered_like</var>.  See the third example.
</para>
<para>This command creates a counter named <var>name</var>.  In addition, unless
the optional argument <var>numbered_like</var> is used, inside of the
theorem-like environment the current <code>\ref</code> value will be that of
<code>\the<var>numbered_within</var></code> (<pxref label="_005cref"><xrefnodename>\ref</xrefnodename></pxref>).
</para>
<para>This declaration is global.  It is fragile (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>Arguments:
</para>
<table commandarg="var" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="var">name</itemformat></item>
</tableterm><tableitem><para>The name of the environment.  It is a string of letters.  It must not
begin with a backslash, <code>\</code>.  It must not be the name of an
existing environment, and the command name <code>\<var>name</var></code> must not
already be defined.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">title</itemformat></item>
</tableterm><tableitem><para>The text to be printed at the beginning of the environment, before the
number. For example, <samp>Theorem</samp>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">numbered_within</itemformat></item>
</tableterm><tableitem><para>Optional; the name of an already defined counter, usually a sectional
unit such as <code>chapter</code> or <code>section</code>.  When the
<var>numbered_within</var> counter is reset then the <var>name</var> environment&textrsquo;s
counter will also be reset.
</para>
<para>If this optional argument is not used then the command
<code>\the<var>name</var></code> is set to <code>\arabic&lbrace;<var>name</var>&rbrace;</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">numbered_like</itemformat></item>
</tableterm><tableitem><para>Optional; the name of an already defined theorem-like environment. The
new environment will be numbered in sequence with <var>numbered_like</var>.
</para>
</tableitem></tableentry></table>

<para>Without any optional arguments the environments are numbered
sequentially.  The example below has a declaration in the preamble that
results in <samp>Definition&nbsp;1</samp> and <samp>Definition&nbsp;2</samp> in the
output.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newtheorem&lbrace;defn&rbrace;&lbrace;Definition&rbrace;
\begin&lbrace;document&rbrace;
\section&lbrace;...&rbrace;
\begin&lbrace;defn&rbrace;
  First def 
\end&lbrace;defn&rbrace;

\section&lbrace;...&rbrace;
\begin&lbrace;defn&rbrace;
  Second def
\end&lbrace;defn&rbrace;
</pre></example>

<para>This example has the same document body as the prior one.  But here
<code>\newtheorem</code>&textrsquo;s optional argument <var>numbered_within</var> is given as
<code>section</code>, so the output is like <samp>Definition&nbsp;1.1</samp> and
<samp>Definition&nbsp;2.1</samp>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newtheorem&lbrace;defn&rbrace;&lbrace;Definition&rbrace;[section]
\begin&lbrace;document&rbrace;
\section&lbrace;...&rbrace;
\begin&lbrace;defn&rbrace;
  First def 
\end&lbrace;defn&rbrace;

\section&lbrace;...&rbrace;
\begin&lbrace;defn&rbrace;
  Second def
\end&lbrace;defn&rbrace;
</pre></example>

<para>In the next example there are two declarations in the preamble, the
second of which calls for the new <code>thm</code> environment to use the same
counter as <code>defn</code>.  It gives <samp>Definition&nbsp;1.1</samp>, followed
by <samp>Theorem&nbsp;2.1</samp> and <samp>Definition&nbsp;2.2</samp>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newtheorem&lbrace;defn&rbrace;&lbrace;Definition&rbrace;[section]
\newtheorem&lbrace;thm&rbrace;[defn]&lbrace;Theorem&rbrace;
\begin&lbrace;document&rbrace;
\section&lbrace;...&rbrace;
\begin&lbrace;defn&rbrace;
  First def 
\end&lbrace;defn&rbrace;

\section&lbrace;...&rbrace;
\begin&lbrace;thm&rbrace;
  First thm
\end&lbrace;thm&rbrace;

\begin&lbrace;defn&rbrace;
  Second def
\end&lbrace;defn&rbrace;
</pre></example>


</section>
<node name="_005cnewfont" spaces=" "><nodename>\newfont</nodename><nodenext automatic="on">\protect</nodenext><nodeprev automatic="on">\newtheorem</nodeprev><nodeup automatic="on">Definitions</nodeup></node>
<section spaces=" "><sectiontitle><code>\newfont</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="522" mergedindex="cp">\newfont</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="504">fonts, new commands for</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="505">defining new fonts</indexterm></cindex>

<!-- c @findex .fd @r{file} -->
<para>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 label="Fonts"><xrefnodename>Fonts</xrefnodename></pxref>).
<!-- 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}). -->
</para>
<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newfont&lbrace;\<var>cmd</var>&rbrace;&lbrace;<var>font description</var>&rbrace;
</pre></example>

<para>Define a command <code>\<var>cmd</var></code> that will change the current font.
The control sequence must not already be defined. It must begin with a
backslash, <code>\</code>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="506">at clause, in font definitions</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="507">design size, in font definitions</indexterm></cindex>
<para>The <var>font description</var> consists of a <var>fontname</var> and an optional
<dfn>at clause</dfn>.  &latex; will look on your system for a file named
<file><var>fontname</var>.tfm</file>.  The at clause can have the form either
<code>at <var>dimen</var></code> or <code>scaled <var>factor</var></code>, where a
<var>factor</var> of <samp>1000</samp> means no scaling.  For &latex;&textrsquo;s purposes,
all this does is scale all the character and other font dimensions
relative to the font&textrsquo;s design size, which is a value defined in the
<file>.tfm</file> file.
</para>
<para>This defines two equivalent fonts and typesets a few characters in each.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newfont&lbrace;\testfontat&rbrace;&lbrace;cmb10 at 11pt&rbrace;
\newfont&lbrace;\testfontscaled&rbrace;&lbrace;cmb10 scaled 1100&rbrace;
\testfontat abc
\testfontscaled abc
</pre></example>


</section>
<node name="_005cprotect" spaces=" "><nodename>\protect</nodename><nodenext automatic="on">\ignorespaces &amp; \ignorespacesafterend</nodenext><nodeprev automatic="on">\newfont</nodeprev><nodeup automatic="on">Definitions</nodeup></node>
<section spaces=" "><sectiontitle><code>\protect</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="523" mergedindex="cp">\protect</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="508">fragile commands</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="509">robust commands</indexterm></cindex>

<para>All &latex; commands are either <dfn>fragile</dfn> or <dfn>robust</dfn>.  A
fragile command can break when it is used in the argument to certain
other commands.  Commands that contain data that &latex; writes to an
auxiliary file and re-reads later are fragile.  This includes material
that goes into a table of contents, list of figures, list of tables,
etc.  Fragile commands also include line breaks, any command that has an
optional argument, and many more. To prevent such commands from
breaking, one solution is to preceded them with the command
<code>\protect</code>.
</para>
<para>For example, when &latex; runs the <code>\section&lbrace;<var>section
name</var>&rbrace;</code> command it writes the <var>section name</var> text to the
<file>.aux</file> auxiliary file, moving it there for use elsewhere in the
document such as in the table of contents.  Any argument that is
internally expanded by &latex; without typesetting it directly is
referred to as a 
<cindex index="cp" spaces=" "><indexterm index="cp" number="510">moving arguments</indexterm></cindex>
<dfn>moving argument</dfn>.  A command is fragile if it can
expand during this process into invalid &tex; code.  Some examples of
moving arguments are those that appear in the <code>\caption&lbrace;...&rbrace;</code>
command (<pxref label="figure"><xrefnodename>figure</xrefnodename></pxref>), in the <code>\thanks&lbrace;...&rbrace;</code> command
(<pxref label="_005cmaketitle"><xrefnodename>\maketitle</xrefnodename></pxref>), and in &arobase;-expressions in the <code>tabular</code> and
<code>array</code> environments (<pxref label="tabular"><xrefnodename>tabular</xrefnodename></pxref>).
</para>
<para>If you get strange errors from commands used in moving arguments, try
preceding it with <code>\protect</code>.  Every fragile commands must be
protected with their own <code>\protect</code>.  
</para>
<para>Although usually a <code>\protect</code> command doesn&textrsquo;t hurt, length
commands are robust and should not be preceded by a <code>\protect</code>
command. Nor can a <code>\protect</code> command be used in the argument to
<code>\addtocounter</code> or <code>\setcounter</code> command.
</para>
<para>In this example the <code>\caption</code> command gives a mysterious error
about an extra curly brace.  Fix the problem by preceding each
<code>\raisebox</code> command with <code>\protect</code>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;figure&rbrace;
  ...
  \caption&lbrace;Company headquarters of A\raisebox&lbrace;1pt&rbrace;&lbrace;B&rbrace;\raisebox&lbrace;-1pt&rbrace;&lbrace;C&rbrace;&rbrace;
\end&lbrace;figure&rbrace;
</pre></example>

<para>In the next example the <code>\tableofcontents</code> command gives an error
because the <code>\(..\)</code> in the section title expands to illegal &tex;
in the <file>.toc</file> file.  You can solve this by changing <code>\(..\)</code>
to <code>\protect\(..\protect\)</code>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;document&rbrace;
\tableofcontents
...
\section&lbrace;Einstein's \( e=mc^2 \)&rbrace;
...
</pre></example>


</section>
<node name="_005cignorespaces-_0026-_005cignorespacesafterend" spaces=" "><nodename>\ignorespaces &amp; \ignorespacesafterend</nodename><nodenext automatic="on">xspace package</nodenext><nodeprev automatic="on">\protect</nodeprev><nodeup automatic="on">Definitions</nodeup></node>
<section spaces=" "><sectiontitle><code>\ignorespaces &amp; \ignorespacesafterend</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="524" mergedindex="cp">\ignorespaces</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="525" mergedindex="cp">\ignorespacesafterend</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="511">spaces, ignore around commands</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="512">commands, ignore spaces</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\ignorespaces
</pre></example>

<noindent></noindent>
<para>or
</para>
<example endspaces=" ">
<pre xml:space="preserve">\ignorespacesafterend
</pre></example>

<para>Both commands cause &latex; to ignore blanks (that is, characters of
catcode&nbsp;10 such as space or tabulation) after the end of the
command up to the first box or non-blank character.  The first is a
command from plain &tex;, and the second is &latex;-specific.
</para>
<para>The <code>\ignorespaces</code> is often used when defining commands via
<code>\newcommand</code>, or <code>\newenvironment</code>, or <code>\def</code>.  The
example below illustrates.  It allows a user to show the points values
for quiz questions in the margin but it is inconvenient because, as
shown in the <code>enumerate</code> list, users must not put any space between
the command and the question text.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcommand&lbrace;\points&rbrace;[1]&lbrace;\makebox[0pt]&lbrace;\makebox[10em][l]&lbrace;#1~pts&rbrace;&rbrace;
\begin&lbrace;enumerate&rbrace; 
  \item\points&lbrace;10&rbrace;no extra space output here
  \item\points&lbrace;15&rbrace; extra space between the number and the `extra'
\end&lbrace;enumerate&rbrace; 
</pre></example>

<noindent></noindent>
<para>The solution is to change to this.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcommand&lbrace;\points&rbrace;[1]&lbrace;%
  \makebox[0pt]&lbrace;\makebox[10em][l]&lbrace;#1~pts&rbrace;&rbrace;\ignorespaces&rbrace;
</pre></example>

<para>A second example shows blanks being removed from the front of text.  The
commands below allow a user to uniformly attach a title to names.  But,
as given, if a title accidentally starts with a space then
<code>\fullname</code> will reproduce that.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcommand&lbrace;\honorific&rbrace;[1]&lbrace;\def\honorific&lbrace;#1&rbrace;&rbrace; % remember title
\newcommand&lbrace;\fullname&rbrace;[1]&lbrace;\honorific~#1&rbrace;       % put title before name

\begin&lbrace;tabular&rbrace;&lbrace;|l|&rbrace;
\honorific&lbrace;Mr/Ms&rbrace;  \fullname&lbrace;Jones&rbrace; \\  % no extra space here
\honorific&lbrace; Mr/Ms&rbrace; \fullname&lbrace;Jones&rbrace;     % extra space before title
\end&lbrace;tabular&rbrace;
</pre></example>

<noindent></noindent>
<para>To fix this, change to
<code>\newcommand&lbrace;\fullname&rbrace;[1]&lbrace;\ignorespaces\honorific~#1&rbrace;</code>.
</para>
<para>The <code>\ignorespaces</code> is also often used in a <code>\newenvironment</code>
at the end of the <var>begin</var> clause, as in
<code>\begin&lbrace;newenvironment&rbrace;&lbrace;<var>env
name</var>&rbrace;&lbrace;... \ignorespaces&rbrace;&lbrace;...&rbrace;</code>.
</para>
<para>To strip blanks off the end of an environment use
<code>\ignorespacesafterend</code>.  An example is that this will show a much
larger vertical space between the first and second environments than
between the second and third.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newenvironment&lbrace;eq&rbrace;&lbrace;\begin&lbrace;equation&rbrace;&rbrace;&lbrace;\end&lbrace;equation&rbrace;&rbrace;
\begin&lbrace;eq&rbrace;
e=mc^2
\end&lbrace;eq&rbrace;
\begin&lbrace;equation&rbrace;
F=ma
\end&lbrace;equation&rbrace;
\begin&lbrace;equation&rbrace;
E=IR
\end&lbrace;equation&rbrace;
</pre></example>

<para>Putting a comment character&nbsp;<code>%</code> immediately after the
<code>\end&lbrace;eq&rbrace;</code> will make the vertical space disappear, but that is
inconvenient.  The solution is to change to
<code>\newenvironment&lbrace;eq&rbrace;&lbrace;\begin&lbrace;equation&rbrace;&rbrace;&lbrace;\end&lbrace;equation&rbrace;\ignorespacesafterend&rbrace;</code>.
</para>

</section>
<node name="xspace-package" spaces=" "><nodename>xspace package</nodename><nodeprev automatic="on">\ignorespaces &amp; \ignorespacesafterend</nodeprev><nodeup automatic="on">Definitions</nodeup></node>
<section spaces=" "><sectiontitle>xspace package</sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="526" mergedindex="cp">\xspace</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="513"><r>package</r>, <code>xspace</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="514"><code>xspace</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="515">spaces, ignore around commands</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="516">commands, ignore spaces</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;xspace&rbrace;
  ...
\newcommand&lbrace;...&rbrace;&lbrace;...\xspace&rbrace;
</pre></example>

<para>The <code>\xspace</code> macro, when used at the end of a command definition,
adds a space unless the command is followed by certain punctuation
characters.
</para>
<para>After a command control sequence that is a control word (<pxref label="Control-sequences"><xrefnodename>Control
sequences</xrefnodename></pxref>, as opposed to control symbols such as <code>\$</code>), &tex;
gobbles blank characters.  Thus, in the first sentence below, the output
has <samp>Vermont</samp> placed snugly against the period, without any
intervening space.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcommand&lbrace;\VT&rbrace;&lbrace;Vermont&rbrace;
Our college is in \VT .
The \VT&lbrace;&rbrace; summers are nice.
</pre></example>

<para>But because of the gobbling, the second sentence needs the empty curly
braces or else there would be no space separating <samp>Vermont</samp> from
<samp>summers</samp>.  (Many authors instead use a backslash-space
<code>\ </code> for this.  <xref label="_005c_0028SPACE_0029"><xrefnodename>\(SPACE)</xrefnodename></xref>.)
</para>
<para>The <code>xspace</code> package provides <code>\xspace</code>.  It is for writing
commands which are designed to be used mainly in text.  It must be place
at the very end of the definition of these commands. It inserts a space
after that command unless what immediately follows is in a list of
exceptions.  In this example, the empty braces are not needed.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcommand&lbrace;\VT&rbrace;&lbrace;Vermont\xspace&rbrace;
Our college is in \VT .
\VT summers are nice.
</pre></example>

<para>The default exception list contains the characters <code>,.'/?;:!~-)</code>,
the open curly brace and the backslash-space command discussed above,
and the commands <code>\footnote</code> or <code>\footnotemark</code>.  Add to that
list as with <code>\xspaceaddexceptions&lbrace;\myfni \myfnii&rbrace;</code> which adds
<code>\myfni</code> and&nbsp;<code>\myfnii</code> to the list, and remove from that
list as with <code>\xspaceremoveexception&lbrace;!&rbrace;</code>.
</para>
<!-- c David Carlisle https://tex.stackexchange.com/a/86620/339 -->
<para>A comment: many experts prefer not to use <code>\xspace</code>.  Putting it in
a definition means that the command will usually get the spacing right.
But it isn&textrsquo;t easy to predict when to enter empty braces because
<code>\xspace</code> will get it wrong, such as when it is followed by another
command, and so <code>\xspace</code> can make editing material harder and more
error-prone than instead always inserting the empty braces.
</para>

</section>
</chapter>
<node name="Counters" spaces=" "><nodename>Counters</nodename><nodenext automatic="on">Lengths</nodenext><nodeprev automatic="on">Definitions</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Counters</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="517">counters, a list of</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="518">variables, a list of</indexterm></cindex>

<para>Everything &latex; numbers for you has a counter associated with
it. The name of the counter is often the same as the name of the
environment or command associated with the number, except that the
counter&textrsquo;s name has no backslash&nbsp;<code>\</code>.  Thus, associated with
the <code>\chapter</code> command is the <code>chapter</code> counter that keeps
track of the chapter number.  
</para>
<para>Below is a list of the counters used in &latex;&textrsquo;s standard document
classes to control numbering.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="527" mergedindex="cp">part counter</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="528" mergedindex="cp">chapter counter</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="529" mergedindex="cp">section counter</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="530" mergedindex="cp">subsection counter</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="531" mergedindex="cp">subsubsection counter</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="532" mergedindex="cp">paragraph counter</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="533" mergedindex="cp">subparagraph counter</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="534" mergedindex="cp">page counter</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="535" mergedindex="cp">equation counter</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="536" mergedindex="cp">figure counter</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="537" mergedindex="cp">table counter</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="538" mergedindex="cp">footnote counter</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="539" mergedindex="cp">mpfootnote counter</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="540" mergedindex="cp">enumi counter</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="541" mergedindex="cp">enumii counter</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="542" mergedindex="cp">enumiii counter</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="543" mergedindex="cp">enumiv counter</indexterm></findex>
<example endspaces=" ">
<pre xml:space="preserve">part            paragraph       figure          enumi
chapter         subparagraph    table           enumii
section         page            footnote        enumiii
subsection      equation        mpfootnote      enumiv
subsubsection
</pre></example>

<para>The <code>mpfootnote</code> counter is used by the <code>\footnote</code> command
inside of a minipage (<pxref label="minipage"><xrefnodename>minipage</xrefnodename></pxref>).  The counters <code>enumi</code>
through <code>enumiv</code> are used in the <code>enumerate</code> environment, for
up to four levels of nesting (<pxref label="enumerate"><xrefnodename>enumerate</xrefnodename></pxref>).
</para>
<para>Counters can have any integer value but they are typically positive.
</para>
<para>New counters are created with <code>\newcounter</code>.  <xref label="_005cnewcounter"><xrefnodename>\newcounter</xrefnodename></xref>.
</para>

<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator=":: ">\alph \Alph \arabic \roman \Roman \fnsymbol</menunode><menudescription><pre xml:space="preserve">Print value of a counter.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::           ">\usecounter</menunode><menudescription><pre xml:space="preserve">Use a specified counter in a list environment.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                ">\value</menunode><menudescription><pre xml:space="preserve">Use the value of a counter in an expression.  
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::           ">\setcounter</menunode><menudescription><pre xml:space="preserve">Set the value of a counter.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::         ">\addtocounter</menunode><menudescription><pre xml:space="preserve">Add a quantity to a counter.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::       ">\refstepcounter</menunode><menudescription><pre xml:space="preserve">Add to a counter.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::          ">\stepcounter</menunode><menudescription><pre xml:space="preserve">Add to a counter, resetting subsidiary counters.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator=":: ">\day &amp; \month &amp; \year</menunode><menudescription><pre xml:space="preserve">Numeric date values.
</pre></menudescription></menuentry></menu>


<node name="_005calph-_005cAlph-_005carabic-_005croman-_005cRoman-_005cfnsymbol" spaces=" "><nodename>\alph \Alph \arabic \roman \Roman \fnsymbol</nodename><nodenext automatic="on">\usecounter</nodenext><nodeup automatic="on">Counters</nodeup></node>
<section spaces=" "><sectiontitle><code>\alph \Alph \arabic \roman \Roman \fnsymbol</code>: Printing counters</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="519">counters, printing</indexterm></cindex>

<para>Print the value of a counter, in a specified style.  For instance, if
the counter <var>counter</var> has the value 1 then a
<code>\alph&lbrace;<var>counter</var>&rbrace;</code> in your source will result in a lowercase
letter&nbsp;a appearing in the output.
</para>
<para>All of these commands take a single counter as an argument, for
instance, <code>\alph&lbrace;enumi&rbrace;</code>.  Note that the counter name does not
start with a backslash.
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="544" mergedindex="cp">\alph&lbrace;<var>counter</var>&rbrace;</indexterm>\alph&lbrace;<var>counter</var>&rbrace;</itemformat></item>
</tableterm><tableitem><para>Print the value of <var>counter</var> in lowercase letters: &textlsquo;a&textrsquo;, &textlsquo;b&textrsquo;,
&enddots; If the counter&textrsquo;s value is less than 1 or more than 26 then
you get <samp>LaTeX Error: Counter too large.</samp>
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="545" mergedindex="cp">\Alph&lbrace;<var>counter</var>&rbrace;</indexterm>\Alph&lbrace;<var>counter</var>&rbrace;</itemformat></item>
</tableterm><tableitem><para>Print in uppercase letters: &textlsquo;A&textrsquo;, &textlsquo;B&textrsquo;, &enddots; If the counter&textrsquo;s value
is less than 1 or more than 26 then you get <samp>LaTeX Error: Counter
too large.</samp>
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="546" mergedindex="cp">\arabic&lbrace;<var>counter</var>&rbrace;</indexterm>\arabic&lbrace;<var>counter</var>&rbrace;</itemformat></item>
</tableterm><tableitem><para>Print in Arabic numbers such as <samp>5</samp> or <samp>-2</samp>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="547" mergedindex="cp">\roman&lbrace;<var>counter</var>&rbrace;</indexterm>\roman&lbrace;<var>counter</var>&rbrace;</itemformat></item>
</tableterm><tableitem><para>Print in lowercase roman numerals: &textlsquo;i&textrsquo;, &textlsquo;ii&textrsquo;, &enddots; If the
counter&textrsquo;s value is less than 1 then you get no warning or error but
&latex; does not print anything in the output.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="548" mergedindex="cp">\Roman&lbrace;<var>counter</var>&rbrace;</indexterm>\Roman&lbrace;<var>counter</var>&rbrace;</itemformat></item>
</tableterm><tableitem><para>Print in uppercase roman numerals: &textlsquo;I&textrsquo;, &textlsquo;II&textrsquo;, &enddots; If the
counter&textrsquo;s value is less than 1 then you get no warning or error but
&latex; does not print anything in the output.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="549" mergedindex="cp">\fnsymbol&lbrace;<var>counter</var>&rbrace;</indexterm>\fnsymbol&lbrace;<var>counter</var>&rbrace;</itemformat></item>
</tableterm><tableitem><para>Prints the value of <var>counter</var> using a sequence of nine symbols that
are traditionally used for labeling footnotes.  The value of
<var>counter</var> should be between&nbsp;1 and&nbsp;9, inclusive.  If the
counter&textrsquo;s value is less than 0 or more than 9 then you get <samp>LaTeX
Error: Counter too large</samp>, while if it is 0 then you get no error or
warning but &latex; does not output anything.
</para>
<para>Here are the symbols:
</para>
<multitable spaces="  " endspaces=" "><columnfractions line=".11 .30 .30 .29"><columnfraction value=".11"></columnfraction><columnfraction value=".30"></columnfraction><columnfraction value=".30"></columnfraction><columnfraction value=".29"></columnfraction></columnfractions>
<thead><row><entry command="headitem" spaces=" "><para>Number</para></entry><entry command="tab" spaces=" "><para>Name</para></entry><entry command="tab" spaces=" "><para>Command</para></entry><entry command="tab" spaces=" "><para>Symbol
</para></entry></row></thead><tbody><row><entry command="item">
<para>1</para></entry><entry command="tab" spaces=" "><para>asterisk</para></entry><entry command="tab"><para><code>\ast</code></para></entry><entry command="tab"><para>*<!-- c -->
</para></entry></row><row><entry command="item">
<para>2</para></entry><entry command="tab" spaces=" "><para>dagger</para></entry><entry command="tab"><para><code>\dagger</code></para></entry><entry command="tab"><para><U>2020</U>
</para></entry></row><row><entry command="item">
<para>3</para></entry><entry command="tab" spaces=" "><para>ddagger</para></entry><entry command="tab"><para><code>\ddagger</code></para></entry><entry command="tab"><para><U>2021</U>
</para></entry></row><row><entry command="item">
<para>4</para></entry><entry command="tab" spaces=" "><para>section-sign</para></entry><entry command="tab"><para><code>\S</code></para></entry><entry command="tab"><para><U>00A7</U>
</para></entry></row><row><entry command="item">
<para>5</para></entry><entry command="tab" spaces=" "><para>paragraph-sign</para></entry><entry command="tab"><para><code>\P</code></para></entry><entry command="tab"><para><U>00B6</U>
</para></entry></row><row><entry command="item">
<para>6</para></entry><entry command="tab" spaces=" "><para>double-vert</para></entry><entry command="tab"><para><code>\parallel</code></para></entry><entry command="tab"><para><U>2016</U>
</para></entry></row><row><entry command="item">
<para>7</para></entry><entry command="tab" spaces=" "><para>double-asterisk</para></entry><entry command="tab"><para><code>\ast\ast</code></para></entry><entry command="tab"><para>**<!-- c -->
</para></entry></row><row><entry command="item">
<para>8</para></entry><entry command="tab">
  <para>double-dagger</para></entry><entry command="tab"><para><code>\dagger\dagger</code></para></entry><entry command="tab"><para><U>2020</U><U>2020</U>
</para></entry></row><row><entry command="item">
<para>9</para></entry><entry command="tab">
  <para>double-ddagger</para></entry><entry command="tab"><para><code>\ddagger\ddagger</code></para></entry><entry command="tab"><para><U>2021</U><U>2021</U>
</para></entry></row></tbody></multitable>

</tableitem></tableentry></ftable>


</section>
<node name="_005cusecounter" spaces=" "><nodename>\usecounter</nodename><nodenext automatic="on">\value</nodenext><nodeprev automatic="on">\alph \Alph \arabic \roman \Roman \fnsymbol</nodeprev><nodeup automatic="on">Counters</nodeup></node>
<section spaces=" "><sectiontitle><code>\usecounter</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="550" mergedindex="cp">\usecounter</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="520">list items, specifying counter</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="521">numbered items, specifying counter</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usecounter&lbrace;<var>counter</var>&rbrace;
</pre></example>

<para>Used in the second argument of the <code>list</code> environment
(<pxref label="list"><xrefnodename>list</xrefnodename></pxref>), this declares that list items will be numbered by
<var>counter</var>.  It initializes <var>counter</var> to zero, and arranges that
when <code>\item</code> is called without its optional argument then
<var>counter</var> is incremented by <code>\refstepcounter</code>, making its value
be the current <code>ref</code> value (<pxref label="_005cref"><xrefnodename>\ref</xrefnodename></pxref>).  This command is fragile
(<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>Put in the document preamble, this example makes a new list environment
enumerated with <var>testcounter</var>:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcounter&lbrace;testcounter&rbrace;
\newenvironment&lbrace;test&rbrace;&lbrace;%
  \begin&lbrace;list&rbrace;&lbrace;&rbrace;&lbrace;%
    \usecounter&lbrace;testcounter&rbrace;
  &rbrace;
&rbrace;&lbrace;%
  \end&lbrace;list&rbrace;
&rbrace;
</pre></example>


</section>
<node name="_005cvalue" spaces=" "><nodename>\value</nodename><nodenext automatic="on">\setcounter</nodenext><nodeprev automatic="on">\usecounter</nodeprev><nodeup automatic="on">Counters</nodeup></node>
<section spaces=" "><sectiontitle><code>\value</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="551" mergedindex="cp">\value</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="522">counters, getting value of</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\value&lbrace;<var>counter</var>&rbrace;
</pre></example>

<para>Expands to the value of the counter <var>counter</var>. (Note that the name
of a counter does not begin with a backslash.)
</para>
<para>This example outputs <samp>Test counter is&nbsp;6. Other counter
is&nbsp;5.</samp>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcounter&lbrace;test&rbrace; \setcounter&lbrace;test&rbrace;&lbrace;5&rbrace;
\newcounter&lbrace;other&rbrace; \setcounter&lbrace;other&rbrace;&lbrace;\value&lbrace;test&rbrace;&rbrace;
\addtocounter&lbrace;test&rbrace;&lbrace;1&rbrace;

Test counter is \arabic&lbrace;test&rbrace;.
Other counter is \arabic&lbrace;other&rbrace;.
</pre></example>

<para>The <code>\value</code> command is not used for typesetting the value of the
counter.  For that, see <ref label="_005calph-_005cAlph-_005carabic-_005croman-_005cRoman-_005cfnsymbol"><xrefnodename>\alph \Alph \arabic \roman \Roman \fnsymbol</xrefnodename></ref>.
</para>
<para>It is often used in <code>\setcounter</code> or <code>\addtocounter</code> but
<code>\value</code> can be used anywhere that &latex; expects a number, such
as in <code>\hspace&lbrace;\value&lbrace;foo&rbrace;\parindent&rbrace;</code>.  It must not be
preceded by <code>\protect</code> (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>This example inserts <code>\hspace&lbrace;4\parindent&rbrace;</code>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\setcounter&lbrace;myctr&rbrace;&lbrace;3&rbrace; \addtocounter&lbrace;myctr&rbrace;&lbrace;1&rbrace;
\hspace&lbrace;\value&lbrace;myctr&rbrace;\parindent&rbrace;
</pre></example>


</section>
<node name="_005csetcounter" spaces=" "><nodename>\setcounter</nodename><nodenext automatic="on">\addtocounter</nodenext><nodeprev automatic="on">\value</nodeprev><nodeup automatic="on">Counters</nodeup></node>
<section spaces=" "><sectiontitle><code>\setcounter</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="552" mergedindex="cp">\setcounter</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="523">counters, setting</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="524">setting counters</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\setcounter&lbrace;<var>counter</var>&rbrace;&lbrace;<var>value</var>&rbrace;
</pre></example>

<para>Globally set the counter <var>counter</var> to have the value of the
<var>value</var> argument, which must be an integer.  Thus, you can set a
counter&textrsquo;s value as <code>\setcounter&lbrace;section&rbrace;&lbrace;5&rbrace;</code>.  Note that the
counter name does not start with a backslash.
</para>
<para>In this example if the counter <code>theorem</code> has value 12 then the
second line will print <samp>XII</samp>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\setcounter&lbrace;exercise&rbrace;&lbrace;\value&lbrace;theorem&rbrace;&rbrace;
Here it is in Roman: \Roman&lbrace;exercise&rbrace;.
</pre></example>


</section>
<node name="_005caddtocounter" spaces=" "><nodename>\addtocounter</nodename><nodenext automatic="on">\refstepcounter</nodenext><nodeprev automatic="on">\setcounter</nodeprev><nodeup automatic="on">Counters</nodeup></node>
<section spaces=" "><sectiontitle><code>\addtocounter</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="553" mergedindex="cp">\addtocounter</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\addtocounter&lbrace;<var>counter</var>&rbrace;&lbrace;<var>value</var>&rbrace;
</pre></example>

<para>Globally increment <var>counter</var> by the amount specified by the
<var>value</var> argument, which may be negative.
</para>
<para>In this example the section value appears as <samp>VII</samp>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\setcounter&lbrace;section&rbrace;&lbrace;5&rbrace;
\addtocounter&lbrace;section&rbrace;&lbrace;2&rbrace;
Here it is in Roman: \Roman&lbrace;section&rbrace;.
</pre></example>


</section>
<node name="_005crefstepcounter" spaces=" "><nodename>\refstepcounter</nodename><nodenext automatic="on">\stepcounter</nodenext><nodeprev automatic="on">\addtocounter</nodeprev><nodeup automatic="on">Counters</nodeup></node>
<section spaces=" "><sectiontitle><code>\refstepcounter</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="554" mergedindex="cp">\refstepcounter</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\refstepcounter&lbrace;<var>counter</var>&rbrace;
</pre></example>

<para>Globally increments the value of <var>counter</var> by one, as does
<code>\stepcounter</code> (<pxref label="_005cstepcounter"><xrefnodename>\stepcounter</xrefnodename></pxref>).  The difference is that this
command resets the value of any counter numbered within it.  (For the
definition of &textldquo;counters numbered within&textrdquo;, <pxref label="_005cnewcounter"><xrefnodename>\newcounter</xrefnodename></pxref>.)
</para>
<para>In addition, this command also defines the current <code>\ref</code> value
to be the result of <code>\thecounter</code>.
</para>
<para>While the counter value is set globally, the <code>\ref</code> value is set
locally, i.e., inside the current group.
</para>

</section>
<node name="_005cstepcounter" spaces=" "><nodename>\stepcounter</nodename><nodenext automatic="on">\day &amp; \month &amp; \year</nodenext><nodeprev automatic="on">\refstepcounter</nodeprev><nodeup automatic="on">Counters</nodeup></node>
<section spaces=" "><sectiontitle><code>\stepcounter</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="555" mergedindex="cp">\stepcounter</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\stepcounter&lbrace;<var>counter</var>&rbrace;
</pre></example>

<para>Globally adds one to <var>counter</var> and resets all counters numbered
within it.  (For the definition of &textldquo;counters numbered within&textrdquo;,
<pxref label="_005cnewcounter"><xrefnodename>\newcounter</xrefnodename></pxref>.)
</para>
<para>This command differs from <code>\refstepcounter</code> in that this one does
not influence references; that is, it does not define the current
<code>\ref</code> value to be the result of <code>\thecounter</code>
(<pxref label="_005crefstepcounter"><xrefnodename>\refstepcounter</xrefnodename></pxref>).
</para>

</section>
<node name="_005cday-_0026-_005cmonth-_0026-_005cyear" spaces=" "><nodename>\day &amp; \month &amp; \year</nodename><nodeprev automatic="on">\stepcounter</nodeprev><nodeup automatic="on">Counters</nodeup></node>
<section spaces=" "><sectiontitle><code>\day</code> &amp; <code>\month</code> &amp; <code>\year</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="556" mergedindex="cp">\day</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="557" mergedindex="cp">\month</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="558" mergedindex="cp">\year</indexterm></findex>

<para>&latex; defines the counter <code>\day</code> for the day of the month
(nominally with value between 1 and 31), <code>\month</code> for the month of
the year (nominally with value between 1 and 12), and <code>\year</code> for
the year.  When &tex; starts up, they are set from the current values
on the system.  The related command <code>\today</code> produces a string
representing the current day (<pxref label="_005ctoday"><xrefnodename>\today</xrefnodename></pxref>).
</para>
<para>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:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\day=-2 \month=13 \year=-4 \today
</pre></example>

<noindent></noindent>
<para>gives no error or warning and results in the output <samp>-2, -4</samp> (the
bogus month value produces no output).
</para>
<para><xref label="Command-line-input"><xrefnodename>Command line input</xrefnodename></xref>, to force the date to a given value from the
command line.
</para>
</section>
</chapter>
<node name="Lengths" spaces=" "><nodename>Lengths</nodename><nodenext automatic="on">Making paragraphs</nodenext><nodeprev automatic="on">Counters</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Lengths</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="525">lengths, defining and using</indexterm></cindex>

<para>A <dfn>length</dfn> is a measure of distance.  Many &latex; commands take a
length as an argument.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="526">rigid lengths</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="527">rubber lengths</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="528">dimen <r>plain &tex;</r></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="529">skip <r>plain &tex;</r></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="530">glue <r>plain &tex;</r></indexterm></cindex>
<para>Lengths come in two types.  A <dfn>rigid length</dfn> such as <code>10pt</code>
does not contain a <code>plus</code> or <code>minus</code> component.  (Plain
&tex; calls this a <dfn>dimen</dfn>.)  A <dfn>rubber length</dfn> (what plain
&tex; calls a <dfn>skip</dfn> or <dfn>glue</dfn>) such as with <code>1cm
plus0.05cm minus0.01cm</code> can contain either or both of those
components.  In that rubber length, the <code>1cm</code> is the <dfn>natural
length</dfn> while the other two, the <code>plus</code> and <code>minus</code>
components, allow &tex; to stretch or shrink the length to optimize
placement.
</para>
<para>The illustrations below use these two commands.
</para>
<example endspaces=" ">
<pre xml:space="preserve">% make a black bar 10pt tall and #1 wide
\newcommand&lbrace;\blackbar&rbrace;[1]&lbrace;\rule&lbrace;#1&rbrace;&lbrace;10pt&rbrace;&rbrace;

% Make a box around #2 that is #1 wide (excluding the border)
\newcommand&lbrace;\showhbox&rbrace;[2]&lbrace;%
  \fboxsep=0pt\fbox&lbrace;\hbox to #1&lbrace;#2&rbrace;&rbrace;&rbrace; 
</pre></example>

<noindent></noindent>
<para>This example uses those commands to show a black bar 100&nbsp;points
long between <samp>XXX</samp> and <samp>YYY</samp>.  This length is rigid.
</para>
<example endspaces=" ">
<pre xml:space="preserve">XXX\showhbox&lbrace;100pt&rbrace;&lbrace;\blackbar&lbrace;100pt&rbrace;&rbrace;YYY
</pre></example>

<para>As for rubber lengths, shrinking is simpler one: with <code>1cm minus
0.05cm</code>, the natural length is 1<dmn>cm</dmn> but &tex; can shrink it down
as far as 0.95<dmn>cm</dmn>.  Beyond that, &tex; refuses to shrink any more.
Thus, below the first one works fine, producing a space of
98&nbsp;points between the two bars.
</para>
<example endspaces=" ">
<pre xml:space="preserve">XXX\showhbox&lbrace;300pt&rbrace;&lbrace;%
  \blackbar&lbrace;101pt&rbrace;\hspace&lbrace;100pt minus 2pt&rbrace;\blackbar&lbrace;101pt&rbrace;&rbrace;YYY

XXX\showhbox&lbrace;300pt&rbrace;&lbrace;%
  \blackbar&lbrace;105pt&rbrace;\hspace&lbrace;100pt minus 1pt&rbrace;\blackbar&lbrace;105pt&rbrace;&rbrace;YYY
</pre></example>

<noindent></noindent>
<para>But the second one gets a warning like <samp>Overfull \hbox (1.0pt too
wide) detected at line 17</samp>.  In the output the first <samp>Y</samp> is
overwritten by the end of the black bar, because the box&textrsquo;s material is
wider than the 300<dmn>pt</dmn> allocated, as &tex; has refused to shrink
the total to less than 309&nbsp;points.
</para>
<para>Stretching is like shrinking except that if &tex; is asked to stretch
beyond the given amount, it will do it.  Here the first line is fine,
producing a space of 110&nbsp;points between the bars.
</para>
<example endspaces=" ">
<pre xml:space="preserve">XXX\showhbox&lbrace;300pt&rbrace;&lbrace;%
  \blackbar&lbrace;95pt&rbrace;\hspace&lbrace;100pt plus 10pt&rbrace;\blackbar&lbrace;95pt&rbrace;&rbrace;YYY

XXX\showhbox&lbrace;300pt&rbrace;&lbrace;%
  \blackbar&lbrace;95pt&rbrace;\hspace&lbrace;100pt plus 1pt&rbrace;\blackbar&lbrace;95pt&rbrace;&rbrace;YYY
</pre></example>

<noindent></noindent>
<para>In the second line &tex; needs a stretch of 10&nbsp;points and only
1&nbsp;point was specified.  &tex; stretches the space to the required
length but it gives you a warning like <samp>Underfull \hbox (badness
10000) detected at line 22</samp>.  (We won&textrsquo;t discuss badness.)
</para>
<para>You can put both stretch and shrink in the same length, as in
<code>1ex plus 0.05ex minus 0.02ex</code>.
</para>
<para>If &tex; is setting two or more rubber lengths then it allocates the
stretch or shrink in proportion.
</para>
<example endspaces=" ">
<pre xml:space="preserve">XXX\showhbox&lbrace;300pt&rbrace;&lbrace;%
  \blackbar&lbrace;100pt&rbrace;%  left
  \hspace&lbrace;0pt plus 50pt&rbrace;\blackbar&lbrace;80pt&rbrace;\hspace&lbrace;0pt plus 10pt&rbrace;%  middle
  \blackbar&lbrace;100pt&rbrace;&rbrace;YYY  % right
</pre></example>

<noindent></noindent>
<para>The left and right bars take up 100&nbsp;points, so the middle needs
another 100.  The middle bar is 80&nbsp;points so the two
<code>\hspace</code>&textrsquo;s must stretch 20&nbsp;points.  Because the two are
<code>plus 50pt</code> and <code>plus 10pt</code>, &tex; gets 5/6 of the stretch
from the first space and 1/6 from the second.
</para>
<para>The <code>plus</code> or <code>minus</code> component of a rubber length can contain
a <dfn>fill</dfn> component, as in <code>1in plus2fill</code>.  This gives the
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.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;minipage&rbrace;&lbrace;\linewidth&rbrace;
  \hspace&lbrace;0pt plus 1fill&rbrace;\includegraphics&lbrace;godel.png&rbrace;%
  \hspace&lbrace;0pt plus 1fill&rbrace;\includegraphics&lbrace;einstein.png&rbrace;%
  \hspace&lbrace;0pt plus 1fill&rbrace;
\end&lbrace;minipage&rbrace;
</pre></example>

<para>&tex; has three levels of infinity for glue components: <code>fil</code>,
<code>fill</code>, and <code>filll</code>.  The later ones are more infinite than
the earlier ones.  Ordinarily document authors only use the middle one
(<pxref label="_005chfill"><xrefnodename>\hfill</xrefnodename></pxref> and <pxref label="_005cvfill"><xrefnodename>\vfill</xrefnodename></pxref>).
</para>
<para>Multiplying a rubber length by a number turns it into a rigid length, so
that after <code>\setlength&lbrace;\ylength&rbrace;&lbrace;1in plus 0.2in&rbrace;</code> and
<code>\setlength&lbrace;\zlength&rbrace;&lbrace;3\ylength&rbrace;</code> then the value of
<code>\zlength</code> is <code>3in</code>.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::     ">Units of length</menunode><menudescription><pre xml:space="preserve">The units that &latex; knows.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::          ">\setlength</menunode><menudescription><pre xml:space="preserve">Set the value of a length.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::        ">\addtolength</menunode><menudescription><pre xml:space="preserve">Add a quantity to a length.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::         ">\settodepth</menunode><menudescription><pre xml:space="preserve">Set a length to the depth of something.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::        ">\settoheight</menunode><menudescription><pre xml:space="preserve">Set a length to the height of something.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::         ">\settowidth</menunode><menudescription><pre xml:space="preserve">Set a length to the width of something.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::            ">\stretch</menunode><menudescription><pre xml:space="preserve">Add infinite stretchability.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::         ">Expressions</menunode><menudescription><pre xml:space="preserve">Compute with lengths and integers.
</pre></menudescription></menuentry></menu>


<node name="Units-of-length" spaces=" "><nodename>Units of length</nodename><nodenext automatic="on">\setlength</nodenext><nodeup automatic="on">Lengths</nodeup></node>
<section spaces=" "><sectiontitle>Units of length</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="531">units, of length</indexterm></cindex>

<para>&tex; and &latex; know about these units both inside and outside of
math mode.
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="559" mergedindex="cp">pt</indexterm>pt </itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="532">point</indexterm></cindex>
<anchor name="units-of-length-pt">units of length pt</anchor>
<para>Point, 1/72.27 inch.  The (approximate) conversion to metric units
is 1<dmn>point</dmn> = .35146<dmn>mm</dmn> = .035146<dmn>cm</dmn>. 
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="560" mergedindex="cp">pc</indexterm>pc</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="533">pica</indexterm></cindex>
<anchor name="units-of-length-pc">units of length pc</anchor>
<para>Pica, 12 pt
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="561" mergedindex="cp">in</indexterm>in </itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="534">inch</indexterm></cindex>
<anchor name="units-of-length-in">units of length in</anchor>
<para>Inch, 72.27 pt
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="562" mergedindex="cp">bp</indexterm>bp </itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="535">big point</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="536">PostScript point</indexterm></cindex>
<anchor name="units-of-length-bp">units of length bp</anchor>
<para>Big point, 1/72 inch.  This length is the definition of a point in
PostScript and many desktop publishing systems.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="563" mergedindex="cp">mm</indexterm>mm </itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="537">millimeter</indexterm></cindex>
<anchor name="units-of-length-mm">units of length mm</anchor>
<para>Millimeter, 2.845 pt
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="564" mergedindex="cp">cm</indexterm>cm </itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="538">centimeter</indexterm></cindex>
<anchor name="units-of-length-cm">units of length cm</anchor>
<para>Centimeter, 10 mm
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="565" mergedindex="cp">dd</indexterm>dd </itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="539">didot point</indexterm></cindex>
<anchor name="units-of-length-dd">units of length dd</anchor>
<para>Didot point, 1.07 pt
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="566" mergedindex="cp">cc</indexterm>cc </itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="540">cicero</indexterm></cindex>
<anchor name="units-of-length-cc">units of length cc</anchor>
<para>Cicero, 12 dd
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="567" mergedindex="cp">sp</indexterm>sp </itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="541">scaled point</indexterm></cindex>
<anchor name="units-of-length-sp">units of length sp</anchor>
<para>Scaled point, 1/65536 pt
</para>
</tableitem></tableentry></ftable>

<para>Three other units are defined according to the current font, rather
than being an absolute dimension.
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="568" mergedindex="cp">ex</indexterm>ex</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="542">x-height</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="543">ex</indexterm></cindex>
<anchor name="Lengths_002fex">Lengths/ex</anchor>
<anchor name="units-of-length-ex">units of length ex</anchor>
<para>The x-height of the current font <dfn>ex</dfn>, traditionally the
height of the lowercase letter x, is often used for vertical
lengths.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="569" mergedindex="cp">em</indexterm>em</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="544">m-width</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="545">em</indexterm></cindex>
<anchor name="Lengths_002fem">Lengths/em</anchor>
<anchor name="units-of-length-em">units of length em</anchor>
<para>Similarly <dfn>em</dfn>, traditionally the width of the capital
letter M, is often used for horizontal lengths.  This is also often
the size of the current font, e.g., a nominal 10<dmn>pt</dmn> font will
have 1<dmn>em</dmn> = 10<dmn>pt</dmn>.  &latex; has several commands to produce
horizontal spaces based on the em (<pxref label="_005censpace-_0026-_005cquad-_0026-_005cqquad"><xrefnodename>\enspace &amp; \quad &amp; \qquad</xrefnodename></pxref>).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="570" mergedindex="cp">mu</indexterm>mu</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="546">mu, math unit</indexterm></cindex>
<anchor name="units-of-length-mu">units of length mu</anchor>
<para>Finally, in math mode, many definitions are expressed in terms
of the math unit <dfn>mu</dfn>, defined by 1<dmn>em</dmn> = 18<dmn>mu</dmn>, where the
em is taken from the current math symbols family.  <xref label="Spacing-in-math-mode"><xrefnodename>Spacing in
math mode</xrefnodename></xref>.
</para>
</tableitem></tableentry></ftable>

<para>Using these units can help make a definition work better across font
changes.  For example, a definition of the vertical space between list
items given as <code>\setlength&lbrace;\itemsep&rbrace;&lbrace;1ex plus 0.05ex minus
0.01ex&rbrace;</code> is more likely to still be reasonable if the font is changed
than a definition given in points.
</para>
</section>
<node name="_005csetlength" spaces=" "><nodename>\setlength</nodename><nodenext automatic="on">\addtolength</nodenext><nodeprev automatic="on">Units of length</nodeprev><nodeup automatic="on">Lengths</nodeup></node>
<section spaces=" "><sectiontitle><code>\setlength</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="571" mergedindex="cp">\setlength</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="547">lengths, setting</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\setlength&lbrace;\<var>len</var>&rbrace;&lbrace;<var>amount</var>&rbrace;
</pre></example>

<para>Set the length \<var>len</var> to <var>amount</var>.  The length name
<code>\<var>len</var></code> has to be a control sequence (<pxref label="Control-sequences"><xrefnodename>Control
sequences</xrefnodename></pxref>), and as such must begin with a backslash, <code>\</code> under
normal circumstances.  The <var>amount</var> can be a rubber length
(<pxref label="Lengths"><xrefnodename>Lengths</xrefnodename></pxref>).  It can be positive, negative or zero, and can be in
any units that &latex; understands (<pxref label="Units-of-length"><xrefnodename>Units of length</xrefnodename></pxref>).
</para>
<para>Below, with &latex;&textrsquo;s defaults the first paragraph will be indented
while the second will not.
</para>
<example endspaces=" ">
<pre xml:space="preserve">I told the doctor I broke my leg in two places.

\setlength&lbrace;\parindent&rbrace;&lbrace;0em&rbrace;
He said stop going to those places.
</pre></example>

<para>If you did not declare \<var>len</var> with <code>\newlength</code>, for example if
you mistype it as in
<code>\newlength&lbrace;\specparindent&rbrace;\setlength&lbrace;\sepcparindent&rbrace;&lbrace;...&rbrace;</code>,
then you get an error like <samp>Undefined control sequence. &lt;argument&gt;
\sepcindent</samp>.  If you omit the backslash at the start of the length name
then you get an error like <samp>Missing number, treated as zero.</samp>.
</para>
</section>
<node name="_005caddtolength" spaces=" "><nodename>\addtolength</nodename><nodenext automatic="on">\settodepth</nodenext><nodeprev automatic="on">\setlength</nodeprev><nodeup automatic="on">Lengths</nodeup></node>
<section spaces=" "><sectiontitle><code>\addtolength</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="572" mergedindex="cp">\addtolength</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="548">lengths, adding to</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\addtolength&lbrace;\<var>len</var>&rbrace;&lbrace;<var>amount</var>&rbrace;
</pre></example>

<para>Increment the length \<var>len</var> by <var>amount</var>.  The length name
<code>\<var>len</var></code> has to be a control sequence (<pxref label="Control-sequences"><xrefnodename>Control
sequences</xrefnodename></pxref>), and as such must begin with a backslash, <code>\</code> under
normal circumstances.  The <var>amount</var> is a rubber length
(<pxref label="Lengths"><xrefnodename>Lengths</xrefnodename></pxref>).  It can be positive, negative or zero, and can be in
any units that &latex; understands (<pxref label="Units-of-length"><xrefnodename>Units of length</xrefnodename></pxref>).
</para>
<para>Below, if <code>\parskip</code> starts with the value <code>0pt plus 1pt</code> 
</para>
<example endspaces=" ">
<pre xml:space="preserve">Doctor: how is the boy who swallowed the silver dollar?
\addtolength&lbrace;\parskip&rbrace;&lbrace;1pt&rbrace;

Nurse: no change.
</pre></example>

<noindent></noindent>
<para>then it has the value <code>1pt plus 1pt</code> for the second paragraph.
</para>
<para>If you did not declare \<var>len</var> with <code>\newlength</code>, for example if
you mistype it as in
<code>\newlength&lbrace;\specparindent&rbrace;\addtolength&lbrace;\sepcparindent&rbrace;&lbrace;...&rbrace;</code>,
then you get an error like <samp>Undefined control sequence. &lt;argument&gt;
\sepcindent</samp>. If the <var>amount</var> uses some length that has not been
declared, for instance if for example you mistype the above as
<code>\addtolength&lbrace;\specparindent&rbrace;&lbrace;0.6\praindent&rbrace;</code>, then you get
something like <samp>Undefined control sequence. &lt;argument&gt; \praindent</samp>.
If you leave off the backslash at the start of \<var>len</var>, as in
<code>\addtolength&lbrace;parindent&rbrace;&lbrace;1pt&rbrace;</code>, then you get something like
<samp>You can't use `the letter p' after \advance</samp>.
</para>
</section>
<node name="_005csettodepth" spaces=" "><nodename>\settodepth</nodename><nodenext automatic="on">\settoheight</nodenext><nodeprev automatic="on">\addtolength</nodeprev><nodeup automatic="on">Lengths</nodeup></node>
<section spaces=" "><sectiontitle><code>\settodepth</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="573" mergedindex="cp">\settodepth</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\settodepth&lbrace;\<var>len</var>&rbrace;&lbrace;<var>text</var>&rbrace;
</pre></example>

<para>Set the length \<var>len</var> to the depth of box that &latex; gets on
typesetting the <var>text</var> argument.  The length name <code>\<var>len</var></code>
has to be a control sequence (<pxref label="Control-sequences"><xrefnodename>Control sequences</xrefnodename></pxref>), and as such
must begin with a backslash, <code>\</code> under normal circumstances.
</para>
<para>This will print how low the character descenders go.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newlength&lbrace;\alphabetdepth&rbrace;
\settodepth&lbrace;\alphabetdepth&rbrace;&lbrace;abcdefghijklmnopqrstuvwxyz&rbrace;
\the\alphabetdepth
</pre></example>

<para>If you did not declare \<var>len</var> with <code>\newlength</code>, if for example you
mistype the above as <code>\settodepth&lbrace;\aplhabetdepth&rbrace;&lbrace;abc...&rbrace;</code>,
then you get something like <samp>Undefined control sequence. &lt;argument&gt;
\aplhabetdepth</samp>.  If you leave the backslash out of \<var>len</var>, as in
<code>\settodepth&lbrace;alphabetdepth&rbrace;&lbrace;...&rbrace;</code> then you get something like
<samp>Missing number, treated as zero. &lt;to be read again&gt; \setbox</samp>.
</para>

</section>
<node name="_005csettoheight" spaces=" "><nodename>\settoheight</nodename><nodenext automatic="on">\settowidth</nodenext><nodeprev automatic="on">\settodepth</nodeprev><nodeup automatic="on">Lengths</nodeup></node>
<section spaces=" "><sectiontitle><code>\settoheight</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="574" mergedindex="cp">\settoheight</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\settoheight&lbrace;\<var>len</var>&rbrace;&lbrace;text&rbrace;
</pre></example>

<para>Sets the length \<var>len</var> to the height of box that &latex; gets on
typesetting the <code>text</code> argument.  The length name <code>\<var>len</var></code>
has to be a control sequence (<pxref label="Control-sequences"><xrefnodename>Control sequences</xrefnodename></pxref>), and as such
must begin with a backslash, <code>\</code> under normal circumstances.
</para>
<para>This will print how high the characters go.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newlength&lbrace;\alphabetheight&rbrace;
\settoheight&lbrace;\alphabetheight&rbrace;&lbrace;abcdefghijklmnopqrstuvwxyz&rbrace;
\the\alphabetheight
</pre></example>

<para>If no such length \<var>len</var> has been declared with <code>\newlength</code>, if
for example you mistype as
<code>\settoheight&lbrace;\aplhabetheight&rbrace;&lbrace;abc...&rbrace;</code>, then you get something
like <samp>Undefined control sequence. &lt;argument&gt; \alphabetheight</samp>.  If
you leave the backslash out of \<var>len</var>, as in
<code>\settoheight&lbrace;alphabetheight&rbrace;&lbrace;...&rbrace;</code> then you get something like
<samp>Missing number, treated as zero. &lt;to be read again&gt; \setbox</samp>.
</para>

</section>
<node name="_005csettowidth" spaces=" "><nodename>\settowidth</nodename><nodenext automatic="on">\stretch</nodenext><nodeprev automatic="on">\settoheight</nodeprev><nodeup automatic="on">Lengths</nodeup></node>
<section spaces=" "><sectiontitle><code>\settowidth</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="575" mergedindex="cp">\settowidth</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\settowidth&lbrace;\<var>len</var>&rbrace;&lbrace;<var>text</var>&rbrace;
</pre></example>

<para>Set the length \<var>len</var> to the width of the box that &latex; gets on
typesetting the <var>text</var> argument.  The length name <code>\<var>len</var></code>
has to be a control sequence (<pxref label="Control-sequences"><xrefnodename>Control sequences</xrefnodename></pxref>), and as such
must begin with a backslash, <code>\</code> under normal circumstances.
</para>
<para>This prints the width of the lowercase ASCII alphabet.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newlength&lbrace;\alphabetwidth&rbrace;
\settowidth&lbrace;\alphabetwidth&rbrace;&lbrace;abcdefghijklmnopqrstuvwxyz&rbrace;
\the\alphabetwidth
</pre></example>

<para>If no such length \<var>len</var> has been declared with <code>\newlength</code>,
if for example you mistype the above as
<code>\settowidth&lbrace;\aplhabetwidth&rbrace;&lbrace;abc...&rbrace;</code>, then you get something
like <samp>Undefined control sequence. &lt;argument&gt; \aplhabetwidth</samp>.  If
you leave the backslash out of \<var>len</var>, as in
<code>\settoheight&lbrace;alphabetwidth&rbrace;&lbrace;...&rbrace;</code> then you get something like
<samp>Missing number, treated as zero. &lt;to be read again&gt; \setbox</samp>.
</para>

</section>
<node name="_005cstretch" spaces=" "><nodename>\stretch</nodename><nodenext automatic="on">Expressions</nodenext><nodeprev automatic="on">\settowidth</nodeprev><nodeup automatic="on">Lengths</nodeup></node>
<section spaces=" "><sectiontitle><code>\stretch</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="576" mergedindex="cp">\stretch</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\stretch&lbrace;<var>number</var>&rbrace;
</pre></example>

<para>Produces a rubber length with zero natural length and <var>number</var> times
<code>\fill</code> units of stretchability (<pxref label="Lengths"><xrefnodename>Lengths</xrefnodename></pxref>).  The
<var>number</var> can be positive or negative.  This command is robust
(<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>It works for both vertical and horizontal spacing.  In this horizontal
example, &latex; produces three tick marks, and the distance between
the first and second is half again as long as the distance between the
second and third.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\rule&lbrace;0.4pt&rbrace;&lbrace;1ex&rbrace;\hspace&lbrace;\stretch&lbrace;1.5&rbrace;&rbrace;%
  \rule&lbrace;0.4pt&rbrace;&lbrace;1ex&rbrace;\hspace&lbrace;\stretch&lbrace;1&rbrace;&rbrace;%
  \rule&lbrace;0.4pt&rbrace;&lbrace;1ex&rbrace; 
</pre></example>

<para>In this vertical example, the <samp>We dedicate &dots;</samp> will have three
times as much space under it as above it.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newenvironment&lbrace;dedication&rbrace;&lbrace;% in document preamble
  \clearpage\thispagestyle&lbrace;empty&rbrace;% 
  \vspace*&lbrace;\stretch&lbrace;1&rbrace;&rbrace; % stretchable space at top 
  \it
&rbrace;&lbrace;%
  \vspace&lbrace;\stretch&lbrace;3&rbrace;&rbrace;  % space at bot is 3x as at top
  \clearpage
&rbrace;
  ...
\begin&lbrace;dedication&rbrace;  % in document body
We dedicate this book to our wives.
\end&lbrace;dedication&rbrace;
</pre></example>


</section>
<node name="Expressions" spaces=" "><nodename>Expressions</nodename><nodeprev automatic="on">\stretch</nodeprev><nodeup automatic="on">Lengths</nodeup></node>
<section spaces=" "><sectiontitle>Expressions</sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="577" mergedindex="cp">expressions</indexterm></findex>

<!-- c Much from Joseph Wright's https://tex.stackexchange.com/a/245663/339 -->
<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\numexpr <var>expression</var> 
\dimexpr <var>expression</var>
\glueexpr <var>expression</var>
\muglue <var>expression</var>
</pre></example>

<para>Any place where you may write an integer, or a &tex; dimen, or &tex;
glue, or muglue, you can instead write an expression to compute that
type of quantity.
</para>
<para>An example is that <code>\the\dimexpr\linewidth-4pt\relax</code> will
produce as output the length that is four points less than width of a
line (the only purpose of <code>\the</code> is to show the result in the
document).  Analogously, <code>\romannumeral\numexpr6+3\relax</code> will
produce <samp>ix</samp>, and <code>\the\glueexpr 5pt plus 1pt * 2 \relax</code>
will produce <samp>10.0pt plus 2.0pt</samp>.
</para>
<para>A convenience here over doing calculations by allocating registers and
then using <code>\advance</code>, etc., is that the evaluation of expressions
does not involve assignments and can therefore be performed in places
where assignments are not allowed.  The next example computes the width
of the <code>\parbox</code>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newlength&lbrace;\offset&rbrace;\setlength&lbrace;\offset&rbrace;&lbrace;2em&rbrace;
\begin&lbrace;center&rbrace;
\parbox&lbrace;\dimexpr\linewidth-\offset*3&rbrace;&lbrace;With malice toward none
with charity for all with firmness in the right as God gives us to see
the right let us strive on to finish the work we are in to bind up the
nation's wounds, to care for him who shall have borne the battle and
for his widow and his orphan \textasciitilde\ to do all which may
achieve and cherish a just and lasting peace among ourselves and with
all nations.  ---Abraham Lincoln, Second Inaugural Address, from the
memorial&rbrace;
\end&lbrace;center&rbrace;
</pre></example>

<para>The <var>expression</var> consists of one or more terms of the same type
(integer, dimension, etc.) that are added or subtracted.  A term that is
a type of number, dimension, etc., consists of a factor of that type,
optionally multiplied or divided by factors.  A factor of a type is
either a quantity of that type or a parenthesized subexpression.  The
expression produces a result of the given type, so that <code>\numexpr</code>
produces an integer, <code>\dimexpr</code> produces a dimension, etc.
</para>
<para>In the quotation example above, changing to
<code>\dimexpr\linewidth-3*\offset</code> gives the error <code>Illegal unit
of measure (pt inserted)</code>.  This is because for <code>\dimexpr</code> and
<code>\glueexpr</code>, the input consists of a dimension or glue value
followed by an optional multiplication factor, and not the other way
around. Thus <code>\the\dimexpr 1pt*10\relax</code> is valid and produces
<samp>10.0pt</samp>, but <code>\the\dimexpr 10*1pt\relax</code> gives the
<code>Illegal unit</code> error.
</para>
<para>The expressions absorb tokens and carry out appropriate mathematics up
to a <code>\relax</code> (which will be absorbed), or up to the first
non-valid token.  Thus, <code>\the\numexpr2+3px</code> will print
<samp>5px</samp>, because &latex; reads the <code>\numexpr2+3</code>, which is
made up of numbers, and then finds the letter <code>p</code>, which cannot
be part of a number.  It therefore terminates the expression and
produces the <samp>5</samp>, followed by the regular text <samp>px</samp>.
</para>
<para>This termination behavior is useful in comparisons.  In
<code>\ifnum\numexpr\parindent*2 &lt; 10pt Yes\else No\fi</code>, the less than
sign terminates the expression and the result is <samp>No</samp> (in a
standard &latex; article).
</para>
<para>Expressions may use the operators <code>+</code>, <code>-</code>, <code>*</code> and
<code>/</code> along with parentheses for subexpressions, <code>(...)</code>.  In
glue expressions the <code>plus</code> and <code>minus</code> parts do not need
parentheses to be affected by a factor. So <code>\the\glueexpr 5pt plus
1pt * 2 \relax</code> results in <samp>10pt plus 2pt</samp>.
</para>
<para>&tex; will coerce other numerical types in the same way as it does when
doing register assignment. Thus <code>\the\numexpr\dimexpr
1pt\relax\relax</code> will result in <samp>65536</samp>, which is <code>1pt</code>
converted to scaled points (<pxref label="units-of-length-sp"><xrefnodename>units of length sp</xrefnodename><xrefinfoname><code>sp</code></xrefinfoname></pxref>,
&tex;&textrsquo;s internal unit) and then coerced into an integer.  With a
<code>\glueexpr</code> here, the stretch and shrink would be dropped.  Going
the other way, a <code>\numexpr</code> inside a <code>\dimexpr</code> or
<code>\glueexpr</code> will need appropriate units, as in
<code>\the\dimexpr\numexpr 1 + 2\relax pt\relax</code>, which produces
<samp>3.0pt</samp>.
</para>
<para>The details of the arithmetic: each factor is checked to be in the
allowed range, numbers must be less than <math>2^{31}</math> in absolute
value, and dimensions or glue components must be less than
<math>2^{14}</math> points, or <code>mu</code>, or <code>fil</code>, etc.  The
arithmetic operations are performed individually, except for a scaling
operation (a multiplication immediately followed by a division) which
is done as one combined operation with a 64-bit product as
intermediate value. The result of each operation is again checked to
be in the allowed range.
</para>
<para>Finally, division and scaling take place with rounding (unlike &tex;&textrsquo;s
<code>\divide</code>, which truncates).  Thus
<code>\the\dimexpr 5pt*(3/2)\relax</code> puts <samp>10.0pt</samp> in the document,
because it rounds <code>3/2</code> to <code>2</code>, while
<code>\the\dimexpr 5pt*(4/3)\relax</code> produces <samp>5.0pt</samp>.
</para>

</section>
</chapter>
<node name="Making-paragraphs" spaces=" "><nodename>Making paragraphs</nodename><nodenext automatic="on">Math formulas</nodenext><nodeprev automatic="on">Lengths</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Making paragraphs</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="549">making paragraphs</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="550">paragraphs</indexterm></cindex>

<para>To start a paragraph, just type some text.  To end the current
paragraph, put an empty line.  This is three paragraphs, the
separation of which is made by two empty lines.
</para>
<example endspaces=" ">
<pre xml:space="preserve">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?''
</pre></example>

<para>A paragraph separator is made of a sequence of at least one blank
line, at least one of which is not terminated by a comment. A blank
line is a line that is empty or made only of blank characters such as
space or tab. Comments in source code are started with a <code>%</code> and
span up to the end of line. In the following example the two columns
are identical:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\documentclass[twocolumn]&lbrace;article&rbrace;
\begin&lbrace;document&rbrace;
First paragraph.

Second paragraph.
\newpage
First paragraph.
      
  % separator lines may contain blank characters.
  		
Second paragraph.
\end&lbrace;document&rbrace;
</pre></example>


<para>Once &latex; has gathered all of a paragraph&textrsquo;s contents it divides that
content into lines in a way that is optimized over the entire paragraph
(<pxref label="Line-breaking"><xrefnodename>Line breaking</xrefnodename></pxref>).
</para>
<para>There are places where a new paragraph is not permitted.  Don&textrsquo;t put a
blank line in math mode (<pxref label="Modes"><xrefnodename>Modes</xrefnodename></pxref>); here the blank line before the
<code>\end&lbrace;equation&rbrace;</code>
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;equation&rbrace;
  2^&lbrace;|S|&rbrace; &gt; |S|

\end&lbrace;equation&rbrace;
</pre></example>

<noindent></noindent>
<para>will get you the error <samp>Missing $ inserted</samp>.  Similarly, the blank
line in this <code>\section</code> argument
</para>
<example endspaces=" ">
<pre xml:space="preserve">\section&lbrace;aaa

bbb&rbrace;
</pre></example>

<noindent></noindent>
<para>gets <samp>Runaway argument? &lbrace;aaa ! Paragraph ended before \&arobase;sect was
complete</samp>.
</para>

<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::                     ">\par</menunode><menudescription><pre xml:space="preserve">End the current paragraph.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::      ">\indent &amp; \noindent</menunode><menudescription><pre xml:space="preserve">Go into horizontal mode, possibly with an indent.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::    ">\parindent &amp; \parskip</menunode><menudescription><pre xml:space="preserve">Space added before paragraphs.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::           ">Marginal notes</menunode><menudescription><pre xml:space="preserve">Put remarks in the margin.
</pre></menudescription></menuentry></menu>


<node name="_005cpar" spaces=" "><nodename>\par</nodename><nodenext automatic="on">\indent &amp; \noindent</nodenext><nodeup automatic="on">Making paragraphs</nodeup></node>
<section spaces=" "><sectiontitle><code>\par</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="578" mergedindex="cp">\par</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="551">paragraph, ending</indexterm></cindex>

<para>Synopsis (note that while reading the input &tex; converts any sequence
of one or more blank lines to a <code>\par</code>, <ref label="Making-paragraphs"><xrefnodename>Making paragraphs</xrefnodename></ref>):
</para>
<example endspaces=" ">
<pre xml:space="preserve">\par
</pre></example>

<para>End the current paragraph.  The usual way to separate paragraphs is with
a blank line but the <code>\par</code> command is entirely equivalent.  This
command is robust (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>This example uses <code>\par</code> rather than a blank line simply for
readability.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcommand&lbrace;\syllabusLegalese&rbrace;&lbrace;%
  \whatCheatingIs\par\whatHappensWhenICatchYou&rbrace;
</pre></example>

<para>In LR mode the <code>\par</code> command does nothing and is ignored.  In
paragraph mode, the <code>\par</code> command terminates paragraph mode,
switching &latex; to vertical mode (<pxref label="Modes"><xrefnodename>Modes</xrefnodename></pxref>).
</para>
<para>You cannot use the <code>\par</code> command in a math mode.  You also cannot
use it in the argument of many commands, such as the sectioning
commands, e.g.&noeos; <code>\section</code> (<pxref label="Making-paragraphs"><xrefnodename>Making paragraphs</xrefnodename></pxref> and
<ref label="_005cnewcommand-_0026-_005crenewcommand"><xrefnodename>\newcommand &amp; \renewcommand</xrefnodename></ref>).
</para>
<para>The <code>\par</code> command is not the same as the <code>\paragraph</code>
command. The latter is, like <code>\section</code> or <code>\subsection</code>, a
sectioning command used by the &latex; document standard classes
(<pxref label="_005csubsubsection-_0026-_005cparagraph-_0026-_005csubparagraph"><xrefnodename>\subsubsection &amp; \paragraph &amp; \subparagraph</xrefnodename></pxref>).
</para>
<para>The <code>\par</code> command is not the same as <code>\newline</code> or the line
break double backslash, <code>\\</code>.  The difference is that <code>\par</code>
ends the paragraph, not just the line, and also triggers the addition of
the between-paragraph vertical space <code>\parskip</code> (<pxref label="_005cparindent-_0026-_005cparskip"><xrefnodename>\parindent
&amp; \parskip</xrefnodename></pxref>).
</para>
<para>The output from this example
</para>
<example endspaces=" ">
<pre xml:space="preserve">xyz

\setlength&lbrace;\parindent&rbrace;&lbrace;3in&rbrace;
\setlength&lbrace;\parskip&rbrace;&lbrace;5in&rbrace;
\noindent test\indent test1\par test2 
</pre></example>

<noindent></noindent>
<para>is: after <samp>xyz</samp> there is a vertical skip of 5&nbsp;inches and then
<samp>test</samp> appears, aligned with the left margin.  On the same line,
there is an empty horizontal space of 3&nbsp;inches and then
<samp>test1</samp> appears.  Finally. there is a vertical space of
5&nbsp;inches, followed by a fresh paragraph with a paragraph indent of
3&nbsp;inches, and then &latex; puts the text <samp>test2</samp>.
</para>

</section>
<node name="_005cindent-_0026-_005cnoindent" spaces=" "><nodename>\indent &amp; \noindent</nodename><nodenext automatic="on">\parindent &amp; \parskip</nodenext><nodeprev automatic="on">\par</nodeprev><nodeup automatic="on">Making paragraphs</nodeup></node>
<section spaces=" "><sectiontitle><code>\indent</code> &amp; <code>\noindent</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="579" mergedindex="cp">\indent</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="580" mergedindex="cp">\noindent</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="581" mergedindex="cp">\parindent</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="552">indent, forcing</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\indent
</pre></example>

<noindent></noindent><para>or
</para>
<example endspaces=" ">
<pre xml:space="preserve">\noindent
</pre></example>

<para>Go into horizontal mode (<pxref label="Modes"><xrefnodename>Modes</xrefnodename></pxref>).  The <code>\indent</code> command
first outputs an empty box whose width is <code>\parindent</code>.  These
commands are robust (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>Ordinarily you create a new paragraph by putting in a blank line.
<xref label="_005cpar"><xrefnodename>\par</xrefnodename></xref>, for the difference between this command and <code>\par</code>.  To
start a paragraph without an indent, or to continue an interrupted
paragraph, use <code>\noindent</code>.
</para>
<para>In the middle of a paragraph the <code>\noindent</code> command has no effect,
because &latex; is already in horizontal mode there.  The
<code>\indent</code> command&textrsquo;s only effect is to output a space.
</para>
<para>This example starts a fresh paragraph.
</para>
<example endspaces=" ">
<pre xml:space="preserve">... end of the prior paragraph.

\noindent This paragraph is not indented.
</pre></example>

<noindent></noindent>
<para>and this continues an interrupted paragraph.
</para>
<example endspaces=" ">
<pre xml:space="preserve">The data 

\begin&lbrace;center&rbrace;
  \begin&lbrace;tabular&rbrace;&lbrace;rl&rbrace; ... \end&lbrace;tabular&rbrace;
\end&lbrace;center&rbrace;

\noindent shows this clearly.
</pre></example>

<para>To omit indentation in the entire document put
<code>\setlength&lbrace;\parindent&rbrace;&lbrace;0pt&rbrace;</code> in the preamble.  If you do that,
you may want to also set the length of spaces between paragraphs,
<code>\parskip</code> (<pxref label="_005cparindent-_0026-_005cparskip"><xrefnodename>\parindent &amp; \parskip</xrefnodename></pxref>).
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="553"><r>package</r>, <code>indentfirst</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="554"><code>indentfirst</code> <r>package</r></indexterm></cindex>

<para>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</code>.
</para>

</section>
<node name="_005cparindent-_0026-_005cparskip" spaces=" "><nodename>\parindent &amp; \parskip</nodename><nodenext automatic="on">Marginal notes</nodenext><nodeprev automatic="on">\indent &amp; \noindent</nodeprev><nodeup automatic="on">Making paragraphs</nodeup></node>
<section spaces=" "><sectiontitle><code>\parindent</code> &amp; <code>\parskip</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="582" mergedindex="cp">\parindent</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="583" mergedindex="cp">\parskip</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="555">paragraph indentation</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="556">horizontal paragraph indentation</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="557">vertical space before paragraphs</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\setlength&lbrace;\parindent&rbrace;&lbrace;<var>horizontal len</var>&rbrace;
\setlength&lbrace;\parskip&rbrace;&lbrace;<var>vertical len</var>&rbrace;
</pre></example>

<para>Both are rubber lengths (<pxref label="Lengths"><xrefnodename>Lengths</xrefnodename></pxref>).  They affect the
indentation of ordinary paragraphs, not paragraphs inside
minipages (<pxref label="minipage"><xrefnodename>minipage</xrefnodename></pxref>), and the vertical space between
paragraphs, respectively.
</para>
<para>For example, if this is put in the preamble:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\setlength&lbrace;\parindent&rbrace;&lbrace;0em&rbrace;
\setlength&lbrace;\parskip&rbrace;&lbrace;1ex&rbrace;
</pre></example>

<noindent></noindent>
<para>The document will have paragraphs that are not indented, but instead
are vertically separated by about the height of a lowercase <samp>x</samp>.
</para>
<para>In &latex; standard class documents, the default value for
<code>\parindent</code> in one-column documents is <code>15pt</code> when the
default text size is <code>10pt</code>, <code>17pt</code> for <code>11pt</code>, and
<code>1.5em</code> for <code>12pt</code>.  In two-column documents it is <code>1em</code>.
(These values are set before &latex; calls <code>\normalfont</code> so
<code>em</code> is derived from the default font, Computer Modern.  If you use
a different font then to set <code>\parindent</code> to 1<dmn>em</dmn> matching
that font, put
<code>\AtBeginDocument&lbrace;\setlength&lbrace;\parindent&rbrace;&lbrace;1em&rbrace;&rbrace;</code> in the
preamble.)
</para>
<para>The default value for <code>\parskip</code> in &latex;&textrsquo;s standard document
classes is <code>0pt plus1pt</code>.
</para>

</section>
<node name="Marginal-notes" spaces=" "><nodename>Marginal notes</nodename><nodeprev automatic="on">\parindent &amp; \parskip</nodeprev><nodeup automatic="on">Making paragraphs</nodeup></node>
<section spaces=" "><sectiontitle>Marginal notes</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="558">marginal notes</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="559">notes in the margin</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="560">remarks in the margin</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="584" mergedindex="cp">\marginpar</indexterm></findex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\marginpar&lbrace;<var>right</var>&rbrace;
\marginpar[<var>left</var>]&lbrace;<var>right</var>&rbrace;
</pre></example>

<para>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</code>
occurs.
</para>
<para>The margin that &latex; uses for the note depends on the current layout
(<pxref label="Document-class-options"><xrefnodename>Document class options</xrefnodename></pxref>) and also on <code>\reversemarginpar</code>
(see below).  If you are using one-sided layout (document option
<code>oneside</code>) then it goes in the right margin.  If you are using
two-sided layout (document option <code>twoside</code>) then it goes in the
outside margin.  If you are in two-column layout (document option
<code>twocolumn</code>) then it goes in the nearest margin.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="585" mergedindex="cp">\reversemarginpar</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="586" mergedindex="cp">\normalmarginpar</indexterm></findex>
<para>If you declare <code>\reversemarginpar</code> 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</code>.
</para>
<para>When you specify the optional argument <var>left</var> then it is used for
a note in the left margin, while the mandatory argument <var>right</var> is
used for a note in the right margin.
</para>
<para>Normally, a note&textrsquo;s first word will not be hyphenated.  You can enable
hyphenation there by beginning <var>left</var> or <var>right</var> with
<code>\hspace&lbrace;0pt&rbrace;</code>.
</para>
<para>These parameters affect the formatting of the note:
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="587" mergedindex="cp">\marginparpush</indexterm>\marginparpush</itemformat></item>
</tableterm><tableitem><anchor name="marginal-notes-marginparpush">marginal notes marginparpush</anchor>
<para>Minimum vertical space between notes; default <samp>7pt</samp> for <samp>12pt</samp>
documents, <samp>5pt</samp> else. See also&nbsp;<ref label="page-layout-parameters-marginparpush"><xrefnodename>page layout parameters
marginparpush</xrefnodename></ref>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="588" mergedindex="cp">\marginparsep</indexterm>\marginparsep</itemformat></item>
</tableterm><tableitem><anchor name="marginal-notes-marginparsep">marginal notes marginparsep</anchor>
<para>Horizontal space between the main text and the note; default
<samp>11pt</samp> for <samp>10pt</samp> documents, <samp>10pt</samp> else.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="589" mergedindex="cp">\marginparwidth</indexterm>\marginparwidth</itemformat></item>
</tableterm><tableitem><anchor name="marginal-notes-marginparwidth">marginal notes marginparwidth</anchor>
<para>Width of the note itself; default for a one-sided <samp>10pt</samp> document
is <samp>90pt</samp>, <samp>83pt</samp> for <samp>11pt</samp>, and <samp>68pt</samp> for
<samp>12pt</samp>; <samp>17pt</samp> more in each case for a two-sided document.
In two column mode, the default is <samp>48pt</samp>.
</para>
</tableitem></tableentry></ftable>

<para>The standard &latex; routine for marginal notes does not prevent
notes from falling off the bottom of the page.
<!-- c  @TeX{} FAQ entry on this topic (xx when there): -->
<!-- c @url{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=marginparside}. -->
<!-- c (+marginfix) -->
</para>

</section>
</chapter>
<node name="Math-formulas" spaces=" "><nodename>Math formulas</nodename><nodenext automatic="on">Modes</nodenext><nodeprev automatic="on">Making paragraphs</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Math formulas</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="561">math formulas</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="562">formulas, math</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="563">math mode, entering</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="590" mergedindex="cp"><r>environment</r>, <code>math</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="591" mergedindex="cp"><code>math</code> <r>environment</r></indexterm></findex>
        
<findex index="fn" spaces=" "><indexterm index="fn" number="592" mergedindex="cp"><r>environment</r>, <code>displaymath</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="593" mergedindex="cp"><code>displaymath</code> <r>environment</r></indexterm></findex>
        
<findex index="fn" spaces=" "><indexterm index="fn" number="594" mergedindex="cp"><r>environment</r>, <code>equation</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="595" mergedindex="cp"><code>equation</code> <r>environment</r></indexterm></findex>
        

<para>Produce mathematical text by putting &latex; into math mode or display
math mode (<pxref label="Modes"><xrefnodename>Modes</xrefnodename></pxref>).  This example shows both.
</para>
<example endspaces=" ">
<pre xml:space="preserve">The wave equation for \( u \) is
\begin&lbrace;displaymath&rbrace;
  \frac&lbrace;\partial^2u&rbrace;&lbrace;\partial t^2&rbrace; = c^2\nabla^2u
\end&lbrace;displaymath&rbrace;
where \( \nabla^2 \) is the spatial Laplacian and \( c \) is constant.
</pre></example>

<noindent></noindent>
<para>Math mode is for inline mathematics.  In the above example it is invoked
by the starting <code>\(</code> and finished by the matching ending <code>\)</code>.
Display math mode is for displayed equations and here is invoked by the
<code>displaymath</code> environment.  Note that any mathematical text
whatever, including mathematical text consisting of just one character,
is handled in math mode.
</para>
<para>When in math mode or display math mode, &latex; handles many aspects of
your input text differently than in other text modes.  For example,
</para>
<example endspaces=" ">
<pre xml:space="preserve">contrast x+y with \( x+y \)
</pre></example>

<noindent></noindent>
<para>in math mode the letters are in italics and the spacing around the plus
sign is different.
</para>
<para>There are three ways to make inline formulas, to put &latex; in math
mode.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\( <var>mathematical material</var> \)
$ <var>mathematical material</var> $
\begin&lbrace;math&rbrace; <var>mathematical material</var> \end&lbrace;math&rbrace;
</pre></example>

<noindent></noindent>
<para>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$</code>.  You can use these in paragraph
mode or in LR mode (<pxref label="Modes"><xrefnodename>Modes</xrefnodename></pxref>).
</para>
<para>To make displayed formulas, put &latex; into display math mode with
either:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;displaymath&rbrace;
  <var>mathematical material</var>
\end&lbrace;displaymath&rbrace;
</pre></example>

<noindent></noindent>
<para>or
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;equation&rbrace;
  <var>mathematical material</var>
\end&lbrace;equation&rbrace;
</pre></example>

<noindent></noindent>
<para>(<pxref label="displaymath"><xrefnodename>displaymath</xrefnodename></pxref>, <pxref label="equation"><xrefnodename>equation</xrefnodename></pxref>).  The only difference is that
with the <code>equation</code> environment, &latex; puts a formula number
alongside the formula.  The construct <code>\[ <var>math</var> \]</code> is
equivalent to <code>\begin&lbrace;displaymath&rbrace; <var>math</var>
\end&lbrace;displaymath&rbrace;</code>.  These environments can only be used in paragraph
mode (<pxref label="Modes"><xrefnodename>Modes</xrefnodename></pxref>).
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="564"><r>package</r>, <code>amsmath</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="565"><code>amsmath</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="566"><r>package</r>, <code>amsfonts</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="567"><code>amsfonts</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="568"><r>package</r>, <code>mathtools</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="569"><code>mathtools</code> <r>package</r></indexterm></cindex>

<para>The American Mathematical Society has made freely available a set of
packages that greatly expand your options for writing mathematics,
<code>amsmath</code> and <code>amssymb</code> (also be aware of the <code>mathtools</code>
package that is an extension to, and loads, <code>amsmath</code>).  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.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::   ">Subscripts &amp; superscripts</menunode><menudescription><pre xml:space="preserve">Also known as exponents or indices.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                ">Math symbols</menunode><menudescription><pre xml:space="preserve">Various mathematical squiggles.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::              ">Math functions</menunode><menudescription><pre xml:space="preserve">Math function names like sin and exp.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                ">Math accents</menunode><menudescription><pre xml:space="preserve">Accents in math.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::       ">Over- and Underlining</menunode><menudescription><pre xml:space="preserve">Things over or under formulas.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::        ">Spacing in math mode</menunode><menudescription><pre xml:space="preserve">Thick, medium, thin, and negative spaces.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                 ">Math styles</menunode><menudescription><pre xml:space="preserve">Determine the size of things.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::             ">Math miscellany</menunode><menudescription><pre xml:space="preserve">Stuff that doesn&textrsquo;t fit anywhere else.
</pre></menudescription></menuentry></menu>


<node name="Subscripts-_0026-superscripts" spaces=" "><nodename>Subscripts &amp; superscripts</nodename><nodenext automatic="on">Math symbols</nodenext><nodeup automatic="on">Math formulas</nodeup></node>
<section spaces=" "><sectiontitle>Subscripts &amp; superscripts</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="570">superscript</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="571">subscript</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="596" mergedindex="cp">^ <r>superscript</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="597" mergedindex="cp">_ <r>subscript</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="572">exponent</indexterm></cindex>

<para>Synopsis (in math mode or display math mode), one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve"><var>base</var>^<var>exp</var>
<var>base</var>^&lbrace;<var>exp</var>&rbrace;
</pre></example>

<noindent></noindent>
<para>or, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve"><var>base</var>_<var>exp</var>
<var>base</var>_&lbrace;<var>exp</var>&rbrace;
</pre></example> 

<para>Make <var>exp</var> appear as a superscript of <var>base</var> (with the caret
character,&nbsp;<code>^</code>) or a subscript (with
underscore,&nbsp;<code>_</code>).
</para>
<para>In this example the <code>0</code>&textrsquo;s and <code>1</code>&textrsquo;s are subscripts while the
<code>2</code>&textrsquo;s are superscripts.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\( (x_0+x_1)^2 \leq (x_0)^2+(x_1)^2 \)
</pre></example> 

<para>To have the subscript or superscript contain more than one character,
surround the expression with curly braces, as in <code>e^&lbrace;-2x&rbrace;</code>.
This example&textrsquo;s fourth line shows curly braces used to group an expression
for the exponent.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;displaymath&rbrace;
  (3^3)^3=27^3=19\,683
  \qquad
  3^&lbrace;(3^3)&rbrace;=3^&lbrace;27&rbrace;=7\,625\,597\,484\,987
\end&lbrace;displaymath&rbrace;
</pre></example>

<para>&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^&lbrace;x^2&rbrace;</code> and <code>x_&lbrace;i_0&rbrace;</code> give correct
output.  Note the use in those expressions of curly braces to give the
<var>base</var> a determined <var>exp</var>.  If you enter <code>\(3^3^3\)</code> then
you get <samp>Double superscript</samp>.
</para>
<para>&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.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;displaymath&rbrace;
  \int_&lbrace;x=a&rbrace;^b f'(x)\,dx = f(b)-f(a)
\end&lbrace;displaymath&rbrace;
</pre></example>

<noindent></noindent>
<para>Note the parentheses around <code>x=a</code> to make the entire expression a
subscript.
</para>
<para>To put a superscript or subscript before a symbol, use a construct like
<code>&lbrace;&rbrace;_t K^2</code>.  The empty curly braces <code>&lbrace;&rbrace;</code> give the
subscript something to attach to and keeps it from accidentally
attaching to a prior symbols.
</para>
<para>Using the subscript or superscript character outside of math mode or
display math mode, as in <code>the expression x^2</code>, will get you
the error <samp>Missing $ inserted</samp>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="573"><r>package</r>, <code>mhchem</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="574"><code>mhchem</code> <r>package</r></indexterm></cindex>

<para>A common reason to want subscripts outside of a mathematics mode is to
typeset chemical formulas.  There are packages for that, such as
<code>mhchem</code>; see CTAN.
</para>

</section>
<node name="Math-symbols" spaces=" "><nodename>Math symbols</nodename><nodenext automatic="on">Math functions</nodenext><nodeprev automatic="on">Subscripts &amp; superscripts</nodeprev><nodeup automatic="on">Math formulas</nodeup></node>
<section spaces=" "><sectiontitle>Math symbols</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="575">math symbols</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="576">symbols, math</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="577">greek letters</indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="578"><r>package</r>, <code>comprehensive</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="579"><code>comprehensive</code> <r>package</r></indexterm></cindex>


<para>&latex; provides almost any mathematical or technical symbol that
anyone uses. For example, if you include <code>$\pi$</code> in your source,
you will get the pi symbol <U>03C0</U>. See the &textldquo;Comprehensive
&latex; Symbol List&textrdquo; package at
<url><urefurl>https://ctan.org/pkg/comprehensive</urefurl></url>.
</para>
<para>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 label="_005censuremath"><xrefnodename>\ensuremath</xrefnodename></ref>.
</para>
<!-- c xx Add Negation: for negations of relevant symbols -->
<!-- c Useful: http://www.w3.org/TR/WD-math-970515/section6.html -->

<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="598" mergedindex="cp">\|</indexterm>\|</itemformat></item>
</tableterm><tableitem><para><U>2225</U> Parallel (relation). Synonym:&nbsp;<code>\parallel</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="599" mergedindex="cp">\aleph</indexterm>\aleph</itemformat></item>
</tableterm><tableitem><para><U>2135</U> Aleph, transfinite cardinal (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="600" mergedindex="cp">\alpha</indexterm>\alpha</itemformat></item>
</tableterm><tableitem><para><U>03B1</U> Lowercase Greek letter alpha (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="601" mergedindex="cp">\amalg</indexterm>\amalg</itemformat></item>
</tableterm><tableitem><para><U>2A3F</U> Disjoint union (binary)
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="602" mergedindex="cp">\angle</indexterm>\angle</itemformat></item>
</tableterm><tableitem><para><U>2220</U> Geometric angle (ordinary). Similar: less-than
sign&nbsp;<code>&lt;</code> and angle bracket&nbsp;<code>\langle</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="603" mergedindex="cp">\approx</indexterm>\approx</itemformat></item>
</tableterm><tableitem><para><U>2248</U> Almost equal to (relation).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="604" mergedindex="cp">\ast</indexterm>\ast</itemformat></item>
</tableterm><tableitem><para><U>2217</U> Asterisk operator, convolution, six-pointed
(binary). Synonym:&nbsp;<code>*</code>, which is often a superscript or
subscript, as in the Kleene star. Similar:&nbsp;<code>\star</code>, which is
five-pointed, and is sometimes used as a general binary operation, and
sometimes reserved for cross-correlation.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="605" mergedindex="cp">\asymp</indexterm>\asymp</itemformat></item>
</tableterm><tableitem><para><U>224D</U> Asymptotically equivalent (relation).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="606" mergedindex="cp">\backslash</indexterm>\backslash</itemformat></item>
</tableterm><tableitem><para>\ Backslash (ordinary).  Similar: set minus&nbsp;<code>\setminus</code>, and
<code>\textbackslash</code> for backslash outside of math mode.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="607" mergedindex="cp">\beta</indexterm>\beta</itemformat></item>
</tableterm><tableitem><para><U>03B2</U> Lowercase Greek letter beta (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="608" mergedindex="cp">\bigcap</indexterm>\bigcap</itemformat></item>
</tableterm><tableitem><para><U>22C2</U> Variable-sized, or n-ary, intersection (operator). Similar:
binary intersection&nbsp;<code>\cap</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="609" mergedindex="cp">\bigcirc</indexterm>\bigcirc</itemformat></item>
</tableterm><tableitem><para><U>26AA</U> Circle, larger (binary).  Similar: function
composition&nbsp;<code>\circ</code>.
<!-- c bb Best unicode symbol for this? -->
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="610" mergedindex="cp">\bigcup</indexterm>\bigcup</itemformat></item>
</tableterm><tableitem><para><U>22C3</U> Variable-sized, or n-ary, union (operator). Similar: binary
union&nbsp;<code>\cup</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="611" mergedindex="cp">\bigodot</indexterm>\bigodot</itemformat></item>
</tableterm><tableitem><para><U>2A00</U> Variable-sized, or n-ary, circled dot operator (operator).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="612" mergedindex="cp">\bigoplus</indexterm>\bigoplus</itemformat></item>
</tableterm><tableitem><para><U>2A01</U> Variable-sized, or n-ary, circled plus operator (operator).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="613" mergedindex="cp">\bigotimes</indexterm>\bigotimes</itemformat></item>
</tableterm><tableitem><para><U>2A02</U> Variable-sized, or n-ary, circled times operator (operator).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="614" mergedindex="cp">\bigtriangledown</indexterm>\bigtriangledown</itemformat></item>
</tableterm><tableitem><para><U>25BD</U> Variable-sized, or n-ary, open triangle pointing down
(operator).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="615" mergedindex="cp">\bigtriangleup</indexterm>\bigtriangleup</itemformat></item>
</tableterm><tableitem><para><U>25B3</U> Variable-sized, or n-ary, open triangle pointing up (operator).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="616" mergedindex="cp">\bigsqcup</indexterm>\bigsqcup</itemformat></item>
</tableterm><tableitem><para><U>2A06</U> Variable-sized, or n-ary, square union (operator).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="617" mergedindex="cp">\biguplus</indexterm>\biguplus</itemformat></item>
</tableterm><tableitem><para><U>2A04</U> Variable-sized, or n-ary, union operator with a plus
(operator).  (Note that the name has only one p.)
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="618" mergedindex="cp">\bigvee</indexterm>\bigvee</itemformat></item>
</tableterm><tableitem><para><U>22C1</U> Variable-sized, or n-ary, logical-or (operator).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="619" mergedindex="cp">\bigwedge</indexterm>\bigwedge</itemformat></item>
</tableterm><tableitem><para><U>22C0</U> Variable-sized, or n-ary, logical-and (operator).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="620" mergedindex="cp">\bot</indexterm>\bot</itemformat></item>
</tableterm><tableitem><para><U>22A5</U>, Up tack, bottom, least element of a partially ordered
set, or a contradiction (ordinary).  See also&nbsp;<code>\top</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="621" mergedindex="cp">\bowtie</indexterm>\bowtie</itemformat></item>
</tableterm><tableitem><para><U>22C8</U> Natural join of two relations (relation).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="622" mergedindex="cp">\Box</indexterm>\Box</itemformat></item>
</tableterm><tableitem><para><U>25A1</U> Modal operator for necessity; square open box
(ordinary).  Not available in plain &tex;. In &latex; you need to load the <code>amssymb</code> package.
<!-- c bb Best Unicode equivalent? -->
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="623" mergedindex="cp">\bullet</indexterm>\bullet</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="580">bullet symbol</indexterm></cindex>
<para><U>2022</U> Bullet (binary).  Similar: multiplication
dot&nbsp;<code>\cdot</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="624" mergedindex="cp">\cap</indexterm>\cap</itemformat></item>
</tableterm><tableitem><para><U>2229</U> Intersection of two sets (binary).  Similar: variable-sized
operator&nbsp;<code>\bigcap</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="625" mergedindex="cp">\cdot</indexterm>\cdot</itemformat></item>
</tableterm><tableitem><para><U>22C5</U> Multiplication (binary).  Similar: Bullet
dot&nbsp;<code>\bullet</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="626" mergedindex="cp">\chi</indexterm>\chi</itemformat></item>
</tableterm><tableitem><para><U>03C7</U> Lowercase Greek chi (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="627" mergedindex="cp">\circ</indexterm>\circ</itemformat></item>
</tableterm><tableitem><para><U>2218</U> Function composition, ring operator (binary).  Similar:
variable-sized operator&nbsp;<code>\bigcirc</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="628" mergedindex="cp">\clubsuit</indexterm>\clubsuit</itemformat></item>
</tableterm><tableitem><para><U>2663</U> Club card suit (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="629" mergedindex="cp">\complement</indexterm>\complement</itemformat></item>
</tableterm><tableitem><para><U>2201</U>, Set complement, used as a superscript as in
<code>$S^\complement$</code> (ordinary).  Not available in plain &tex;. In &latex; you need to load the <code>amssymb</code> package. Also used:
<code>$S^&lbrace;\mathsf&lbrace;c&rbrace;&rbrace;$</code> or&nbsp;<code>$\bar&lbrace;S&rbrace;$</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="630" mergedindex="cp">\cong</indexterm>\cong</itemformat></item>
</tableterm><tableitem><para><U>2245</U> Congruent (relation).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="631" mergedindex="cp">\coprod</indexterm>\coprod</itemformat></item>
</tableterm><tableitem><para><U>2210</U> Coproduct (operator).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="632" mergedindex="cp">\cup</indexterm>\cup</itemformat></item>
</tableterm><tableitem><para><U>222A</U> Union of two sets (binary).  Similar: variable-sized
operator&nbsp;<code>\bigcup</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="633" mergedindex="cp">\dagger</indexterm>\dagger</itemformat></item>
</tableterm><tableitem><para><U>2020</U> Dagger relation (binary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="634" mergedindex="cp">\dashv</indexterm>\dashv</itemformat></item>
</tableterm><tableitem><para><U>22A3</U> Dash with vertical, reversed turnstile (relation).  Similar:
turnstile&nbsp;<code>\vdash</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="635" mergedindex="cp">\ddagger</indexterm>\ddagger</itemformat></item>
</tableterm><tableitem><para><U>2021</U> Double dagger relation (binary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="636" mergedindex="cp">\Delta</indexterm>\Delta</itemformat></item>
</tableterm><tableitem><para><U>0394</U> Greek uppercase delta, used for increment (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="637" mergedindex="cp">\delta</indexterm>\delta</itemformat></item>
</tableterm><tableitem><para><U>03B4</U> Greek lowercase delta (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="638" mergedindex="cp">\Diamond</indexterm>\Diamond</itemformat></item>
</tableterm><tableitem><para><U>25C7</U> Large diamond operator (ordinary).  Not available in plain &tex;. In &latex; you need to load the <code>amssymb</code> package.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="639" mergedindex="cp">\diamond</indexterm>\diamond</itemformat></item>
</tableterm><tableitem><para><U>22C4</U> Diamond operator (binary).  Similar: large
diamond&nbsp;<code>\Diamond</code>, circle bullet&nbsp;<code>\bullet</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="640" mergedindex="cp">\diamondsuit</indexterm>\diamondsuit</itemformat></item>
</tableterm><tableitem><para><U>2662</U> Diamond card suit (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="641" mergedindex="cp">\div</indexterm>\div</itemformat></item>
</tableterm><tableitem><para><U>00F7</U> Division sign (binary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="642" mergedindex="cp">\doteq</indexterm>\doteq</itemformat></item>
</tableterm><tableitem><para><U>2250</U> Approaches the limit (relation).  Similar: geometrically equal
to&nbsp;<code>\Doteq</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="643" mergedindex="cp">\downarrow</indexterm>\downarrow</itemformat></item>
</tableterm><tableitem><para><U>2193</U> Down arrow, converges (relation).  Similar:
<code>\Downarrow</code> double line down arrow.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="644" mergedindex="cp">\Downarrow</indexterm>\Downarrow</itemformat></item>
</tableterm><tableitem><para><U>21D3</U> Double line down arrow (relation).  Similar:
<code>\downarrow</code> single line down arrow.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="645" mergedindex="cp">\ell</indexterm>\ell</itemformat></item>
</tableterm><tableitem><para><U>2113</U> Lowercase cursive letter l (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="646" mergedindex="cp">\emptyset</indexterm>\emptyset</itemformat></item>
</tableterm><tableitem><para><U>2205</U> Empty set symbol (ordinary).  The variant form is
<code>\varnothing</code>.
<!-- c bb Why Unicode has \revemptyset but no \emptyset? -->
</para>	
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="647" mergedindex="cp">\epsilon</indexterm>\epsilon</itemformat></item>
</tableterm><tableitem><para><U>03F5</U> Lowercase lunate epsilon (ordinary). Similar to
Greek text letter. More widely used in mathematics is the script small
letter epsilon <code>\varepsilon</code>&nbsp;<U>03B5</U>. Related:
the set membership relation <code>\in</code>&nbsp;<U>2208</U>.
<!-- c src: David Carlisle http://tex.stackexchange.com/a/98018/339 and -->
<!-- c Unicode referenced there asserts varepsilon is much more widely used. -->
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="648" mergedindex="cp">\equiv</indexterm>\equiv</itemformat></item>
</tableterm><tableitem><para><U>2261</U> Equivalence (relation).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="649" mergedindex="cp">\eta</indexterm>\eta</itemformat></item>
</tableterm><tableitem><para><U>03B7</U> Lowercase Greek letter (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="650" mergedindex="cp">\exists</indexterm>\exists</itemformat></item>
</tableterm><tableitem><para><U>2203</U> Existential quantifier (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="651" mergedindex="cp">\flat</indexterm>\flat</itemformat></item>
</tableterm><tableitem><para><U>266D</U> Musical flat (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="652" mergedindex="cp">\forall</indexterm>\forall</itemformat></item>
</tableterm><tableitem><para><U>2200</U> Universal quantifier (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="653" mergedindex="cp">\frown</indexterm>\frown</itemformat></item>
</tableterm><tableitem><para><U>2322</U> Downward curving arc (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="654" mergedindex="cp">\Gamma</indexterm>\Gamma</itemformat></item>
</tableterm><tableitem><para><U>0393</U> uppercase Greek letter (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="655" mergedindex="cp">\gamma</indexterm>\gamma</itemformat></item>
</tableterm><tableitem><para><U>03B3</U> Lowercase Greek letter (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="656" mergedindex="cp">\ge</indexterm>\ge</itemformat></item>
</tableterm><tableitem><para><U>2265</U> Greater than or equal to (relation).  This is a synonym
for&nbsp;<code>\geq</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="657" mergedindex="cp">\geq</indexterm>\geq</itemformat></item>
</tableterm><tableitem><para><U>2265</U> Greater than or equal to (relation).  This is a synonym
for&nbsp;<code>\ge</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="658" mergedindex="cp">\gets</indexterm>\gets</itemformat></item>
</tableterm><tableitem><para><U>2190</U> Is assigned the value (relation).
Synonym:&nbsp;<code>\leftarrow</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="659" mergedindex="cp">\gg</indexterm>\gg</itemformat></item>
</tableterm><tableitem><para><U>226B</U> Much greater than (relation).  Similar: much less
than&nbsp;<code>\ll</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="660" mergedindex="cp">\hbar</indexterm>\hbar</itemformat></item>
</tableterm><tableitem><para><U>210F</U> Planck constant over two pi (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="661" mergedindex="cp">\heartsuit</indexterm>\heartsuit</itemformat></item>
</tableterm><tableitem><para><U>2661</U> Heart card suit (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="662" mergedindex="cp">\hookleftarrow</indexterm>\hookleftarrow</itemformat></item>
</tableterm><tableitem><para><U>21A9</U> Hooked left arrow (relation).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="663" mergedindex="cp">\hookrightarrow</indexterm>\hookrightarrow</itemformat></item>
</tableterm><tableitem><para><U>21AA</U> Hooked right arrow (relation).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="664" mergedindex="cp">\iff</indexterm>\iff</itemformat></item>
</tableterm><tableitem><para><U>27F7</U> If and only if (relation).  It is <code>\Longleftrightarrow</code>
with a <code>\thickmuskip</code> on either side.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="665" mergedindex="cp">\Im</indexterm>\Im</itemformat></item>
</tableterm><tableitem><para><U>2111</U> Imaginary part (ordinary).  See: real part&nbsp;<code>\Re</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="666" mergedindex="cp">\imath</indexterm>\imath</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="581">dotless i, math</indexterm></cindex>
<para>Dotless i; used when you are putting an accent on an i (<pxref label="Math-accents"><xrefnodename>Math
accents</xrefnodename></pxref>).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="667" mergedindex="cp">\in</indexterm>\in</itemformat></item>
</tableterm><tableitem><para><U>2208</U> Set element (relation).  See also: lowercase lunate
epsilon&nbsp;<code>\epsilon</code><U>03F5</U> and small letter script
epsilon&nbsp;<code>\varepsilon</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="668" mergedindex="cp">\infty</indexterm>\infty</itemformat></item>
</tableterm><tableitem><para><U>221E</U> Infinity (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="669" mergedindex="cp">\int</indexterm>\int</itemformat></item>
</tableterm><tableitem><para><U>222B</U> Integral (operator).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="670" mergedindex="cp">\iota</indexterm>\iota</itemformat></item>
</tableterm><tableitem><para><U>03B9</U> Lowercase Greek letter (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="671" mergedindex="cp">\Join</indexterm>\Join</itemformat></item>
</tableterm><tableitem><para><U>2A1D</U> Condensed bowtie symbol (relation).  Not available in Plain
&tex;.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="672" mergedindex="cp">\jmath</indexterm>\jmath</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="582">dotless j, math</indexterm></cindex>
<para>Dotless j; used when you are putting an accent on a j (<pxref label="Math-accents"><xrefnodename>Math
accents</xrefnodename></pxref>).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="673" mergedindex="cp">\kappa</indexterm>\kappa</itemformat></item>
</tableterm><tableitem><para><U>03BA</U> Lowercase Greek letter (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="674" mergedindex="cp">\Lambda</indexterm>\Lambda</itemformat></item>
</tableterm><tableitem><para><U>039B</U> uppercase Greek letter (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="675" mergedindex="cp">\lambda</indexterm>\lambda</itemformat></item>
</tableterm><tableitem><para><U>03BB</U> Lowercase Greek letter (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="676" mergedindex="cp">\land</indexterm>\land</itemformat></item>
</tableterm><tableitem><para><U>2227</U> Logical and (binary).  Synonym:&nbsp;<code>\wedge</code>.
See also logical&nbsp;or&nbsp;<code>\lor</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="677" mergedindex="cp">\langle</indexterm>\langle</itemformat></item>
</tableterm><tableitem><para><U>27E8</U> Left angle, or sequence, bracket (opening).  Similar:
less-than&nbsp;<code>&lt;</code>. Matches&nbsp;<code>\rangle</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="678" mergedindex="cp">\lbrace</indexterm>\lbrace</itemformat></item>
</tableterm><tableitem><para><U>007B</U> Left curly brace
(opening). Synonym:&nbsp;<code>\&lbrace;</code>. Matches&nbsp;<code>\rbrace</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="679" mergedindex="cp">\lbrack</indexterm>\lbrack</itemformat></item>
</tableterm><tableitem><para><U>005B</U> Left square bracket (opening).
Synonym:&nbsp;<code>[</code>. Matches&nbsp;<code>\rbrack</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="680" mergedindex="cp">\lceil</indexterm>\lceil</itemformat></item>
</tableterm><tableitem><para><U>2308</U> Left ceiling bracket, like a square bracket but with the bottom
shaved off (opening). Matches&nbsp;<code>\rceil</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="681" mergedindex="cp">\le</indexterm>\le</itemformat></item>
</tableterm><tableitem><para><U>2264</U> Less than or equal to (relation).  This is a synonym
for&nbsp;<code>\leq</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="682" mergedindex="cp">\leadsto</indexterm>\leadsto</itemformat></item>
</tableterm><tableitem><para><U>21DD</U> Squiggly right arrow (relation).
To get this symbol outside of math mode you can put
<code>\newcommand*&lbrace;\Leadsto&rbrace;&lbrace;\ensuremath&lbrace;\leadsto&rbrace;&rbrace;</code> in the
preamble and then use <code>\Leadsto</code> instead.
<!-- c bb Best Unicode equivalent? -->
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="683" mergedindex="cp">\Leftarrow</indexterm>\Leftarrow</itemformat></item>
</tableterm><tableitem><para><U>21D0</U> Is implied by, double-line left arrow (relation).  Similar:
single-line left arrow&nbsp;<code>\leftarrow</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="684" mergedindex="cp">\leftarrow</indexterm>\leftarrow</itemformat></item>
</tableterm><tableitem><para><U>2190</U> Single-line left arrow (relation).
Synonym:&nbsp;<code>\gets</code>. Similar: double-line left
arrow&nbsp;<code>\Leftarrow</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="685" mergedindex="cp">\leftharpoondown</indexterm>\leftharpoondown</itemformat></item>
</tableterm><tableitem><para><U>21BD</U> Single-line left harpoon, barb under bar (relation).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="686" mergedindex="cp">\leftharpoonup</indexterm>\leftharpoonup</itemformat></item>
</tableterm><tableitem><para><U>21BC</U> Single-line left harpoon, barb over bar (relation).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="687" mergedindex="cp">\Leftrightarrow</indexterm>\Leftrightarrow</itemformat></item>
</tableterm><tableitem><para><U>21D4</U> Bi-implication; double-line double-headed arrow (relation).
Similar: single-line double headed arrow&nbsp;<code>\leftrightarrow</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="688" mergedindex="cp">\leftrightarrow</indexterm>\leftrightarrow</itemformat></item>
</tableterm><tableitem><para><U>2194</U> Single-line double-headed arrow (relation).  Similar:
double-line double headed arrow&nbsp;<code>\Leftrightarrow</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="689" mergedindex="cp">\leq</indexterm>\leq</itemformat></item>
</tableterm><tableitem><para><U>2264</U> Less than or equal to (relation).  This is a synonym
for&nbsp;<code>\le</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="690" mergedindex="cp">\lfloor</indexterm>\lfloor</itemformat></item>
</tableterm><tableitem><para><U>230A</U> Left floor bracket (opening). Matches:&nbsp;<code>\floor</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="691" mergedindex="cp">\lhd</indexterm>\lhd</itemformat></item>
</tableterm><tableitem><para><U>25C1</U> Arrowhead, that is, triangle, pointing left (binary).
For the normal subgroup symbol you should load
<code>amssymb</code> and use&nbsp;<code>\vartriangleleft</code> (which is a relation
and so gives better spacing).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="692" mergedindex="cp">\ll</indexterm>\ll</itemformat></item>
</tableterm><tableitem><para><U>226A</U> Much less than (relation).  Similar: much greater
than&nbsp;<code>\gg</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="693" mergedindex="cp">\lnot</indexterm>\lnot</itemformat></item>
</tableterm><tableitem><para><U>00AC</U> Logical negation (ordinary). Synonym:&nbsp;<code>\neg</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="694" mergedindex="cp">\longleftarrow</indexterm>\longleftarrow</itemformat></item>
</tableterm><tableitem><para><U>27F5</U> Long single-line left arrow (relation).  Similar: long
double-line left arrow&nbsp;<code>\Longleftarrow</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="695" mergedindex="cp">\longleftrightarrow</indexterm>\longleftrightarrow</itemformat></item>
</tableterm><tableitem><para><U>27F7</U> Long single-line double-headed arrow (relation).  Similar: long
double-line double-headed arrow&nbsp;<code>\Longleftrightarrow</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="696" mergedindex="cp">\longmapsto</indexterm>\longmapsto</itemformat></item>
</tableterm><tableitem><para><U>27FC</U> Long single-line left arrow starting with vertical bar
(relation).  Similar: shorter version&nbsp;<code>\mapsto</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="697" mergedindex="cp">\longrightarrow</indexterm>\longrightarrow</itemformat></item>
</tableterm><tableitem><para><U>27F6</U> Long single-line right arrow (relation).  Similar: long
double-line right arrow&nbsp;<code>\Longrightarrow</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="698" mergedindex="cp">\lor</indexterm>\lor</itemformat></item>
</tableterm><tableitem><para><U>2228</U> Logical or (binary).  Synonym:&nbsp;<code>\vee</code>.
See also logical&nbsp;and&nbsp;<code>\land</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="699" mergedindex="cp">\mapsto</indexterm>\mapsto</itemformat></item>
</tableterm><tableitem><para><U>21A6</U> Single-line left arrow starting with vertical bar
(relation).
Similar: longer version&nbsp;<code>\longmapsto</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="700" mergedindex="cp">\mho</indexterm>\mho</itemformat></item>
</tableterm><tableitem><para><U>2127</U> Conductance, half-circle rotated capital omega (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="701" mergedindex="cp">\mid</indexterm>\mid</itemformat></item>
</tableterm><tableitem><para><U>2223</U> Single-line vertical bar (relation).  A typical use of
<code>\mid</code> is for a set <code>\&lbrace;\, x \mid x\geq 5 \,\&rbrace;</code>.
</para>
<para>Similar: <code>\vert</code> and&nbsp;<code>|</code> produce the same single-line
vertical bar symbol but without any spacing (they fall in class
ordinary) and you should not use them as relations but instead only as
ordinals, i.e., footnote symbols.  For absolute value, see the entry
for&nbsp;<code>\vert</code> and for norm see the entry for&nbsp;<code>\Vert</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="702" mergedindex="cp">\models</indexterm>\models</itemformat></item>
</tableterm><tableitem><para><U>22A8</U> Entails, or satisfies; double turnstile, short double dash
(relation).  Similar: long double dash&nbsp;<code>\vDash</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="703" mergedindex="cp">\mp</indexterm>\mp</itemformat></item>
</tableterm><tableitem><para><U>2213</U> Minus or plus (relation).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="704" mergedindex="cp">\mu</indexterm>\mu</itemformat></item>
</tableterm><tableitem><para><U>03BC</U> Lowercase Greek letter (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="705" mergedindex="cp">\nabla</indexterm>\nabla</itemformat></item>
</tableterm><tableitem><para><U>2207</U> Hamilton&textrsquo;s del, or differential, operator (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="706" mergedindex="cp">\natural</indexterm>\natural</itemformat></item>
</tableterm><tableitem><para><U>266E</U> Musical natural notation (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="707" mergedindex="cp">\ne</indexterm>\ne</itemformat></item>
</tableterm><tableitem><para><U>2260</U> Not equal (relation). Synonym:&nbsp;<code>\neq</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="708" mergedindex="cp">\nearrow</indexterm>\nearrow</itemformat></item>
</tableterm><tableitem><para><U>2197</U> North-east arrow (relation).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="709" mergedindex="cp">\neg</indexterm>\neg</itemformat></item>
</tableterm><tableitem><para><U>00AC</U> Logical negation (ordinary).
Synonym:&nbsp;<code>\lnot</code>. Sometimes instead used for
negation:&nbsp;<code>\sim</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="710" mergedindex="cp">\neq</indexterm>\neq</itemformat></item>
</tableterm><tableitem><para><U>2260</U> Not equal (relation). Synonym:&nbsp;<code>\ne</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="711" mergedindex="cp">\ni</indexterm>\ni</itemformat></item>
</tableterm><tableitem><para><U>220B</U> Reflected membership epsilon; has the member
(relation). Synonym:&nbsp;<code>\owns</code>. Similar: is a member
of&nbsp;<code>\in</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="712" mergedindex="cp">\not</indexterm>\not</itemformat></item>
</tableterm><tableitem><!-- c the "@ "s put in spaces so the not slash doesn't hit the next char. -->
<para><U>0020</U><spacecmd type="spc"/><spacecmd type="spc"/><spacecmd type="spc"/><spacecmd type="spc"/>Long solidus, or slash, used to overstrike a
following operator (relation).
</para>
<para>Many negated operators are available that don&textrsquo;t require <code>\not</code>,
particularly with the <code>amssymb</code> package. For example, <code>\notin</code>
is typographically preferable to <code>\not\in</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="713" mergedindex="cp">\notin</indexterm>\notin</itemformat></item>
</tableterm><tableitem><para><U>2209</U> Not an element of (relation).  Similar: not subset
of&nbsp;<code>\nsubseteq</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="714" mergedindex="cp">\nu</indexterm>\nu</itemformat></item>
</tableterm><tableitem><para><U>03BD</U> Lowercase Greek letter (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="715" mergedindex="cp">\nwarrow</indexterm>\nwarrow</itemformat></item>
</tableterm><tableitem><para><U>2196</U> North-west arrow (relation).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="716" mergedindex="cp">\odot</indexterm>\odot</itemformat></item>
</tableterm><tableitem><para><U>2299</U> Dot inside a circle (binary).  Similar: variable-sized
operator&nbsp;<code>\bigodot</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="717" mergedindex="cp">\oint</indexterm>\oint</itemformat></item>
</tableterm><tableitem><para><U>222E</U> Contour integral, integral with circle in the middle
(operator).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="718" mergedindex="cp">\Omega</indexterm>\Omega</itemformat></item>
</tableterm><tableitem><para><U>03A9</U> uppercase Greek letter (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="719" mergedindex="cp">\omega</indexterm>\omega</itemformat></item>
</tableterm><tableitem><para><U>03C9</U> Lowercase Greek letter (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="720" mergedindex="cp">\ominus</indexterm>\ominus</itemformat></item>
</tableterm><tableitem><para><U>2296</U> Minus sign, or dash, inside a circle (binary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="721" mergedindex="cp">\oplus</indexterm>\oplus</itemformat></item>
</tableterm><tableitem><para><U>2295</U> Plus sign inside a circle (binary).  Similar: variable-sized
operator&nbsp;<code>\bigoplus</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="722" mergedindex="cp">\oslash</indexterm>\oslash</itemformat></item>
</tableterm><tableitem><para><U>2298</U> Solidus, or slash, inside a circle (binary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="723" mergedindex="cp">\otimes</indexterm>\otimes</itemformat></item>
</tableterm><tableitem><para><U>2297</U> Times sign, or cross, inside a circle (binary).  Similar:
variable-sized operator&nbsp;<code>\bigotimes</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="724" mergedindex="cp">\owns</indexterm>\owns</itemformat></item>
</tableterm><tableitem><para><U>220B</U> Reflected membership epsilon; has the member
(relation). Synonym:&nbsp;<code>\ni</code>. Similar: is a member
of&nbsp;<code>\in</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="725" mergedindex="cp">\parallel</indexterm>\parallel</itemformat></item>
</tableterm><tableitem><para><U>2225</U> Parallel (relation). Synonym:&nbsp;<code>\|</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="726" mergedindex="cp">\partial</indexterm>\partial</itemformat></item>
</tableterm><tableitem><para><U>2202</U> Partial differential (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="727" mergedindex="cp">\perp</indexterm>\perp</itemformat></item>
</tableterm><tableitem><para><U>27C2</U> Perpendicular (relation).  Similar:&nbsp;<code>\bot</code> uses the
same glyph but the spacing is different because it is in the class
ordinary.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="728" mergedindex="cp">\Phi</indexterm>\Phi</itemformat></item>
</tableterm><tableitem><para><U>03A6</U> Uppercase Greek letter (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="729" mergedindex="cp">\phi</indexterm>\phi</itemformat></item>
</tableterm><tableitem><para><U>03D5</U> Lowercase Greek letter (ordinary).  The variant form is
<code>\varphi</code>&nbsp;<U>03C6</U>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="730" mergedindex="cp">\Pi</indexterm>\Pi</itemformat></item>
</tableterm><tableitem><para><U>03A0</U> uppercase Greek letter (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="731" mergedindex="cp">\pi</indexterm>\pi</itemformat></item>
</tableterm><tableitem><para><U>03C0</U> Lowercase Greek letter (ordinary).  The variant form is
<code>\varpi</code>&nbsp;<U>03D6</U>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="732" mergedindex="cp">\pm</indexterm>\pm</itemformat></item>
</tableterm><tableitem><para><U>00B1</U> Plus or minus (binary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="733" mergedindex="cp">\prec</indexterm>\prec</itemformat></item>
</tableterm><tableitem><para><U>227A</U> Precedes (relation). Similar: less than&nbsp;<code>&lt;</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="734" mergedindex="cp">\preceq</indexterm>\preceq</itemformat></item>
</tableterm><tableitem><para><U>2AAF</U> Precedes or equals (relation). Similar: less than or
equals&nbsp;<code>\leq</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="735" mergedindex="cp">\prime</indexterm>\prime</itemformat></item>
</tableterm><tableitem><para><U>2032</U> Prime, or minute in a time expression (ordinary).
Typically used as a superscript: <code>$f^\prime$</code>; <code>$f^\prime$</code>
and <code>$f'$</code> produce the same result.  An advantage of the second
is that <code>$f'''$</code> produces the desired symbol, that is, the same
result as <code>$f^&lbrace;\prime\prime\prime&rbrace;$</code>, but uses rather less
typing.  You can only use <code>\prime</code> in math mode.  Using the right
single quote&nbsp;<code>'</code> in text mode produces a different character
(apostrophe).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="736" mergedindex="cp">\prod</indexterm>\prod</itemformat></item>
</tableterm><tableitem><para><U>220F</U> Product (operator).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="737" mergedindex="cp">\propto</indexterm>\propto</itemformat></item>
</tableterm><tableitem><para><U>221D</U> Is proportional to (relation)
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="738" mergedindex="cp">\Psi</indexterm>\Psi</itemformat></item>
</tableterm><tableitem><para><U>03A8</U> uppercase Greek letter (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="739" mergedindex="cp">\psi</indexterm>\psi</itemformat></item>
</tableterm><tableitem><para><U>03C8</U> Lowercase Greek letter (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="740" mergedindex="cp">\rangle</indexterm>\rangle</itemformat></item>
</tableterm><tableitem><para><U>27E9</U> Right angle, or sequence, bracket (closing).
Similar: greater than&nbsp;<code>&gt;</code>. Matches:<code>\langle</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="741" mergedindex="cp">\rbrace</indexterm>\rbrace</itemformat></item>
</tableterm><tableitem><para><U>007D</U> Right curly brace
(closing). Synonym:&nbsp;<code>\&rbrace;</code>. Matches&nbsp;<code>\lbrace</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="742" mergedindex="cp">\rbrack</indexterm>\rbrack</itemformat></item>
</tableterm><tableitem><para><U>005D</U> Right square bracket
(closing). Synonym:&nbsp;<code>]</code>. Matches&nbsp;<code>\lbrack</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="743" mergedindex="cp">\rceil</indexterm>\rceil</itemformat></item>
</tableterm><tableitem><para><U>2309</U> Right ceiling bracket (closing). Matches&nbsp;<code>\lceil</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="744" mergedindex="cp">\Re</indexterm>\Re</itemformat></item>
</tableterm><tableitem><para><U>211C</U> Real part, real numbers, cursive capital R (ordinary). Related:
double-line, or blackboard bold, R&nbsp;<code>\mathbb&lbrace;R&rbrace;</code>; to access
this, load the <code>amsfonts</code> package.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="745" mergedindex="cp">\restriction</indexterm>\restriction</itemformat></item>
</tableterm><tableitem><para><U>21BE</U>, Restriction of a function (relation). Synonym:
<code>\upharpoonright</code>.  Not available in plain &tex;. In &latex; you need to load the <code>amssymb</code> package.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="746" mergedindex="cp">\revemptyset</indexterm>\revemptyset</itemformat></item>
</tableterm><tableitem><para><U>29B0</U>, Reversed empty set symbol (ordinary).  Related:
<code>\varnothing</code>. Not available in plain &tex;. In &latex; you need to load the <file>stix</file> package.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="747" mergedindex="cp">\rfloor</indexterm>\rfloor</itemformat></item>
</tableterm><tableitem><para><U>230B</U> Right floor bracket, a right square bracket with the top cut
off (closing). Matches&nbsp;<code>\lfloor</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="748" mergedindex="cp">\rhd</indexterm>\rhd</itemformat></item>
</tableterm><tableitem><para><U>25C1</U> Arrowhead, that is, triangle, pointing right (binary).
For the normal subgroup symbol you should instead
load <code>amssymb</code> and use&nbsp;<code>\vartriangleright</code> (which is a
relation and so gives better spacing).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="749" mergedindex="cp">\rho</indexterm>\rho</itemformat></item>
</tableterm><tableitem><para><U>03C1</U> Lowercase Greek letter (ordinary).  The variant form is
<code>\varrho</code>&nbsp;<U>03F1</U>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="750" mergedindex="cp">\Rightarrow</indexterm>\Rightarrow</itemformat></item>
</tableterm><tableitem><para><U>21D2</U> Implies, right-pointing double line arrow
(relation). Similar: right single-line arrow&nbsp;<code>\rightarrow</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="751" mergedindex="cp">\rightarrow</indexterm>\rightarrow</itemformat></item>
</tableterm><tableitem><para><U>2192</U> Right-pointing single line arrow (relation).
Synonym:&nbsp;<code>\to</code>. Similar: right double line
arrow&nbsp;<code>\Rightarrow</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="752" mergedindex="cp">\rightharpoondown</indexterm>\rightharpoondown</itemformat></item>
</tableterm><tableitem><para><U>21C1</U> Right-pointing harpoon with barb below
the line (relation). 
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="753" mergedindex="cp">\rightharpoonup</indexterm>\rightharpoonup</itemformat></item>
</tableterm><tableitem><para><U>21C0</U> Right-pointing harpoon with barb above the
line (relation).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="754" mergedindex="cp">\rightleftharpoons</indexterm>\rightleftharpoons</itemformat></item>
</tableterm><tableitem><para><U>21CC</U> Right harpoon up above left harpoon down
(relation).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="755" mergedindex="cp">\searrow</indexterm>\searrow</itemformat></item>
</tableterm><tableitem><para><U>2198</U> Arrow pointing southeast (relation).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="756" mergedindex="cp">\setminus</indexterm>\setminus</itemformat></item>
</tableterm><tableitem><para><U>29F5</U> Set difference, reverse solidus or reverse slash,
like \ (binary). Similar: backslash&nbsp;<code>\backslash</code> and also
<code>\textbackslash</code> outside of math mode.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="757" mergedindex="cp">\sharp</indexterm>\sharp</itemformat></item>
</tableterm><tableitem><para><U>266F</U> Musical sharp (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="758" mergedindex="cp">\Sigma</indexterm>\Sigma</itemformat></item>
</tableterm><tableitem><para><U>03A3</U> uppercase Greek letter (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="759" mergedindex="cp">\sigma</indexterm>\sigma</itemformat></item>
</tableterm><tableitem><para><U>03C3</U> Lowercase Greek letter (ordinary). The variant form is
<code>\varsigma</code>&nbsp;<U>03C2</U>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="760" mergedindex="cp">\sim</indexterm>\sim</itemformat></item>
</tableterm><tableitem><para><U>223C</U> Similar, in a relation (relation).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="761" mergedindex="cp">\simeq</indexterm>\simeq</itemformat></item>
</tableterm><tableitem><para><U>2243</U> Similar or equal to, in a relation (relation).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="762" mergedindex="cp">\smallint</indexterm>\smallint</itemformat></item>
</tableterm><tableitem><para><U>222B</U> Integral sign that does not change to a larger size in a
display (operator).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="763" mergedindex="cp">\smile</indexterm>\smile</itemformat></item>
</tableterm><tableitem><para><U>2323</U> Upward curving arc, smile (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="764" mergedindex="cp">\spadesuit</indexterm>\spadesuit</itemformat></item>
</tableterm><tableitem><para><U>2660</U> Spade card suit (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="765" mergedindex="cp">\sqcap</indexterm>\sqcap</itemformat></item>
</tableterm><tableitem><para><U>2293</U> Square intersection symbol (binary). Similar:
intersection&nbsp;<code>cap</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="766" mergedindex="cp">\sqcup</indexterm>\sqcup</itemformat></item>
</tableterm><tableitem><para><U>2294</U> Square union symbol (binary). Similar:
union&nbsp;<code>cup</code>. Related: variable-sized
operator&nbsp;<code>\bigsqcup</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="767" mergedindex="cp">\sqsubset</indexterm>\sqsubset</itemformat></item>
</tableterm><tableitem><para><U>228F</U>, Square subset symbol (relation). Similar:
subset&nbsp;<code>\subset</code>. Not available in plain &tex;. In &latex; you need to load the <code>amssymb</code> package.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="768" mergedindex="cp">\sqsubseteq</indexterm>\sqsubseteq</itemformat></item>
</tableterm><tableitem><para><U>2291</U> Square subset or equal symbol (binary). Similar: subset or
equal to&nbsp;<code>\subseteq</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="769" mergedindex="cp">\sqsupset</indexterm>\sqsupset</itemformat></item>
</tableterm><tableitem><para><U>2290</U>, Square superset symbol (relation). Similar:
superset&nbsp;<code>\supset</code>. Not available in plain &tex;. In &latex; you need to load the <code>amssymb</code> package.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="770" mergedindex="cp">\sqsupseteq</indexterm>\sqsupseteq</itemformat></item>
</tableterm><tableitem><para><U>2292</U> Square superset or equal symbol (binary).
Similar: superset or equal&nbsp;<code>\supseteq</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="771" mergedindex="cp">\star</indexterm>\star</itemformat></item>
</tableterm><tableitem><para><U>22C6</U> Five-pointed star, sometimes used as a general binary
operation but sometimes reserved for cross-correlation (binary).
Similar: the synonyms asterisk&nbsp;<code>*</code> and <code>\ast</code>, which
are six-pointed, and more often appear as a superscript or subscript,
as with the Kleene star.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="772" mergedindex="cp">\subset</indexterm>\subset</itemformat></item>
</tableterm><tableitem><para><U>2282</U> Subset (occasionally, is implied by) (relation).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="773" mergedindex="cp">\subseteq</indexterm>\subseteq</itemformat></item>
</tableterm><tableitem><para><U>2286</U> Subset or equal to (relation).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="774" mergedindex="cp">\succ</indexterm>\succ</itemformat></item>
</tableterm><tableitem><para><U>227B</U> Comes after, succeeds (relation). Similar: is less
than&nbsp;<code>&gt;</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="775" mergedindex="cp">\succeq</indexterm>\succeq</itemformat></item>
</tableterm><tableitem><para><U>2AB0</U> Succeeds or is equal to (relation). Similar: less
than or equal to&nbsp;<code>\leq</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="776" mergedindex="cp">\sum</indexterm>\sum</itemformat></item>
</tableterm><tableitem><para><U>2211</U> Summation (operator). Similar: Greek capital
sigma&nbsp;<code>\Sigma</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="777" mergedindex="cp">\supset</indexterm>\supset</itemformat></item>
</tableterm><tableitem><para><U>2283</U> Superset (relation).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="778" mergedindex="cp">\supseteq</indexterm>\supseteq</itemformat></item>
</tableterm><tableitem><para><U>2287</U> Superset or equal to (relation).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="779" mergedindex="cp">\surd</indexterm>\surd</itemformat></item>
</tableterm><tableitem><para><U>221A</U> Radical symbol (ordinary).  The &latex; command
<code>\sqrt&lbrace;...&rbrace;</code> typesets the square root of the argument, with a bar
that extends to cover the argument.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="780" mergedindex="cp">\swarrow</indexterm>\swarrow</itemformat></item>
</tableterm><tableitem><para><U>2199</U> Southwest-pointing  arrow (relation).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="781" mergedindex="cp">\tau</indexterm>\tau</itemformat></item>
</tableterm><tableitem><para><U>03C4</U> Lowercase Greek letter (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="782" mergedindex="cp">\theta</indexterm>\theta</itemformat></item>
</tableterm><tableitem><para><U>03B8</U> Lowercase Greek letter (ordinary). The variant form is
<code>\vartheta</code>&nbsp;<U>03D1</U>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="783" mergedindex="cp">\times</indexterm>\times</itemformat></item>
</tableterm><tableitem><para><U>00D7</U> Primary school multiplication sign (binary). See
also&nbsp;<code>\cdot</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="784" mergedindex="cp">\to</indexterm>\to</itemformat></item>
</tableterm><tableitem><para><U>2192</U> Right-pointing single line arrow (relation).
Synonym:&nbsp;<code>\rightarrow</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="785" mergedindex="cp">\top</indexterm>\top</itemformat></item>
</tableterm><tableitem><para><U>22A4</U> Top, greatest element of a partially ordered set
(ordinary). See also&nbsp;<code>\bot</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="786" mergedindex="cp">\triangle</indexterm>\triangle</itemformat></item>
</tableterm><tableitem><para><U>25B3</U> Triangle (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="787" mergedindex="cp">\triangleleft</indexterm>\triangleleft</itemformat></item>
</tableterm><tableitem><para><U>25C1</U> Not-filled triangle pointing left
(binary). Similar:&nbsp;<code>\lhd</code>. For the normal subgroup symbol you
should load <code>amssymb</code> and use&nbsp;<code>\vartriangleleft</code> (which
is a relation and so gives better spacing).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="788" mergedindex="cp">\triangleright</indexterm>\triangleright</itemformat></item>
</tableterm><tableitem><para><U>25B7</U> Not-filled triangle pointing right
(binary). For the normal subgroup symbol you should instead load
<code>amssymb</code> and use&nbsp;<code>\vartriangleright</code> (which is a
relation and so gives better spacing).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="789" mergedindex="cp">\unlhd</indexterm>\unlhd</itemformat></item>
</tableterm><tableitem><para><U>22B4</U> Left-pointing not-filled underlined arrowhead, that is,
triangle, with a line under (binary). For the
normal subgroup symbol load <code>amssymb</code> and
use&nbsp;<code>\vartrianglelefteq</code> (which is a relation and so gives
better spacing).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="790" mergedindex="cp">\unrhd</indexterm>\unrhd</itemformat></item>
</tableterm><tableitem><para><U>22B5</U> Right-pointing not-filled underlined arrowhead, that is,
triangle, with a line under (binary). For the
normal subgroup symbol load <code>amssymb</code> and
use&nbsp;<code>\vartrianglerighteq</code> (which is a relation and so gives
better spacing).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="791" mergedindex="cp">\Uparrow</indexterm>\Uparrow</itemformat></item>
</tableterm><tableitem><para><U>21D1</U> Double-line upward-pointing arrow
(relation). Similar: single-line up-pointing
arrow&nbsp;<code>\uparrow</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="792" mergedindex="cp">\uparrow</indexterm>\uparrow</itemformat></item>
</tableterm><tableitem><para><U>2191</U> Single-line upward-pointing arrow, diverges
(relation). Similar: double-line up-pointing
arrow&nbsp;<code>\Uparrow</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="793" mergedindex="cp">\Updownarrow</indexterm>\Updownarrow</itemformat></item>
</tableterm><tableitem><para><U>21D5</U> Double-line upward-and-downward-pointing arrow
(relation). Similar: single-line upward-and-downward-pointing
arrow&nbsp;<code>\updownarrow</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="794" mergedindex="cp">\updownarrow</indexterm>\updownarrow</itemformat></item>
</tableterm><tableitem><para><U>2195</U> Single-line upward-and-downward-pointing arrow
(relation). Similar: double-line upward-and-downward-pointing
arrow&nbsp;<code>\Updownarrow</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="795" mergedindex="cp">\upharpoonright</indexterm>\upharpoonright</itemformat></item>
</tableterm><tableitem><para><U>21BE</U>, Up harpoon, with barb on right side
(relation). Synonym:&nbsp;<code>&backslashchar;restriction</code>.
Not available in plain &tex;. In &latex; you need to load the <code>amssymb</code> package.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="796" mergedindex="cp">\uplus</indexterm>\uplus</itemformat></item>
</tableterm><tableitem><para><U>228E</U> Multiset union, a union symbol with a plus symbol in
the middle (binary). Similar: union&nbsp;<code>\cup</code>. Related:
variable-sized operator&nbsp;<code>\biguplus</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="797" mergedindex="cp">\Upsilon</indexterm>\Upsilon</itemformat></item>
</tableterm><tableitem><para><U>03A5</U> uppercase Greek letter (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="798" mergedindex="cp">\upsilon</indexterm>\upsilon</itemformat></item>
</tableterm><tableitem><para><U>03C5</U> Lowercase Greek letter (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="799" mergedindex="cp">\varepsilon</indexterm>\varepsilon</itemformat></item>
</tableterm><tableitem><para><U>03B5</U> Small letter script epsilon (ordinary).  This is
more widely used in mathematics than the non-variant lunate epsilon form
<code>\epsilon</code>&nbsp;<U>03F5</U>. Related: set
membership&nbsp;<code>\in</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="800" mergedindex="cp">\vanothing</indexterm>\vanothing</itemformat></item>
</tableterm><tableitem><para><U>2205</U>, Empty set symbol. Similar: <code>\emptyset</code>. Related:
<code>\revemptyset</code>. Not available in plain &tex;. In &latex; you need to load the <code>amssymb</code> package.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="801" mergedindex="cp">\varphi</indexterm>\varphi</itemformat></item>
</tableterm><tableitem><para><U>03C6</U> Variant on the lowercase Greek letter (ordinary).
The non-variant form is <code>\phi</code>&nbsp;<U>03D5</U>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="802" mergedindex="cp">\varpi</indexterm>\varpi</itemformat></item>
</tableterm><tableitem><para><U>03D6</U> Variant on the lowercase Greek letter (ordinary).
The non-variant form is <code>\pi</code>&nbsp;<U>03C0</U>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="803" mergedindex="cp">\varrho</indexterm>\varrho</itemformat></item>
</tableterm><tableitem><para><U>03F1</U> Variant on the lowercase Greek letter (ordinary).
The non-variant form is <code>\rho</code>&nbsp;<U>03C1</U>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="804" mergedindex="cp">\varsigma</indexterm>\varsigma</itemformat></item>
</tableterm><tableitem><para><U>03C2</U> Variant on the lowercase Greek letter
(ordinary).  The non-variant form is
<code>\sigma</code>&nbsp;<U>03C3</U>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="805" mergedindex="cp">\vartheta</indexterm>\vartheta</itemformat></item>
</tableterm><tableitem><para><U>03D1</U> Variant on the lowercase Greek letter
(ordinary).  The non-variant form is
<code>\theta</code>&nbsp;<U>03B8</U>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="806" mergedindex="cp">\vdash</indexterm>\vdash</itemformat></item>
</tableterm><tableitem><para><U>22A2</U> Provable; turnstile, vertical and a dash
(relation). Similar: turnstile rotated a
half-circle&nbsp;<code>\dashv</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="807" mergedindex="cp">\vee</indexterm>\vee</itemformat></item>
</tableterm><tableitem><para><U>2228</U> Logical or; a downwards v shape (binary). Related:
logical and&nbsp;<code>\wedge</code>. Similar: variable-sized
operator&nbsp;<code>\bigvee</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="808" mergedindex="cp">\Vert</indexterm>\Vert</itemformat></item>
</tableterm><tableitem><para><U>2016</U> Vertical double bar (ordinary).  <xref label="Delimiters"><xrefnodename>Delimiters</xrefnodename></xref>,
for how to use the <code>mathtools</code> package to create flexibly-sized
norm symbols.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="809" mergedindex="cp">\vert</indexterm>\vert</itemformat></item>
</tableterm><tableitem><para><U>007C</U> Single line vertical bar (ordinary).  For &textldquo;such
that&textrdquo;, as in the definition of a set, use&nbsp;<code>\mid</code> because it
is a relation. <xref label="Delimiters"><xrefnodename>Delimiters</xrefnodename></xref>, for how to use the <code>mathtools</code>
package to create flexibly-sized absolute-value symbols.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="810" mergedindex="cp">\wedge</indexterm>\wedge</itemformat></item>
</tableterm><tableitem><para><U>2227</U> Logical and (binary).  Synonym:&nbsp;<code>\land</code>.  See also
logical or <code>\vee</code>. Similar: variable-sized
operator&nbsp;<code>\bigwedge</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="811" mergedindex="cp">\wp</indexterm>\wp</itemformat></item>
</tableterm><tableitem><para><U>2118</U> Weierstrass p (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="812" mergedindex="cp">\wr</indexterm>\wr</itemformat></item>
</tableterm><tableitem><para><U>2240</U> Wreath product (binary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="813" mergedindex="cp">\Xi</indexterm>\Xi</itemformat></item>
</tableterm><tableitem><para><U>039E</U> uppercase Greek letter (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="814" mergedindex="cp">\xi</indexterm>\xi</itemformat></item>
</tableterm><tableitem><para><U>03BE</U> Lowercase Greek letter (ordinary).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="815" mergedindex="cp">\zeta</indexterm>\zeta</itemformat></item>
</tableterm><tableitem><para><U>03B6</U> Lowercase Greek letter (ordinary).
</para>
</tableitem></tableentry></ftable>

<para>The following symbols are most often used in plain text but &latex;
provides versions to use in mathematical text.
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="816" mergedindex="cp">\mathdollar</indexterm>\mathdollar</itemformat></item>
</tableterm><tableitem><para>Dollar sign in math mode: $.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="817" mergedindex="cp">\mathparagraph</indexterm>\mathparagraph</itemformat></item>
</tableterm><tableitem><para>Paragraph sign (pilcrow) in math mode, <U>00B6</U>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="818" mergedindex="cp">\mathsection</indexterm>\mathsection</itemformat></item>
</tableterm><tableitem><para>Section sign in math mode <U>00A7</U>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="819" mergedindex="cp">\mathsterling</indexterm>\mathsterling</itemformat></item>
</tableterm><tableitem><para>Sterling sign in math mode: &pound;.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="820" mergedindex="cp">\mathunderscore</indexterm>\mathunderscore</itemformat></item>
</tableterm><tableitem><para>Underscore in math mode: _.
</para>
</tableitem></tableentry></ftable>

<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::                     ">Arrows</menunode><menudescription><pre xml:space="preserve">List of arrows.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::    ">\boldmath &amp; \unboldmath</menunode><menudescription><pre xml:space="preserve">Symbols in boldface.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::            ">Blackboard bold</menunode><menudescription><pre xml:space="preserve">Doublestruck characters.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::               ">Calligraphic</menunode><menudescription><pre xml:space="preserve">Cursive characters.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                 ">Delimiters</menunode><menudescription><pre xml:space="preserve">Parentheses, braces, etc.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                       ">Dots</menunode><menudescription><pre xml:space="preserve">Ellipses, etc.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::              ">Greek letters</menunode><menudescription><pre xml:space="preserve">List of Greek letters.
</pre></menudescription></menuentry></menu>


<node name="Arrows" spaces=" "><nodename>Arrows</nodename><nodenext automatic="on">\boldmath &amp; \unboldmath</nodenext><nodeup automatic="on">Math symbols</nodeup></node>
<subsection spaces=" "><sectiontitle>Arrows</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="583">arrows</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="584">symbols, arrows</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="821" mergedindex="cp">math, arrows</indexterm></findex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="585"><r>package</r>, <code>amsfonts</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="586"><code>amsfonts</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="587"><r>package</r>, <code>latexsym</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="588"><code>latexsym</code> <r>package</r></indexterm></cindex>

<para>These are the arrows that come with standard &latex;.  The
<code>latexsym</code> and <code>amsfonts</code> packages contain many more.
</para>
<multitable spaces="  " endspaces=" "><columnfractions line=".10 .40 .50"><columnfraction value=".10"></columnfraction><columnfraction value=".40"></columnfraction><columnfraction value=".50"></columnfraction></columnfractions>
<thead><row><entry command="headitem" spaces=" "><para>Symbol</para></entry><entry command="tab" spaces=" "><para>Command</para></entry><entry command="tab">   
</entry></row></thead><tbody><row><entry command="item">
<para><U>021D3</U> </para></entry><entry command="tab" spaces=" "><para><code>\Downarrow</code> </para></entry><entry command="tab">
</entry></row><row><entry command="item">
<para><U>02193</U> </para></entry><entry command="tab" spaces=" "><para><code>\downarrow</code> </para></entry><entry command="tab">
</entry></row><row><entry command="item">      
<para><U>021A9</U> </para></entry><entry command="tab" spaces=" "><para><code>\hookleftarrow</code> </para></entry><entry command="tab">
</entry></row><row><entry command="item">  
<para><U>021AA</U> </para></entry><entry command="tab" spaces=" "><para><code>\hookrightarrow</code> </para></entry><entry command="tab">
</entry></row><row><entry command="item">    
<para><U>2190</U> </para></entry><entry command="tab" spaces=" "><para><code>\leftarrow</code> </para></entry><entry command="tab">
</entry></row><row><entry command="item">      
<para><U>021D0</U> </para></entry><entry command="tab" spaces=" "><para><code>\Leftarrow</code> </para></entry><entry command="tab">
</entry></row><row><entry command="item">      
<para><U>021D4</U> </para></entry><entry command="tab" spaces=" "><para><code>\Leftrightarrow</code> </para></entry><entry command="tab">
</entry></row><row><entry command="item"> 
<para><U>02194</U> </para></entry><entry command="tab" spaces=" "><para><code>\leftrightarrow</code> </para></entry><entry command="tab">
</entry></row><row><entry command="item"> 
<para><U>027F5</U> </para></entry><entry command="tab" spaces=" "><para><code>\longleftarrow</code> </para></entry><entry command="tab">
</entry></row><row><entry command="item">     
<para><U>027F8</U> </para></entry><entry command="tab" spaces=" "><para><code>\Longleftarrow</code> </para></entry><entry command="tab">
</entry></row><row><entry command="item">     
<para><U>027F7</U> </para></entry><entry command="tab" spaces=" "><para><code>\longleftrightarrow</code> </para></entry><entry command="tab">
</entry></row><row><entry command="item">
<para><U>027FA</U> </para></entry><entry command="tab" spaces=" "><para><code>\Longleftrightarrow</code> </para></entry><entry command="tab">
</entry></row><row><entry command="item">
<para><U>027FC</U> </para></entry><entry command="tab" spaces=" "><para><code>\longmapsto</code> </para></entry><entry command="tab">
</entry></row><row><entry command="item">        
<para><U>027F9</U> </para></entry><entry command="tab" spaces=" "><para><code>\Longrightarrow</code> </para></entry><entry command="tab">
</entry></row><row><entry command="item">    
<para><U>027F6</U> </para></entry><entry command="tab" spaces=" "><para><code>\longrightarrow</code> </para></entry><entry command="tab">
</entry></row><row><entry command="item">    
<para><U>021A6</U> </para></entry><entry command="tab" spaces=" "><para><code>\mapsto</code> </para></entry><entry command="tab">
</entry></row><row><entry command="item">            
<para><U>02197</U> </para></entry><entry command="tab" spaces=" "><para><code>\nearrow</code> </para></entry><entry command="tab"> 
</entry></row><row><entry command="item">    
<para><U>02196</U> </para></entry><entry command="tab" spaces=" "><para><code>\nwarrow</code> </para></entry><entry command="tab">
</entry></row><row><entry command="item">     
<para><U>021D2</U> </para></entry><entry command="tab" spaces=" "><para><code>\Rightarrow</code> </para></entry><entry command="tab">
</entry></row><row><entry command="item">  
<para><U>02192</U> </para></entry><entry command="tab" spaces=" "><para><code>\rightarrow</code>, or <code>\to</code> </para></entry><entry command="tab">
</entry></row><row><entry command="item">  
<para><U>02198</U> </para></entry><entry command="tab" spaces=" "><para><code>\searrow</code> </para></entry><entry command="tab">
</entry></row><row><entry command="item">     
<para><U>02199</U> </para></entry><entry command="tab" spaces=" "><para><code>\swarrow</code> </para></entry><entry command="tab">
</entry></row><row><entry command="item">     
<para><U>02191</U> </para></entry><entry command="tab" spaces=" "><para><code>\uparrow</code> </para></entry><entry command="tab">
</entry></row><row><entry command="item">     
<para><U>021D1</U> </para></entry><entry command="tab" spaces=" "><para><code>\Uparrow</code> </para></entry><entry command="tab">
</entry></row><row><entry command="item">     
<para><U>02195</U> </para></entry><entry command="tab" spaces=" "><para><code>\updownarrow</code> </para></entry><entry command="tab">
</entry></row><row><entry command="item"> 
<para><U>021D5</U> </para></entry><entry command="tab" spaces=" "><para><code>\Updownarrow</code> </para></entry><entry command="tab">
</entry></row></tbody></multitable>

<para>An example of the difference between <code>\to</code> and <code>\mapsto</code>
is: <code>\( f\colon D\to C \) given by \( n\mapsto n^2 \)</code>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="589"><r>package</r>, <code>amscd</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="590"><code>amscd</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="591"><r>package</r>, <code>tikz-cd</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="592"><code>tikz-cd</code> <r>package</r></indexterm></cindex>

<para>For commutative diagrams there are a number of packages, including
<code>tikz-cd</code> and <code>amscd</code>.
</para>

</subsection>
<node name="_005cboldmath-_0026-_005cunboldmath" spaces=" "><nodename>\boldmath &amp; \unboldmath</nodename><nodenext automatic="on">Blackboard bold</nodenext><nodeprev automatic="on">Arrows</nodeprev><nodeup automatic="on">Math symbols</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\boldmath</code> &amp; <code>\unboldmath</code></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="593">boldface mathematics</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="594">symbols, boldface</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="822" mergedindex="cp">\boldmath</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="823" mergedindex="cp">\unboldmath</indexterm></findex>

<para>Synopsis (used in paragraph mode or LR mode):
</para>
<example endspaces=" ">
<pre xml:space="preserve">\boldmath \( <var>math</var> \)
</pre></example>

<noindent></noindent>
<para>or
</para>
<example endspaces=" ">
<pre xml:space="preserve">\unboldmath \( <var>math</var> \)
</pre></example>

<findex index="fn" spaces=" "><indexterm index="fn" number="824" mergedindex="cp">\boldmath</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="825" mergedindex="cp">\unboldmath</indexterm></findex>
<para>Declarations to change the letters and symbols in <var>math</var> 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 label="Modes"><xrefnodename>Modes</xrefnodename></pxref>). Both commands are fragile
(<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>In this example each <code>\boldmath</code> command takes place inside an
<code>\mbox</code>,
</para>
<example endspaces=" ">
<pre xml:space="preserve">we have $\mbox&lbrace;\boldmath \( v \)&rbrace; = 5\cdot\mbox&lbrace;\boldmath \( u \)$&rbrace;$
</pre></example>

<noindent></noindent>
<para>which means <code>\boldmath</code> is only called in a text mode, here LR
mode, and explains why &latex; must switch to math mode to set <code>v</code>
and <code>u</code>.
</para>
<para>If you use either command inside math mode, as with <code>Trouble: \(
\boldmath x \)</code>, then you get something like <samp>LaTeX Font Warning:
Command \boldmath invalid in math mode on input line 11</samp> and <samp>LaTeX
Font Warning: Command \mathversion invalid in math mode on input line
11</samp>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="595"><r>package</r>, <code>bm</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="596"><code>bm</code> <r>package</r></indexterm></cindex>

<para>There are many issues with <code>\boldmath</code>.  New documents should use
the <code>bm</code> 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
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;bm&rbrace;   % in preamble
...
we have $\bm&lbrace;v&rbrace; = 5\cdot\bm&lbrace;u&rbrace;$
</pre></example>

<noindent></noindent>
<para>shows that it is an improvement over <code>\boldmath</code>.
</para>

</subsection>
<node name="Blackboard-bold" spaces=" "><nodename>Blackboard bold</nodename><nodenext automatic="on">Calligraphic</nodenext><nodeprev automatic="on">\boldmath &amp; \unboldmath</nodeprev><nodeup automatic="on">Math symbols</nodeup></node>
<subsection spaces=" "><sectiontitle>Blackboard bold</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="597">blackboard bold</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="598">doublestruck</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;amssymb&rbrace;   % in preamble
  ... 
\mathbb&lbrace;<var>uppercase-letter</var>&rbrace;
</pre></example>

<para>Provide blackboard bold symbols, sometimes also known as doublestruck
letters, used to denote number sets such as the natural numbers, the
integers, etc.
</para>
<para>Here 
</para>
<example endspaces=" ">
<pre xml:space="preserve">\( \forall n \in \mathbb&lbrace;N&rbrace;, n^2 \geq 0 \)
</pre></example>

<noindent></noindent>
<para>the <code>\mathbb&lbrace;N&rbrace;</code> gives blackboard bold symbol <U>2115</U>,
representing the natural numbers.
</para>
<para>If you use other than an uppercase letter then you do not get an error
but you get strange results, including unexpected characters.
</para>
<para>There are packages that give access to symbols other than just the
capital letters; look on CTAN.
</para>

</subsection>
<node name="Calligraphic" spaces=" "><nodename>Calligraphic</nodename><nodenext automatic="on">Delimiters</nodenext><nodeprev automatic="on">Blackboard bold</nodeprev><nodeup automatic="on">Math symbols</nodeup></node>
<subsection spaces=" "><sectiontitle>Calligraphic</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="599">calligraphic fonts</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="600">script fonts</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="601">fonts, script</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\mathcal&lbrace;<var>uppercase-letters</var>&rbrace;
</pre></example>

<para>Use a script-like font.
</para>
<para>In this example the graph identifier is output in a cursive font.
</para>
<example endspaces=" ">
<pre xml:space="preserve">Let the graph be \( \mathcal&lbrace;G&rbrace; \).
</pre></example>

<para>If you use something other than an uppercase letter then you do not get
an error but you also do not get math calligraphic output.  For instance,
<code>\mathcal&lbrace;g&rbrace;</code> outputs a close curly brace symbol.
</para>

</subsection>
<node name="Delimiters" spaces=" "><nodename>Delimiters</nodename><nodenext automatic="on">Dots</nodenext><nodeprev automatic="on">Calligraphic</nodeprev><nodeup automatic="on">Math symbols</nodeup></node>
<subsection spaces=" "><sectiontitle>Delimiters</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="602">delimiters</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="603">parentheses</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="604">braces</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="605">curly braces</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="606">brackets</indexterm></cindex>

<para>Delimiters are parentheses, braces, or other characters used to mark
the start and end of subformulas.  This formula has three sets of
parentheses delimiting the three subformulas.
</para>
<example endspaces=" ">
<pre xml:space="preserve">(z-z_0)^2 = (x-x_0)^2 + (y-y_0)^2
</pre></example>

<noindent></noindent>
<para>The delimiters do not need to match, so you can enter <code>\( [0,1) \)</code>.
</para>
<para>Here are the common delimiters:
</para>
<multitable spaces="  " endspaces=" "><columnfractions line=".11 .20 .40 .29"><columnfraction value=".11"></columnfraction><columnfraction value=".20"></columnfraction><columnfraction value=".40"></columnfraction><columnfraction value=".29"></columnfraction></columnfractions>
<thead><row><entry command="headitem" spaces=" "><para>Delimiter</para></entry><entry command="tab" spaces=" "><para>Command</para></entry><entry command="tab" spaces=" "><para>Name   
</para></entry></row></thead><tbody><row><entry command="item">
<para>( </para></entry><entry command="tab" spaces=" "><para><code>(</code> </para></entry><entry command="tab" spaces=" "><para>Left parenthesis
</para></entry></row><row><entry command="item">
<para>) </para></entry><entry command="tab" spaces=" "><para><code>)</code> </para></entry><entry command="tab" spaces=" "><para>Right parenthesis
</para></entry></row><row><entry command="item">
<para>\&rbrace; </para></entry><entry command="tab" spaces=" "><para><code>&lbrace;</code> or <code>\lbrace</code> </para></entry><entry command="tab" spaces=" "><para>Left brace
</para></entry></row><row><entry command="item">
<para>\&lbrace; </para></entry><entry command="tab" spaces=" "><para><code>&rbrace;</code> or <code>\rbrace</code> </para></entry><entry command="tab" spaces=" "><para>Right brace
</para></entry></row><row><entry command="item">
<para>[ </para></entry><entry command="tab" spaces=" "><para><code>[</code> or <code>\lbrack</code> </para></entry><entry command="tab" spaces=" "><para>Left bracket
</para></entry></row><row><entry command="item">
<para>] </para></entry><entry command="tab" spaces=" "><para><code>]</code> or <code>\rbrack</code> </para></entry><entry command="tab" spaces=" "><para>Right bracket
</para></entry></row><row><entry command="item">
<para><U>230A</U> </para></entry><entry command="tab" spaces=" "><para><code>\lfloor</code> </para></entry><entry command="tab" spaces=" "><para>Left floor bracket
</para></entry></row><row><entry command="item">
<para><U>230B</U> </para></entry><entry command="tab" spaces=" "><para><code>\rfloor</code> </para></entry><entry command="tab" spaces=" "><para>Right floor bracket
</para></entry></row><row><entry command="item">
<para><U>2308</U> </para></entry><entry command="tab" spaces=" "><para><code>\lceil</code> </para></entry><entry command="tab" spaces=" "><para>Left ceiling bracket
</para></entry></row><row><entry command="item">
<para><U>2309</U> </para></entry><entry command="tab" spaces=" "><para><code>\rceil</code> </para></entry><entry command="tab" spaces=" "><para>Right ceiling bracket
</para></entry></row><row><entry command="item">
<para><U>27E8</U> </para></entry><entry command="tab" spaces=" "><para><code>\langle</code> </para></entry><entry command="tab" spaces=" "><para>Left angle bracket
</para></entry></row><row><entry command="item">
<para><U>27E9</U> </para></entry><entry command="tab" spaces=" "><para><code>\rangle</code> </para></entry><entry command="tab" spaces=" "><para>Right angle bracket
</para></entry></row><row><entry command="item">
<para>/  </para></entry><entry command="tab" spaces=" "><para><code>/</code> </para></entry><entry command="tab" spaces=" "><para>Slash, or forward slash
</para></entry></row><row><entry command="item">
<para>\ </para></entry><entry command="tab" spaces=" "><para><code>\backslash</code> </para></entry><entry command="tab" spaces=" "><para>Reverse slash, or backslash
</para></entry></row><row><entry command="item">
<para>| </para></entry><entry command="tab" spaces=" "><para><code>|</code> or <code>\vert</code> </para></entry><entry command="tab" spaces=" "><para>Vertical bar
</para></entry></row><row><entry command="item">
<para><U>2016</U> </para></entry><entry command="tab" spaces=" "><para><code>\|</code> or <code>\Vert</code> </para></entry><entry command="tab" spaces=" "><para>Double vertical bar
</para></entry></row></tbody></multitable>

<cindex index="cp" spaces=" "><indexterm index="cp" number="607"><r>package</r>, <code>mathtools</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="608"><code>mathtools</code> <r>package</r></indexterm></cindex>

<para>The <code>mathtools</code> package allows you to create commands for paired
delimiters.  For instance, if you put
<code>\DeclarePairedDelimiter\abs&lbrace;\lvert&rbrace;&lbrace;\rvert&rbrace;</code> in your preamble
then you get two commands for single-line vertical bars (they only work
in math mode).  The starred form, such as
<code>\abs*&lbrace;\frac&lbrace;22&rbrace;&lbrace;7&rbrace;&rbrace;</code>, has the height of the vertical bars
match the height of the argument.  The unstarred form, such as
<code>\abs&lbrace;\frac&lbrace;22&rbrace;&lbrace;7&rbrace;&rbrace;</code>, has the bars fixed at a default height.
This form accepts an optional argument, as in <code>\abs[<var>size
command</var>]&lbrace;\frac&lbrace;22&rbrace;&lbrace;7&rbrace;&rbrace;</code>, where the height of the bars is given in
<var>size command</var>, such as <code>\Bigg</code>. Using instead <code>\lVert</code>
and <code>\rVert</code> as the symbols will give you a norm symbol with the
same behavior.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::      ">\left &amp; \right</menunode><menudescription><pre xml:space="preserve">Automatically sized delimiters.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::  ">\bigl &amp; \bigr etc.</menunode><menudescription><pre xml:space="preserve">Manually sized delimiters.
</pre></menudescription></menuentry></menu>


<node name="_005cleft-_0026-_005cright" spaces=" "><nodename>\left &amp; \right</nodename><nodenext automatic="on">\bigl &amp; \bigr etc.</nodenext><nodeup automatic="on">Delimiters</nodeup></node>
<subsubsection spaces=" "><sectiontitle><code>\left</code> &amp; <code>\right</code></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="609">delimiters, paired</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="610">paired delimiters</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="611">matching parentheses</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="612">matching brackets</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="613">null delimiter</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="826" mergedindex="cp">\left</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="827" mergedindex="cp">\right</indexterm></findex>

<!-- c Credit: SE userPhilipp https://tex.stackexchange.com/a/12793 -->

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\left <var>delimiter1</var> ... \right <var>delimiter2</var>
</pre></example>

<para>Make matching parentheses, braces, or other delimiters.  &latex; makes
the delimiters tall enough to just cover the size of the formula that
they enclose.
</para>
<para>This makes a unit vector surrounded by parentheses tall enough to cover
the entries.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;equation&rbrace;
  \left(\begin&lbrace;array&rbrace;&lbrace;c&rbrace;
    1   \\
    0   \\
  \end&lbrace;array&rbrace;\right)
\end&lbrace;equation&rbrace;
</pre></example>

<para><xref label="Delimiters"><xrefnodename>Delimiters</xrefnodename></xref>, for a list of the common delimiters.
</para>
<para>Every <code>\left</code> must have a matching <code>\right</code>.  In the above
example, leaving out the <code>\left(</code> gets the error message
<samp>Extra \right</samp>.  Leaving out the <code>\right)</code> gets <samp>You
can't use `\eqno' in math mode</samp>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="614"><r>package</r>, <code>amsmath</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="615"><code>amsmath</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="616"><r>package</r>, <code>mathtools</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="617"><code>mathtools</code> <r>package</r></indexterm></cindex>

<para>However, <var>delimiter1</var> and <var>delimiter2</var> need not match.  A common
case is that you want an unmatched brace, as below. Use a period,
<samp>.</samp>, as a null delimiter.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;equation&rbrace;
  f(n)=\left\&lbrace;\begin&lbrace;array&rbrace;&lbrace;ll&rbrace;
                1             &amp;\mbox&lbrace;--if \(n=0\)&rbrace; \\
                f(n-1)+3n^2   &amp;\mbox&lbrace;--else&rbrace;       
       \end&lbrace;array&rbrace;\right.
\end&lbrace;equation&rbrace;
</pre></example>

<noindent></noindent>
<para>Note that to get a curly brace as a delimiter you must prefix it with a
backslash, <code>\&lbrace;</code> (<pxref label="Reserved-characters"><xrefnodename>Reserved characters</xrefnodename></pxref>).  (The packages
<code>amsmath</code> and <code>mathtools</code> allow you to get the above
construct through in a <code>cases</code> environment.)
</para>
<para>The <code>\left ... \right</code> pair make a group.  One consequence is that
the formula enclosed in the <code>\left ... \right</code> pair cannot have
line breaks in the output.  This includes both manual line breaks and
&latex;-generated automatic ones.  In this example, &latex; breaks the
equation to make the formula fit the margins.
</para>
<example endspaces=" ">
<pre xml:space="preserve">Lorem ipsum dolor sit amet
\( (a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z) \)
</pre></example>

<noindent></noindent>
<para>But with <code>\left</code> and <code>\right</code>
</para>
<example endspaces=" ">
<pre xml:space="preserve">Lorem ipsum dolor sit amet
\( \left(a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z\right) \)
</pre></example>

<noindent></noindent>
<para>&latex; won&textrsquo;t break the line, causing the formula to extend into the
margin.
</para>
<para>Because <code>\left ... \right</code> make a group, all the usual grouping
rules hold.  Here, the value of <code>\testlength</code> set inside the
equation will be forgotten, and the output is <samp>1.2pt</samp>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newlength&lbrace;\testlength&rbrace; \setlength&lbrace;\testlength&rbrace;&lbrace;1.2pt&rbrace;
\begin&lbrace;equation&rbrace;
  \left( a+b=c \setlength&lbrace;\testlength&rbrace;&lbrace;3.4pt&rbrace; \right)
  \the\testlength
\end&lbrace;equation&rbrace;
</pre></example>

<para>The <code>\left ... \right</code> pair affect the horizontal spacing of the
enclosed formula, in two ways.  The first is that in <code>\( \sin(x) =
\sin\left(x\right) \)</code> the one after the equals sign has more space
around the <code>x</code>.  That&textrsquo;s because <code>\left( ... \right)</code> inserts
an inner node while <code>( ... )</code> inserts an opening node.  The second
way that the pair affect the horizontal spacing is that because they
form a group, the enclosed subformula will be typeset at its natural
width, with no stretching or shrinking to make the line fit better.
</para>
<para>&tex; scales the delimiters according to the height and depth of the
enclosed formula.  Here &latex; grows the brackets to extend the full
height of the integral.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;equation&rbrace;
  \left[ \int_&lbrace;x=r_0&rbrace;^&lbrace;\infty&rbrace; -G\frac&lbrace;Mm&rbrace;&lbrace;r^2&rbrace;\, dr \right] 
\end&lbrace;equation&rbrace;
</pre></example>

<para>Manual sizing is often better.  For instance, although below the rule
has no depth, &tex; will create delimiters that extend far below the
rule.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;equation&rbrace;
  \left( \rule&lbrace;1pt&rbrace;&lbrace;1cm&rbrace; \right)
\end&lbrace;equation&rbrace;
</pre></example>

<noindent></noindent>
<para>&tex; can choose delimiters that are too small, as in <code>\( \left|
|x|+|y| \right| \)</code>.  It can also choose delimiters that are too large,
as here.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;equation&rbrace;
  \left( \sum_&lbrace;0\leq i&lt;n&rbrace; i^k \right)
\end&lbrace;equation&rbrace;
</pre></example>

<noindent></noindent>
<para>A third awkward case is when a long displayed formula is on more than
one line and you must match the sizes of the opening and closing
delimiter; you can&textrsquo;t use <code>\left</code> on the first line and
<code>\right</code> on the last because they must be paired.
</para>
<para>To size the delimiters manually, see&nbsp;<ref label="_005cbigl-_0026-_005cbigr-etc_002e"><xrefnodename>\bigl &amp; \bigr etc.</xrefnodename></ref>.
</para>

</subsubsection>
<node name="_005cbigl-_0026-_005cbigr-etc_002e" spaces=" "><nodename>\bigl &amp; \bigr etc.</nodename><nodeprev automatic="on">\left &amp; \right</nodeprev><nodeup automatic="on">Delimiters</nodeup></node>
<subsubsection spaces=" "><sectiontitle><code>\bigl</code>, <code>\bigr</code>, etc.</sectiontitle>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\bigl<inlinefmt><inlinefmtformat>info</inlinefmtformat></inlinefmt><var>delimiter1</var> ... \bigr<inlinefmt><inlinefmtformat>info</inlinefmtformat></inlinefmt><var>delimiter2</var>
\Bigl<inlinefmt><inlinefmtformat>info</inlinefmtformat></inlinefmt><var>delimiter1</var> ... \bigr<inlinefmt><inlinefmtformat>info</inlinefmtformat></inlinefmt><var>delimiter2</var>
\biggl<inlinefmt><inlinefmtformat>info</inlinefmtformat></inlinefmt><var>delimiter1</var> ... \biggr<inlinefmt><inlinefmtformat>info</inlinefmtformat></inlinefmt><var>delimiter2</var>
\Biggl<inlinefmt><inlinefmtformat>info</inlinefmtformat></inlinefmt><var>delimiter1</var> ... \Biggr<inlinefmt><inlinefmtformat>info</inlinefmtformat></inlinefmt><var>delimiter2</var>  
</pre></example>

<noindent></noindent>
<para>(as with <code>\bigl[...\bigr]</code>; strictly speaking they need not be
paired, see below), or one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\bigm<inlinefmt><inlinefmtformat>info</inlinefmtformat></inlinefmt><var>delimiter</var>
\Bigm<inlinefmt><inlinefmtformat>info</inlinefmtformat></inlinefmt><var>delimiter</var>
\biggm<inlinefmt><inlinefmtformat>info</inlinefmtformat></inlinefmt><var>delimiter</var>
\Biggm<inlinefmt><inlinefmtformat>info</inlinefmtformat></inlinefmt><var>delimiter</var>
</pre></example>

<noindent></noindent>
<para>(as with <code>\bigm|</code>), or one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\big<inlinefmt><inlinefmtformat>info</inlinefmtformat></inlinefmt><var>delimiter</var>
\Big<inlinefmt><inlinefmtformat>info</inlinefmtformat></inlinefmt><var>delimiter</var>
\bigg<inlinefmt><inlinefmtformat>info</inlinefmtformat></inlinefmt><var>delimiter</var>
\Bigg<inlinefmt><inlinefmtformat>info</inlinefmtformat></inlinefmt><var>delimiter</var>
</pre></example>

<noindent></noindent>
<para>(as with <code>\big[</code>).
</para>
<para>Produce manually-sized delimiters.  For delimiters that are
automatically sized see&nbsp;<ref label="_005cleft-_0026-_005cright"><xrefnodename>\left &amp; \right</xrefnodename></ref>).
</para>
<para>This produces slightly larger outer vertical bars.
</para>
<example endspaces=" ">
<pre xml:space="preserve">  \bigl| |x|+|y| \bigr|
</pre></example>

<para>The commands above are listed in order of increasing size.  You can use
the smallest size such as <code>\bigl...\bigr</code> in a paragraph without
causing &latex; to spread the lines apart.  The larger sizes are meant
for displayed equations.
</para>
<para><xref label="Delimiters"><xrefnodename>Delimiters</xrefnodename></xref>, for a list of the common delimiters.  In the family of
commands with <samp>l</samp> or&nbsp;<samp>r</samp>, <var>delimiter1</var> and
<var>delimiter2</var> need not match together.
</para>
<para>The <samp>l</samp> and <samp>r</samp> commands produce open and close delimiters
that insert no horizontal space between a preceding atom and the
delimiter, while the commands without <samp>l</samp> and <samp>r</samp> insert some
space (because each delimiter is set as an ordinary variable).  Compare
these two.
</para>
<!-- c credit: Martin Heller https://tex.stackexchange.com/a/1234  -->
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;tabular&rbrace;&lbrace;l&rbrace;
  \(\displaystyle \sin\biggl(\frac&lbrace;1&rbrace;&lbrace;2&rbrace;\biggr) \)  \\  % good
  \(\displaystyle \sin\bigg(\frac&lbrace;1&rbrace;&lbrace;2&rbrace;\bigg)  \)   \\  % bad
\end&lbrace;tabular&rbrace;
</pre></example>

<noindent></noindent>
<para>The traditional typographic treatment is on the first line.  On the
second line the output will have some extra space between the
<code>\sin</code> and the open parenthesis.
</para>
<para>Commands without <samp>l</samp> or&nbsp;<samp>r</samp> do give correct spacing in
some circumstances, as with this large vertical line
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;equation&rbrace;
  \int_&lbrace;x=a&rbrace;^b x^2\,dx = \frac&lbrace;1&rbrace;&lbrace;3&rbrace; x^3 \Big|_&lbrace;x=a&rbrace;^b
\end&lbrace;equation&rbrace;
</pre></example>

<cindex index="cp" spaces=" "><indexterm index="cp" number="618"><r>package</r>, <code>amsmath</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="619"><code>amsmath</code> <r>package</r></indexterm></cindex>

<noindent></noindent>
<para>(many authors would replace <code>\frac</code> with the <code>\tfrac</code> command
from the <code>amsmath</code> package), and as with this larger slash.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;equation&rbrace;
  \lim_&lbrace;n\to\infty&rbrace;\pi(n) \big/ (n/\log n) = 1
\end&lbrace;equation&rbrace;
</pre></example>

<para>Unlike the <code>\left...\right</code> pair (<pxref label="_005cleft-_0026-_005cright"><xrefnodename>\left &amp; \right</xrefnodename></pxref>), the
commands here with <samp>l</samp> or&nbsp;<samp>r</samp> do not make a group.
Strictly speaking they need not be matched so you can write something
like this.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;equation&rbrace;
  \Biggl[ \pi/6 ] 
\end&lbrace;equation&rbrace;
</pre></example>

<para>The commands with <samp>m</samp> are for relations, which are in the middle of
formulas, as here.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;equation&rbrace;
  \biggl\&lbrace; a\in B \biggm| a=\sum_&lbrace;0\leq i&lt;n&rbrace;3i^2+4 \biggr\&rbrace;
\end&lbrace;equation&rbrace;  
</pre></example>

<!-- c xx Add discussion \bigg\mid not being good -->
<!-- c and \bigg| being right; maybe mention of \middle and braket package? -->


</subsubsection>
</subsection>
<node name="Dots" spaces=" "><nodename>Dots</nodename><nodenext automatic="on">Greek letters</nodenext><nodeprev automatic="on">Delimiters</nodeprev><nodeup automatic="on">Math symbols</nodeup></node>
<subsection spaces=" "><sectiontitle>Dots, horizontal or vertical</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="620">ellipses</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="621">dots</indexterm></cindex>

<para>Ellipses are the three dots (usually three) indicating that a pattern
continues.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;array&rbrace;&lbrace;cccc&rbrace;
  a_&lbrace;0,0&rbrace;    &amp;a_&lbrace;0,1&rbrace;   &amp;a_&lbrace;0,2&rbrace; &amp;\ldots \\
  a_&lbrace;1,0&rbrace;    &amp;\ddots                     \\
  \vdots
\end&lbrace;array&rbrace;
</pre></example>

<para>&latex; provides these.
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<beforefirstitem><anchor name="ellipses-cdots">ellipses cdots</anchor>
</beforefirstitem><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="828" mergedindex="cp">\cdots</indexterm>\cdots</itemformat></item>
</tableterm><tableitem><para>Horizontal ellipsis with the dots raised to the center of the line, as
in <U>22EF</U>.  Used as: <code>\( a_0\cdot a_1\cdots a_&lbrace;n-1&rbrace;
\)</code>.
</para>
<anchor name="ellipses-ddots">ellipses ddots</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="829" mergedindex="cp">\ddots</indexterm>\ddots</itemformat></item>
</tableterm><tableitem><para>Diagonal ellipsis, <U>22F1</U>.  See the above array example for a
usage.
</para>
<anchor name="ellipses-ldots">ellipses ldots</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="830" mergedindex="cp">\ldots</indexterm>\ldots</itemformat></item>
</tableterm><tableitem><para>Ellipsis on the baseline, <U>2026</U>.  Used as: <code>\(
x_0,\ldots x_&lbrace;n-1&rbrace; \)</code>.  Another example is the above array example. A
synonym is <code>\mathellipsis</code>.  A synonym from the <code>amsmath</code>
package is <code>\hdots</code>.
</para>
<para>You can also use this command outside of mathematical text, as in
<code>The gears, brakes, \ldots&lbrace;&rbrace; are all broken</code>.  (In a paragraph
mode or LR mode a synonym for <code>\ldots</code> is <code>\dots</code>.)
</para>
<anchor name="ellipses-vdots">ellipses vdots</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="831" mergedindex="cp">\vdots</indexterm>\vdots</itemformat></item>
</tableterm><tableitem><para>Vertical ellipsis, <U>22EE</U>.  See the above array example for a
usage.
</para>
</tableitem></tableentry></ftable>

<cindex index="cp" spaces=" "><indexterm index="cp" number="622"><r>package</r>, <code>amsmath</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="623"><code>amsmath</code> <r>package</r></indexterm></cindex>

<para>The <code>amsmath</code> package has the command <code>\dots</code> to semantically
mark up ellipses.  This example produces two different-looking outputs
for the first two uses of the <code>\dots</code> command.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;amsmath&rbrace;  % in preamble
  ...
Suppose that \( p_0, p_1, \dots, p_&lbrace;n-1&rbrace; \) lists all of the primes.
Observe that \( p_0\cdot p_1 \dots \cdot p_&lbrace;n-1&rbrace; +1 \) is not a
  multiple of any \( p_i \).
Conclusion: there are infinitely many primes \( p_0, p_1, \dotsc \).
</pre></example>

<noindent></noindent>
<para>In the first line &latex; looks to the comma following <code>\dots</code> to
determine that it should output an ellipsis on the baseline.  The second
line has a <code>\cdot</code> following <code>\dots</code> 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</code> if you need the
ellipsis appropriate for a comma following, <code>\dotsb</code> if you need
the ellipses that fits when the dots are followed by a binary operator
or relation symbol, <code>\dotsi</code> for dots with integrals, or
<code>\dotso</code> for others.
</para>

</subsection>
<node name="Greek-letters" spaces=" "><nodename>Greek letters</nodename><nodeprev automatic="on">Dots</nodeprev><nodeup automatic="on">Math symbols</nodeup></node>
<subsection spaces=" "><sectiontitle>Greek letters</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="624">Greek letters</indexterm></cindex>

<para>The upper case versions of these Greek letters are only shown when they
differ from Roman upper case letters.
</para>
<multitable spaces="  " endspaces=" "><columnfractions line=".10 .30 .15 .45"><columnfraction value=".10"></columnfraction><columnfraction value=".30"></columnfraction><columnfraction value=".15"></columnfraction><columnfraction value=".45"></columnfraction></columnfractions>
<thead><row><entry command="headitem" spaces=" "><para>Symbol</para></entry><entry command="tab" spaces=" "><para>Command</para></entry><entry command="tab" spaces=" "><para>Name</para></entry><entry command="tab">  
</entry></row></thead><tbody><row><entry command="item">
<para><U>03B1</U></para></entry><entry command="tab" spaces=" "><para><code>\alpha</code></para></entry><entry command="tab" spaces=" "><para>Alpha
</para></entry></row><row><entry command="item">
<para><U>03B2</U></para></entry><entry command="tab" spaces="  "><para><code>\beta</code></para></entry><entry command="tab" spaces=" "><para>Beta
</para></entry></row><row><entry command="item">
<para><U>03B3</U>, <U>0393</U></para></entry><entry command="tab" spaces=" "><para><code>\gamma</code>, <code>\Gamma</code></para></entry><entry command="tab" spaces=" "><para>Gamma
</para></entry></row><row><entry command="item">
<para><U>03B4</U>, <U>0394</U></para></entry><entry command="tab" spaces=" "><para><code>\delta</code>, <code>\Delta</code></para></entry><entry command="tab" spaces=" "><para>Delta
</para></entry></row><row><entry command="item">
<para><U>03B5</U>, <U>03F5</U></para></entry><entry command="tab">
  <para><code>\varepsilon</code>, <code>\epsilon</code></para></entry><entry command="tab" spaces=" "><para>Epsilon
</para></entry></row><row><entry command="item">
<para><U>03B6</U></para></entry><entry command="tab" spaces=" "><para><code>\zeta</code></para></entry><entry command="tab" spaces=" "><para>Zeta
</para></entry></row><row><entry command="item">
<para><U>03B7</U></para></entry><entry command="tab" spaces=" "><para><code>\eta</code></para></entry><entry command="tab" spaces=" "><para>Eta
</para></entry></row><row><entry command="item">
<para><U>03B8</U>, <U>03D1</U></para></entry><entry command="tab" spaces=" "><para><code>\theta</code>, <code>\vartheta</code></para></entry><entry command="tab">
  <para>Theta
</para></entry></row><row><entry command="item">
<para><U>03B9</U></para></entry><entry command="tab" spaces=" "><para><code>\iota</code></para></entry><entry command="tab" spaces=" "><para>Iota
</para></entry></row><row><entry command="item">
<para><U>03BA</U></para></entry><entry command="tab" spaces=" "><para><code>\kappa</code></para></entry><entry command="tab" spaces=" "><para>Kappa
</para></entry></row><row><entry command="item">
<para><U>03BB</U>, <U>039B</U></para></entry><entry command="tab" spaces=" "><para><code>\lambda</code>, <code>\Lambda</code></para></entry><entry command="tab">
  <para>Lambda
</para></entry></row><row><entry command="item">
<para><U>03BC</U></para></entry><entry command="tab" spaces=" "><para><code>\mu</code></para></entry><entry command="tab" spaces=" "><para>Mu
</para></entry></row><row><entry command="item">
<para><U>03BD</U></para></entry><entry command="tab" spaces=" "><para><code>\nu</code></para></entry><entry command="tab" spaces=" "><para>Nu
</para></entry></row><row><entry command="item">
<para><U>03BE</U>, <U>039E</U></para></entry><entry command="tab" spaces=" "><para><code>\xi</code>, <code>\Xi</code></para></entry><entry command="tab" spaces=" "><para>Xi
</para></entry></row><row><entry command="item">
<para><U>03C0</U>, <U>03A0</U></para></entry><entry command="tab" spaces=" "><para><code>\pi</code>, <code>\Pi</code></para></entry><entry command="tab" spaces=" "><para>Pi
</para></entry></row><row><entry command="item">
<para><U>03C1</U>, <U>03F1</U></para></entry><entry command="tab" spaces=" "><para><code>\rho</code>, <code>\varrho</code></para></entry><entry command="tab" spaces=" "><para>Rho
</para></entry></row><row><entry command="item">
<para><U>03C3</U>, <U>03A3</U></para></entry><entry command="tab" spaces=" "><para><code>\sigma</code>, <code>\Sigma</code></para></entry><entry command="tab" spaces=" "><para>Sigma
</para></entry></row><row><entry command="item">
<para><U>03C4</U></para></entry><entry command="tab" spaces=" "><para><code>\tau</code></para></entry><entry command="tab" spaces=" "><para>Tau
</para></entry></row><row><entry command="item">
<para><U>03D5</U>, <U>03C6</U>, <U>03A6</U></para></entry><entry command="tab">
  <para><code>\phi</code>, <code>\varphi</code>, <code>\Phi</code></para></entry><entry command="tab" spaces=" "><para>Phi
</para></entry></row><row><entry command="item">
<para><U>03C7</U></para></entry><entry command="tab" spaces=" "><para><code>\chi</code></para></entry><entry command="tab" spaces=" "><para>chi
</para></entry></row><row><entry command="item">
<para><U>03C8</U>, <U>03A8</U></para></entry><entry command="tab" spaces=" "><para><code>\psi</code>, <code>\Psi</code></para></entry><entry command="tab" spaces=" "><para>Psi
</para></entry></row><row><entry command="item">
<para><U>03C9</U>, <U>03A9</U></para></entry><entry command="tab" spaces=" "><para><code>\omega</code>, <code>\Omega</code></para></entry><entry command="tab" spaces=" "><para>Omega
</para></entry></row></tbody></multitable>

<cindex index="cp" spaces=" "><indexterm index="cp" number="625"><r>package</r>, <code>unicode-math</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="626"><code>unicode-math</code> <r>package</r></indexterm></cindex>

<para>For omicron, if you are using &latex;&textrsquo;s default Computer Modern font
then enter omicron just as <samp>o</samp> or <samp>O</samp>.  If you like having the
name or if your font shows a difference then you can use something like
<code>\newcommand\omicron&lbrace;o&rbrace;</code>.  The package <code>unicode-math</code> has
<code>\upomicron</code> for upright omicron and <code>\mitomicron</code> for math
italic.
</para>
<para>While the set membership relation symbol <U>2208</U> generated by
<code>\in</code> is related to epsilon, it is never used for a variable.
</para>

</subsection>
</section>
<node name="Math-functions" spaces=" "><nodename>Math functions</nodename><nodenext automatic="on">Math accents</nodenext><nodeprev automatic="on">Math symbols</nodeprev><nodeup automatic="on">Math formulas</nodeup></node>
<section spaces=" "><sectiontitle>Math functions</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="627">math functions</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="628">functions, math</indexterm></cindex>

<para>These commands produce roman function names in math mode with proper
spacing.
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="832" mergedindex="cp">\arccos</indexterm>\arccos</itemformat></item>
</tableterm><tableitem><para>Inverse cosine
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="833" mergedindex="cp">\arcsin</indexterm>\arcsin</itemformat></item>
</tableterm><tableitem><para>Inverse sine
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="834" mergedindex="cp">\arctan</indexterm>\arctan</itemformat></item>
</tableterm><tableitem><para>Inverse tangent
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="835" mergedindex="cp">\arg</indexterm>\arg</itemformat></item>
</tableterm><tableitem><para>Angle between the real axis and a point in the complex plane
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="836" mergedindex="cp">\bmod</indexterm>\bmod</itemformat></item>
</tableterm><tableitem><para>Binary modulo operator, used as in <code>\( 5\bmod 3=2 \)</code>
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="837" mergedindex="cp">\cos</indexterm>\cos</itemformat></item>
</tableterm><tableitem><para>Cosine
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="838" mergedindex="cp">\cosh</indexterm>\cosh</itemformat></item>
</tableterm><tableitem><para>Hyperbolic cosine
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="839" mergedindex="cp">\cot</indexterm>\cot</itemformat></item>
</tableterm><tableitem><para>Cotangent
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="840" mergedindex="cp">\coth</indexterm>\coth</itemformat></item>
</tableterm><tableitem><para>Hyperbolic cotangent
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="841" mergedindex="cp">\csc</indexterm>\csc</itemformat></item>
</tableterm><tableitem><para>Cosecant
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="842" mergedindex="cp">\deg</indexterm>\deg</itemformat></item>
</tableterm><tableitem><para>Degrees
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="843" mergedindex="cp">\det</indexterm>\det</itemformat></item>
</tableterm><tableitem><para>Determinant
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="844" mergedindex="cp">\dim</indexterm>\dim</itemformat></item>
</tableterm><tableitem><para>Dimension
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="845" mergedindex="cp">\exp</indexterm>\exp</itemformat></item>
</tableterm><tableitem><para>Exponential
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="846" mergedindex="cp">\gcd</indexterm>\gcd</itemformat></item>
</tableterm><tableitem><para>Greatest common divisor
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="847" mergedindex="cp">\hom</indexterm>\hom</itemformat></item>
</tableterm><tableitem><para>Homomorphism
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="848" mergedindex="cp">\inf</indexterm>\inf</itemformat></item>
</tableterm><tableitem><para>Infinum
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="849" mergedindex="cp">\ker</indexterm>\ker</itemformat></item>
</tableterm><tableitem><para>Kernel
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="850" mergedindex="cp">\lg</indexterm>\lg</itemformat></item>
</tableterm><tableitem><para>Base 2 logarithm
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="851" mergedindex="cp">\lim</indexterm>\lim</itemformat></item>
</tableterm><tableitem><para>Limit
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="852" mergedindex="cp">\liminf</indexterm>\liminf</itemformat></item>
</tableterm><tableitem><para>Limit inferior
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="853" mergedindex="cp">\limsup</indexterm>\limsup</itemformat></item>
</tableterm><tableitem><para>Limit superior
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="854" mergedindex="cp">\ln</indexterm>\ln</itemformat></item>
</tableterm><tableitem><para>Natural logarithm
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="855" mergedindex="cp">\log</indexterm>\log</itemformat></item>
</tableterm><tableitem><para>Logarithm
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="856" mergedindex="cp">\max</indexterm>\max</itemformat></item>
</tableterm><tableitem><para>Maximum
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="857" mergedindex="cp">\min</indexterm>\min</itemformat></item>
</tableterm><tableitem><para>Minimum
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="858" mergedindex="cp">\pmod</indexterm>\pmod</itemformat></item>
</tableterm><tableitem><para>Parenthesized modulus, as used in <code>\( 5\equiv 2\pmod 3 \)</code>
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="859" mergedindex="cp">\Pr</indexterm>\Pr</itemformat></item>
</tableterm><tableitem><para>Probability
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="860" mergedindex="cp">\sec</indexterm>\sec</itemformat></item>
</tableterm><tableitem><para>Secant
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="861" mergedindex="cp">\sin</indexterm>\sin</itemformat></item>
</tableterm><tableitem><para>Sine
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="862" mergedindex="cp">\sinh</indexterm>\sinh</itemformat></item>
</tableterm><tableitem><para>Hyperbolic sine
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="863" mergedindex="cp">\sup</indexterm>\sup</itemformat></item>
</tableterm><tableitem><para>sup
<!-- 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. -->
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="864" mergedindex="cp">\tan</indexterm>\tan</itemformat></item>
</tableterm><tableitem><para>Tangent
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="865" mergedindex="cp">\tanh</indexterm>\tanh</itemformat></item>
</tableterm><tableitem><para>Hyperbolic tangent
</para>
</tableitem></tableentry></ftable>

<cindex index="cp" spaces=" "><indexterm index="cp" number="629"><r>package</r>, <code>amsmath</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="630"><code>amsmath</code> <r>package</r></indexterm></cindex>

<para>The <code>amsmath</code> 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&lbrace;\identity&rbrace;&lbrace;id&rbrace;</code> that is like the ones
above but prints as <samp>id</samp>.  The starred form
<code>\DeclareMathOperator*&lbrace;\op&rbrace;&lbrace;op&rbrace;</code> sets any limits above and
below, as is traditional with <code>\lim</code>, <code>\sup</code>, or <code>\max</code>.
</para>

</section>
<node name="Math-accents" spaces=" "><nodename>Math accents</nodename><nodenext automatic="on">Over- and Underlining</nodenext><nodeprev automatic="on">Math functions</nodeprev><nodeup automatic="on">Math formulas</nodeup></node>
<section spaces=" "><sectiontitle>Math accents</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="631">math accents</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="632">accents, mathematical</indexterm></cindex>

<para>&latex; provides a variety of commands for producing accented letters
in math.  These are different from accents in normal text
(<pxref label="Accents"><xrefnodename>Accents</xrefnodename></pxref>).
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="866" mergedindex="cp">\acute</indexterm>\acute</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="633">acute accent, math</indexterm></cindex>
<para>Math acute accent
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="867" mergedindex="cp">\bar</indexterm>\bar</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="634">bar-over accent, math</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="635">macron accent, math</indexterm></cindex>
<para>Math bar-over accent
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="868" mergedindex="cp">\breve</indexterm>\breve</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="636">breve accent, math</indexterm></cindex>
<para>Math breve accent
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="869" mergedindex="cp">\check</indexterm>\check</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="637">check accent, math</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="638">h<accent type="acute" bracketed="off">a</accent><accent type="caron">c</accent>ek accent, math</indexterm></cindex>
<para>Math h<accent type="acute" bracketed="off">a</accent><accent type="caron">c</accent>ek (check) accent
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="870" mergedindex="cp">\ddot</indexterm>\ddot</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="639">double dot accent, math</indexterm></cindex>
<para>Math dieresis accent
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="871" mergedindex="cp">\dot</indexterm>\dot</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="640">overdot accent, math</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="641">dot over accent, math</indexterm></cindex>
<para>Math dot accent
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="872" mergedindex="cp">\grave</indexterm>\grave</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="642">grave accent, math</indexterm></cindex>
<para>Math grave accent
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="873" mergedindex="cp">\hat</indexterm>\hat</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="643">hat accent, math</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="644">circumflex accent, math</indexterm></cindex>
<para>Math hat (circumflex) accent
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="874" mergedindex="cp">\mathring</indexterm>\mathring</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="645">ring accent, math</indexterm></cindex>
<para>Math ring accent  <!-- c don't bother implementing in texinfo -->
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="875" mergedindex="cp">\tilde</indexterm>\tilde</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="646">tilde accent, math</indexterm></cindex>
<para>Math tilde accent
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="876" mergedindex="cp">\vec</indexterm>\vec</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="647">vector symbol, math</indexterm></cindex>
<para>Math vector symbol
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="877" mergedindex="cp">\widehat</indexterm>\widehat</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="648">wide hat accent, math</indexterm></cindex>
<para>Math wide hat accent
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="878" mergedindex="cp">\widetilde</indexterm>\widetilde</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="649">wide tilde accent, math</indexterm></cindex>
<para>Math wide tilde accent
</para>
</tableitem></tableentry></ftable>

<para>When you are putting an accent on an i or a j, the tradition is to use
one without a dot, <code>\imath</code> or <code>jmath</code> (<pxref label="Math-symbols"><xrefnodename>Math symbols</xrefnodename></pxref>).
</para>

</section>
<node name="Over_002d-and-Underlining" spaces=" "><nodename>Over- and Underlining</nodename><nodenext automatic="on">Spacing in math mode</nodenext><nodeprev automatic="on">Math accents</nodeprev><nodeup automatic="on">Math formulas</nodeup></node>
<section spaces=" "><sectiontitle>Over- and Underlining</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="650">overlining</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="651">underlining</indexterm></cindex>

<para>&latex; provides commands for making overlines or underlines, or
putting braces over or under some material.
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<beforefirstitem>
</beforefirstitem><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="879" mergedindex="cp">\underline&lbrace;<var>text</var>&rbrace;</indexterm>\underline&lbrace;<var>text</var>&rbrace;</itemformat></item>
</tableterm><tableitem><para>Underline <var>text</var>.  Works inside math mode, and outside.
The line is always completely below the text, taking account of
descenders, so in <code>\(\underline&lbrace;y&rbrace;\)</code> the line is lower than in
<code>\(\underline&lbrace;x&rbrace;\)</code>.  This command is fragile (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="652"><r>package</r>, <code>ulem</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="653"><code>ulem</code> <r>package</r></indexterm></cindex>

<para>Note that the package <code>ulem</code> does text mode underlining and allows
line breaking as well as a number of other features.  See the
documentation on CTAN.  See also&nbsp;<ref label="_005chrulefill-_0026-_005cdotfill"><xrefnodename>\hrulefill &amp; \dotfill</xrefnodename></ref> for
producing a line, for such things as a signature.
</para>        
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="880" mergedindex="cp">\overline&lbrace;<var>text</var>&rbrace;</indexterm>\overline&lbrace;<var>text</var>&rbrace;</itemformat></item>
</tableterm><tableitem><para>Put a horizontal line over <var>text</var>.  Works inside math mode, and
outside.  For example, <code>\overline&lbrace;x+y&rbrace;</code>.
Note that this differs from the command <code>\bar</code> (<pxref label="Math-accents"><xrefnodename>Math
accents</xrefnodename></pxref>).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="881" mergedindex="cp">\underbrace&lbrace;<var>math</var>&rbrace;</indexterm>\underbrace&lbrace;<var>math</var>&rbrace;</itemformat></item>
</tableterm><tableitem><para>Put a brace under <var>math</var>. For example, this
<code>(1-\underbrace&lbrace;1/2)+(1/2&rbrace;-1/3)</code> emphasizes the telescoping part.
Attach text to the brace by using subscript, <code>_</code>, or superscript,
<code>^</code>, as here.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;displaymath&rbrace;
  1+1/2+\underbrace&lbrace;1/3+1/4&rbrace;_&lbrace;&gt;1/2&rbrace;+
       \underbrace&lbrace;1/5+1/6+1/7+1/8&rbrace;_&lbrace;&gt;1/2&rbrace;+\cdots
\end&lbrace;displaymath&rbrace;
</pre></example>

<para>The superscript appears on top of the expression, and so can look
unconnected to the underbrace.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="882" mergedindex="cp">\overbrace&lbrace;<var>math</var>&rbrace;</indexterm>\overbrace&lbrace;<var>math</var>&rbrace;</itemformat></item>
</tableterm><tableitem><para>Put a brace over <var>math</var>, as with
<code>\overbrace&lbrace;x+x+\cdots+x&rbrace;^&lbrace;\mbox&lbrace;\(k\) times&rbrace;&rbrace;</code>.  See also
<code>\underbrace</code>.
</para>
</tableitem></tableentry></ftable>

<cindex index="cp" spaces=" "><indexterm index="cp" number="654"><r>package</r>, <code>mathtools</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="655"><code>mathtools</code> <r>package</r></indexterm></cindex>

<para>The package <code>mathtools</code> adds an over- and underbrace, as well as
some improvements on the braces.  See the documentation on CTAN.
</para>

</section>
<node name="Spacing-in-math-mode" spaces=" "><nodename>Spacing in math mode</nodename><nodenext automatic="on">Math styles</nodenext><nodeprev automatic="on">Over- and Underlining</nodeprev><nodeup automatic="on">Math formulas</nodeup></node>
<section spaces=" "><sectiontitle>Spacing in math mode</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="656">spacing within math mode</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="657">math mode, spacing</indexterm></cindex>

<para>When typesetting mathematics, &latex; puts in spacing according to the
normal rules for mathematics texts.  If you enter <code>y=m x</code> then
&latex; ignores the space and in the output the m is next to the x,
as <math>y=mx</math>.
</para>
<para>But &latex;&textrsquo;s rules occasionally need tweaking.  For example, in an
integral the tradition is to put a small extra space between the
<code>f(x)</code> and the <code>dx</code>, here done with the <code>\,</code> command:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\int_0^1 f(x)\,dx
</pre></example>

<para>&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</dfn>.  It is defined as 1/18<dmn>em</dmn>, where the em is taken from the
current math symbols family (<pxref label="Units-of-length"><xrefnodename>Units of length</xrefnodename></pxref>).  Thus, a
<code>\thickspace</code> is something like 5/18 times the width of
a&nbsp;<samp>M</samp>.
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">\;</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="883" mergedindex="cp">\;</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="884" mergedindex="cp">\thickspace</indexterm></findex>
<anchor name="spacing-in-math-mode-thickspace">spacing in math mode thickspace</anchor>
<cindex index="cp" spaces=" "><indexterm index="cp" number="658"><r>package</r>, <code>amsmath</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="659"><code>amsmath</code> <r>package</r></indexterm></cindex>

<para>Synonym: <code>\thickspace</code>.  Normally <code>5.0mu plus 5.0mu</code>.  With
the <code>amsmath</code> package, or as of the 2020-10-01 &latex; release,
can be used in text mode as well as math mode; otherwise, in math mode
only.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\negthickspace</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="885" mergedindex="cp">\negthickspace</indexterm></findex>
<para>Normally <code>-5.0mu plus 2.0mu minus 4.0mu</code>.  With the <code>amsmath</code>
package, or as of the 2020-10-01 &latex; release, can be used in text
mode as well as math mode; otherwise, in math mode only.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\:</itemformat></item>
<itemx spaces=" "><itemformat command="code">\&gt;</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="886" mergedindex="cp">\:</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="887" mergedindex="cp">\&gt;</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="888" mergedindex="cp">\medspace</indexterm></findex>
<anchor name="spacing-in-math-mode-medspace">spacing in math mode medspace</anchor>
<para>Synonym: <code>\medspace</code>.  Normally <code>4.0mu plus 2.0mu minus
4.0mu</code>.  With the <code>amsmath</code> package, or as of the 2020-10-01
&latex; release, can be used in text mode as well as math mode; before
that, in math mode only.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\negmedspace</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="889" mergedindex="cp">\negmedspace</indexterm></findex>
<para>Normally <code>-4.0mu plus 2.0mu minus 4.0mu</code>.  With the <code>amsmath</code>
package, or as of the 2020-10-01 &latex; release, can be used in text
mode as well as math mode; before that, in math mode only.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\,</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="890" mergedindex="cp">\,</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="891" mergedindex="cp">\thinspace</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="660">thin space</indexterm></cindex>
<anchor name="Spacing-in-math-mode_002f_005cthinspace">Spacing in math mode/\thinspace</anchor>
<anchor name="spacing-in-math-mode-thinspace">spacing in math mode thinspace</anchor>
<para>Synonym: <code>\thinspace</code>.  Normally <code>3mu</code>, which is 1/6<dmn>em</dmn>.
Can be used in both math mode and text mode (<pxref label="_005cthinspace-_0026-_005cnegthinspace"><xrefnodename>\thinspace &amp;
\negthinspace</xrefnodename></pxref>).
</para>
<para>This space is widely used, for instance between the function and the
infinitesimal in an integral <code>\int f(x)\,dx</code> and, if an author does
this, before punctuation in a displayed equation.
</para>
<example endspaces=" ">
<pre xml:space="preserve">The antiderivative is
\begin&lbrace;equation&rbrace;
  3x^&lbrace;-1/2&rbrace;+3^&lbrace;1/2&rbrace;\,.
\end&lbrace;equation&rbrace;
</pre></example>

</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\!</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="892" mergedindex="cp">\!</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="893" mergedindex="cp">\negthinspace</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="661">thin space, negative</indexterm></cindex>
<anchor name="spacing-in-math-mode-negthinspace">spacing in math mode negthinspace</anchor>
<para>Synonym: <code>\negthinspace</code>. A negative thin space. Normally
<code>-3mu</code>.  With the <code>amsmath</code> package, or as of the 2020-10-01
&latex; release, can be used in text mode as well as math mode;
otherwise, the <code>\!</code> command is math mode only but the
<code>\negthinspace</code> command has always also worked in text mode
(<pxref label="_005cthinspace-_0026-_005cnegthinspace"><xrefnodename>\thinspace &amp; \negthinspace</xrefnodename></pxref>).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\quad</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="662">quad</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="894" mergedindex="cp">\quad</indexterm></findex>
<anchor name="spacing-in-math-mode-quad">spacing in math mode quad</anchor>
<para>This is 18<dmn>mu</dmn>, that is, 1<dmn>em</dmn>. This is often used for space
surrounding equations or expressions, for instance for the space between
two equations inside a <code>displaymath</code> environment.  It is available
in both text and math mode.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\qquad</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="895" mergedindex="cp">\qquad</indexterm></findex>
<anchor name="spacing-in-math-mode-qquad">spacing in math mode qquad</anchor>
<para>A length of 2 quads, that is, 36<dmn>mu</dmn> = 2<dmn>em</dmn>.  It is available in
both text and math mode.
</para></tableitem></tableentry></table>

<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::                           ">\smash</menunode><menudescription><pre xml:space="preserve">Eliminate height or depth of a subformula.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator=":: ">\phantom &amp; \vphantom &amp; \hphantom</menunode><menudescription><pre xml:space="preserve">Make empty box same size as argument.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                       ">\mathstrut</menunode><menudescription><pre xml:space="preserve">Add some vertical space to a formula.
</pre></menudescription></menuentry></menu>


<node name="_005csmash" spaces=" "><nodename>\smash</nodename><nodenext automatic="on">\phantom &amp; \vphantom &amp; \hphantom</nodenext><nodeup automatic="on">Spacing in math mode</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\smash</code></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="663">vertical spacing, math mode</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="664">math mode, vertical space</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\smash&lbrace;<var>subformula</var>&rbrace;
</pre></example>

<para>Typeset <var>subformula</var> as if its height and depth were zero.
</para>
<para>In this example the exponential is so tall that without the
<code>\smash</code> command &latex; would separate its line from the line
above it, and the uneven line spacing might be unsightly.
</para>
<example endspaces=" ">
<pre xml:space="preserve">To compute the tetration $\smash&lbrace;2^&lbrace;2^&lbrace;2^2&rbrace;&rbrace;&rbrace;$,
evaluate from the top down, as $2^&lbrace;2^4&rbrace;=2^&lbrace;16&rbrace;=65536$.
</pre></example>

<para>(Because of the <code>\smash</code> the printed expression could run into the
line above so you may want to wait until the final version of the
document to make such adjustments.)
</para>
<para>This pictures the effect of <code>\smash</code> by using <code>\fbox</code> to
surround the box that &latex; will put on the line.  The
<code>\blackbar</code> command makes a bar extending from 10&nbsp;points below
the baseline to 20&nbsp;points above.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcommand&lbrace;\blackbar&rbrace;&lbrace;\rule[-10pt]&lbrace;5pt&rbrace;&lbrace;30pt&rbrace;&rbrace;
\fbox&lbrace;\blackbar&rbrace;
\fbox&lbrace;\smash&lbrace;\blackbar&rbrace;&rbrace;
</pre></example>

<para>The first box that &latex; places is 20&nbsp;points high and
10&nbsp;points deep.  But the second box is treated by &latex; as
having zero height and zero depth, despite that the ink printed on the
page still extends well above and below the line.
</para>
<para>The <code>\smash</code> command appears often in mathematics to adjust the
size of an element that surrounds a subformula.  Here the first radical
extends below the baseline while the second lies just on the baseline.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;equation&rbrace;
\sqrt&lbrace;\sum_&lbrace;0\leq k&lt; n&rbrace; f(k)&rbrace;
\sqrt&lbrace;\vphantom&lbrace;\sum&rbrace;\smash&lbrace;\sum_&lbrace;0\leq k&lt; n&rbrace;&rbrace; f(k)&rbrace;
\end&lbrace;equation&rbrace;
</pre></example>

<para>Note the use of <code>\vphantom</code> to give the <code>\sqrt</code> command an
argument with the height of the <code>\sum</code> (<pxref label="_005cphantom-_0026-_005cvphantom-_0026-_005chphantom"><xrefnodename>\phantom &amp; \vphantom
&amp; \hphantom</xrefnodename></pxref>).
</para>
<para>While most often used in mathematics, the <code>\smash</code> command can
appear in other contexts.  However, it doesn&textrsquo;t change into horizontal
mode.  So if it starts a paragraph then you should first put a
<code>\leavevmode</code>, as in the bottom line below.
</para>
<example endspaces=" ">
<pre xml:space="preserve">xxx xxx xxx

\smash&lbrace;yyy&rbrace;  % no paragraph indent

\leavevmode\smash&lbrace;zzz&rbrace;  % usual paragraph indent
</pre></example>

<cindex index="cp" spaces=" "><indexterm index="cp" number="665"><r>package</r>, <code>mathtools</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="666"><code>mathtools</code> <r>package</r></indexterm></cindex>

<para>The package <code>mathtools</code> has operators that provide even finer
control over smashing a subformula box.
</para>

</subsection>
<node name="_005cphantom-_0026-_005cvphantom-_0026-_005chphantom" spaces=" "><nodename>\phantom &amp; \vphantom &amp; \hphantom</nodename><nodenext automatic="on">\mathstrut</nodenext><nodeprev automatic="on">\smash</nodeprev><nodeup automatic="on">Spacing in math mode</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\phantom</code> &amp; <code>\vphantom</code> &amp; <code>\hphantom</code></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="667">spacing, math mode</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="668">horizontal spacing</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="669">vertical spacing</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="670">math mode, spacing</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="671">invisible character</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="672">character, invisible</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\phantom&lbrace;<var>subformula</var>&rbrace;
</pre></example>

<para>or
</para>
<example endspaces=" ">
<pre xml:space="preserve">\vphantom&lbrace;<var>subformula</var>&rbrace;
</pre></example>

<para>or
</para>
<example endspaces=" ">
<pre xml:space="preserve">\hphantom&lbrace;<var>subformula</var>&rbrace;
</pre></example>

<para>The <code>\phantom</code> command creates a box with the same height, depth,
and width as <var>subformula</var>, but empty.  That is, this command causes
&latex; to typeset the space but not fill it with the material.  Here
&latex; will put a blank line that is the correct width for the answer,
but will not show that answer.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;displaymath&rbrace;
  \int x^2\,dx=\mbox&lbrace;\underline&lbrace;$\phantom&lbrace;(1/3)x^3+C&rbrace;$&rbrace;&rbrace; 
\end&lbrace;displaymath&rbrace;
</pre></example>

<para>The <code>\vphantom</code> variant produces an invisible box with the same
vertical size as <var>subformula</var>, the same height and depth, but having
zero width.  And <code>\hphantom</code> makes a box with the same width as
<var>subformula</var> but with zero height and depth.
</para>
<para>In this example, the tower of exponents in the second summand expression
is so tall that &tex; places this expression further down than its
default.  Without adjustment, the two summand expressions would be at
different levels.  The <code>\vphantom</code> in the first expression tells
&tex; to leave as much vertical room as it does for the tower, so the
two expressions come out at the same level.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;displaymath&rbrace;
    \sum_&lbrace;j\in\&lbrace;0,\ldots\, 10\&rbrace;\vphantom&lbrace;3^&lbrace;3^&lbrace;3^j&rbrace;&rbrace;&rbrace;&rbrace;
      \sum_&lbrace;i\in\&lbrace;0,\ldots\, 3^&lbrace;3^&lbrace;3^j&rbrace;&rbrace;\&rbrace;&rbrace; i\cdot j
\end&lbrace;displaymath&rbrace;
</pre></example>

<para>These commands are often used in conjunction with <code>\smash</code>.
<xref label="_005csmash"><xrefnodename>\smash</xrefnodename></xref>, which includes another example of <code>\vphantom</code>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="673"><r>package</r>, <code>mathtools</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="674"><code>mathtools</code> <r>package</r></indexterm></cindex>

<para>The three phantom commands appear often but note that &latex; provides
a suite of other commands to work with box sizes that may be more
convenient, including <code>\makebox</code> (<pxref label="_005cmbox-_0026-_005cmakebox"><xrefnodename>\mbox &amp; \makebox</xrefnodename></pxref>) as well
as <code>\settodepth</code> (<pxref label="_005csettodepth"><xrefnodename>\settodepth</xrefnodename></pxref>), <code>\settoheight</code>
(<pxref label="_005csettoheight"><xrefnodename>\settoheight</xrefnodename></pxref>), and <code>\settowidth</code> (<pxref label="_005csettowidth"><xrefnodename>\settowidth</xrefnodename></pxref>).
In addition, the <code>mathtools</code> package has many commands that offer
fine-grained control over spacing.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="675"><r>package</r>, <code>amsmath</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="676"><code>amsmath</code> <r>package</r></indexterm></cindex>

<para>All three commands produce an ordinary box, without any special
mathematics status.  So to do something like attaching a superscript you
should give it such a status, for example with the <code>\operatorname</code>
command from the package <code>amsmath</code>.
</para>
<para>While most often used in mathematics, these three can appear in other
contexts.  However, they don&textrsquo;t cause &latex; to change into horizontal
mode.  So if one of these starts a paragraph then you should prefix it
with <code>\leavevmode</code>.
</para>

</subsection>
<node name="_005cmathstrut" spaces=" "><nodename>\mathstrut</nodename><nodeprev automatic="on">\phantom &amp; \vphantom &amp; \hphantom</nodeprev><nodeup automatic="on">Spacing in math mode</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\mathstrut</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="896" mergedindex="cp"><code>\mathstrut</code></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="677">spacing, math mode</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="678">vertical spacing</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="679">math mode, spacing</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="680">invisible character</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="681">character, invisible</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="682">strut, math</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\mathstrut
</pre></example>

<para>The analogue of <code>\strut</code> for mathematics.  <xref label="_005cstrut"><xrefnodename>\strut</xrefnodename></xref>.
</para>
<para>The input <code>$\sqrt&lbrace;x&rbrace; + \sqrt&lbrace;x^i&rbrace;$</code> gives output where the
second radical is taller than the first.  To add extra vertical space
without any horizontal space, so that the two have the same height, use
<code>$\sqrt&lbrace;x\mathstrut&rbrace; + \sqrt&lbrace;x^i\mathstrut&rbrace;$</code>.
</para>
<para>The <code>\mathstrut</code> command adds the vertical height of an open
parenthesis, <code>(</code>, but no horizontal space.  It is defined as
<code>\vphantom&lbrace;(&rbrace;</code>, so see <ref label="_005cphantom-_0026-_005cvphantom-_0026-_005chphantom"><xrefnodename>\phantom &amp; \vphantom &amp; \hphantom</xrefnodename></ref> for
more.  An advantage over <code>\strut</code> is that <code>\mathstrut</code> adds no
depth, which is often the right thing for formulas.  Using the height of
an open parenthesis is just a convention; for complete control over the
amount of space, use <code>\rule</code> with a width of zero.  <xref label="_005crule"><xrefnodename>\rule</xrefnodename></xref>.
</para>

</subsection>
</section>
<node name="Math-styles" spaces=" "><nodename>Math styles</nodename><nodenext automatic="on">Math miscellany</nodenext><nodeprev automatic="on">Spacing in math mode</nodeprev><nodeup automatic="on">Math formulas</nodeup></node>
<section spaces=" "><sectiontitle>Math styles</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="683">math styles</indexterm></cindex>

<para>&tex;&textrsquo;s rules for typesetting a formula depend on the context.  For
example, inside a displayed equation, the input <code>\sum_&lbrace;0\leq
i&lt;n&rbrace;k^m=\frac&lbrace;n^&lbrace;m+1&rbrace;&rbrace;&lbrace;m+1&rbrace;+\mbox&lbrace;lower order terms&rbrace;</code> will give
output with the summation index centered below the summation symbol.
But if that input is inline then the summation index is off to the right
rather than below, so it won&textrsquo;t push the lines apart.  Similarly, in a
displayed context, the symbols in the numerator and denominator will be
larger than for an inline context, and in display math subscripts and
superscripts are further apart then they are in inline math.
</para>
<para>&tex; uses four math styles.
</para>
<itemize commandarg="bullet" spaces=" " endspaces=" "><itemprepend><formattingcommand command="bullet"/></itemprepend>
<beforefirstitem>
<cindex index="cp" spaces=" "><indexterm index="cp" number="684">display style</indexterm></cindex>
</beforefirstitem><listitem><prepend>&bullet;</prepend>
<para>Display style is for a formula displayed on a line by itself, such as
with <code>\begin&lbrace;equation&rbrace; ... \end&lbrace;equation&rbrace;</code>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="685">text style</indexterm></cindex>
</listitem><listitem><prepend>&bullet;</prepend>
<para>Text style is for an inline formula, as with <samp>so we have $ ... $</samp>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="686">script style</indexterm></cindex>
</listitem><listitem><prepend>&bullet;</prepend>
<para>Script style is for parts of a formula in a subscript or superscript.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="687">scriptscript style</indexterm></cindex>
</listitem><listitem><prepend>&bullet;</prepend>
<para>Scriptscript style is for parts of a formula at a second level (or more)
of subscript or superscript.
</para>
</listitem></itemize>

<findex index="fn" spaces=" "><indexterm index="fn" number="897" mergedindex="cp">\displaystyle</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="898" mergedindex="cp">\textstyle</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="899" mergedindex="cp">\scriptstyle</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="900" mergedindex="cp">\scriptscriptstyle</indexterm></findex>
<para>&tex; determines a default math style but you can override it with a
declaration of <code>\displaystyle</code>, or <code>\textstyle</code>, or
<code>\scriptstyle</code>, or <code>\scriptscriptstyle</code>.
</para>
<para>In this example, the <samp>Arithmetic</samp> line&textrsquo;s fraction will look
scrunched.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;tabular&rbrace;&lbrace;r|cc&rbrace;
  \textsc&lbrace;Name&rbrace;  &amp;\textsc&lbrace;Series&rbrace;  &amp;\textsc&lbrace;Sum&rbrace;  \\  \hline
  Arithmetic     &amp;$a+(a+b)+(a+2b)+\cdots+(a+(n-1)b)$
                   &amp;$na+(n-1)n\cdot\frac&lbrace;b&rbrace;&lbrace;2&rbrace;$  \\
  Geometric      &amp;$a+ab+ab^2+\cdots+ab^&lbrace;n-1&rbrace;$
                   &amp;$\displaystyle a\cdot\frac&lbrace;1-b^n&rbrace;&lbrace;1-b&rbrace;$  \\
\end&lbrace;tabular&rbrace;
</pre></example>

<noindent></noindent>
<para>But because of the <code>\displaystyle</code> declaration,
the <samp>Geometric</samp> line&textrsquo;s fraction will be easy to read, with
characters the same size as in the rest of the line.
</para>
<para>Another example is that, compared to the same input without the
declaration, the result of
</para>
<example endspaces=" ">
<pre xml:space="preserve">we get
$\pi=2\cdot&lbrace;\displaystyle\int_&lbrace;x=0&rbrace;^1 \sqrt&lbrace;1-x^2&rbrace;\,dx&rbrace;$
</pre></example>

<noindent></noindent>
<para>will have an integral sign that is much taller.  Note that here the
<code>\displaystyle</code> applies to only part of the formula, and it is
delimited by being inside curly braces, as <samp>&lbrace;\displaystyle ...&rbrace;</samp>.
</para>
<para>The last example is a continued fraction.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;equation&rbrace;
a_0+\frac&lbrace;1&rbrace;&lbrace;
       \displaystyle a_1+\frac&lbrace;\mathstrut 1&rbrace;&lbrace;
       \displaystyle a_2+\frac&lbrace;\mathstrut 1&rbrace;&lbrace;
       \displaystyle a_3&rbrace;&rbrace;&rbrace;
\end&lbrace;equation&rbrace;
</pre></example>

<noindent></noindent>
<para>Without the <code>\displaystyle</code> declarations, the denominators would be
set in script style and scriptscript style.  (The <code>\mathstrut</code>
improves the height of the denominators; <pxref label="_005cmathstrut"><xrefnodename>\mathstrut</xrefnodename></pxref>.)
</para>

</section>
<node name="Math-miscellany" spaces=" "><nodename>Math miscellany</nodename><nodeprev automatic="on">Math styles</nodeprev><nodeup automatic="on">Math formulas</nodeup></node>
<section spaces=" "><sectiontitle>Math miscellany</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="688">math miscellany</indexterm></cindex>

<para>&latex; contains a wide variety of mathematics facilities.  Here are
some that don&textrsquo;t fit into other categories.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::    ">Colon character &amp; \colon</menunode><menudescription><pre xml:space="preserve">Colon.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                            ">\*</menunode><menudescription><pre xml:space="preserve">Discretionary multiplication.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                         ">\frac</menunode><menudescription><pre xml:space="preserve">Fraction.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                         ">\sqrt</menunode><menudescription><pre xml:space="preserve">Radicals.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                     ">\stackrel</menunode><menudescription><pre xml:space="preserve">Text over a relation.
</pre></menudescription></menuentry></menu>


<node name="Colon-character-_0026-_005ccolon" spaces=" "><nodename trailingspaces="  ">Colon character &amp; \colon</nodename><nodenext automatic="on">\*</nodenext><nodeup automatic="on">Math miscellany</nodeup></node>
<subsection spaces=" "><sectiontitle>Colon character <code>:</code> &amp; <code>\colon</code></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="689">colon character</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="901" mergedindex="cp">: <r>for math</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="902" mergedindex="cp">\colon</indexterm></findex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">:
\colon
</pre></example>

<para>In mathematics, the colon character, <code>:</code>, is a relation.
</para>
<example endspaces=" ">
<pre xml:space="preserve">With side ratios \( 3:4 \) and \( 4:5 \), the triangle is right.
</pre></example>

<cindex index="cp" spaces=" "><indexterm index="cp" number="690"><r>package</r>, <code>amsmath</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="691"><code>amsmath</code> <r>package</r></indexterm></cindex>

<noindent></noindent>
<para>Ordinary &latex; defines <code>\colon</code> to produce the colon character
with the spacing appropriate for punctuation, as in set-builder notation
<code>\&lbrace;x\colon 0\leq x&lt;1\&rbrace;</code>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="692"><r>package</r>, <code>amsmath</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="693"><code>amsmath</code> <r>package</r></indexterm></cindex>

<para>But the widely-used <code>amsmath</code> package defines <code>\colon</code> for use
in the definition of functions <code>f\colon D\to C</code>.  So if you want
the colon character as a punctuation then use <code>\mathpunct&lbrace;:&rbrace;</code>.
</para>

</subsection>
<node name="_005c_002a" spaces=" "><nodename trailingspaces=" ">\*</nodename><nodenext automatic="on">\frac</nodenext><nodeprev automatic="on">Colon character &amp; \colon</nodeprev><nodeup automatic="on">Math miscellany</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\*</code></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="694">multiplication, discretionary</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="695">breaks, multiplication discretionary</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="696">line breaks, multiplication discretionary</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="697">discretionary breaks, multiplication</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="903" mergedindex="cp">\*</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\*
</pre></example>

<para>A multiplication symbol that allows a line break.  If there is a break
then &latex; puts a <code>\times</code> symbol, <U>00D7</U>, before
that break.
</para>
<para>In <code>\( A_1\* A_2\* A_3\* A_4 \)</code>, if there is no line break then
&latex; outputs it as though it were <code>\( A_1 A_2 A_3 A_4 \)</code>.  If
a line break does happen, for example between the two middle ones, then
&latex; sets it like <code>\( A_1 A_2 \times \)</code>, followed by the
break, followed by <code>\( A_3 A_4 \)</code>.
</para>

</subsection>
<node name="_005cfrac" spaces=" "><nodename>\frac</nodename><nodenext automatic="on">\sqrt</nodenext><nodeprev automatic="on">\*</nodeprev><nodeup automatic="on">Math miscellany</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\frac</code> </sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="698">fraction</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="904" mergedindex="cp">\frac</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\frac&lbrace;<var>numerator</var>&rbrace;&lbrace;<var>denominator</var>&rbrace;
</pre></example>

<para>Produces the fraction.  Used as: <code>\begin&lbrace;displaymath&rbrace;
\frac&lbrace;1&rbrace;&lbrace;\sqrt&lbrace;2\pi\sigma&rbrace;&rbrace; \end&lbrace;displaymath&rbrace;</code>.  In inline math
mode it comes out small; see the discussion of <code>\displaystyle</code>
(<pxref label="Math-formulas"><xrefnodename>Math formulas</xrefnodename></pxref>).
</para>

</subsection>
<node name="_005csqrt" spaces=" "><nodename>\sqrt</nodename><nodenext automatic="on">\stackrel</nodenext><nodeprev automatic="on">\frac</nodeprev><nodeup automatic="on">Math miscellany</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\sqrt</code></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="699">square root</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="700">roots</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="701">radical</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="905" mergedindex="cp">\sqrt</indexterm></findex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\sqrt&lbrace;<var>arg</var>&rbrace;
\sqrt[<var>root-number</var>]&lbrace;<var>arg</var>&rbrace;
</pre></example>

<para>The square root, or optionally other roots, of <var>arg</var>.  The optional
argument <var>root-number</var> gives the root, i.e., enter the cube root of
<code>x+y</code> as <code>\sqrt[3]&lbrace;x+y&rbrace;</code>.
The radical grows with the size of <var>arg</var> (as the height of the
radical grows, the angle on the leftmost part gets steeper, until for
a large enough <code>arg</code>, it is vertical).
</para>
<para>&latex; has a separate <code>\surd</code> character (<pxref label="Math-symbols"><xrefnodename>Math symbols</xrefnodename></pxref>).
</para>

</subsection>
<node name="_005cstackrel" spaces=" "><nodename>\stackrel</nodename><nodeprev automatic="on">\sqrt</nodeprev><nodeup automatic="on">Math miscellany</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\stackrel</code></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="702">stack math</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="703">relation, text above</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="906" mergedindex="cp">\stackrel</indexterm></findex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\stackrel&lbrace;<var>text</var>&rbrace;&lbrace;<var>relation</var>&rbrace;
</pre></example>

<para>Put <var>text</var> above <var>relation</var>.  To put a function name above an
arrow enter <code>\stackrel&lbrace;f&rbrace;&lbrace;\longrightarrow&rbrace;</code>.
</para>

</subsection>
</section>
</chapter>
<node name="Modes" spaces=" "><nodename>Modes</nodename><nodenext automatic="on">Page styles</nodenext><nodeprev automatic="on">Math formulas</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Modes</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="704">modes</indexterm></cindex>

<para>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.
</para>
<itemize commandarg="bullet" endspaces=" "><itemprepend>&bullet;</itemprepend>
<listitem><prepend>&bullet;</prepend>
<anchor name="modes-paragraph-mode">modes paragraph mode</anchor>
<cindex index="cp" spaces=" "><indexterm index="cp" number="705">paragraph mode</indexterm></cindex>
<para><dfn>Paragraph mode</dfn> (in plain &tex; this is called <dfn>horizontal
mode</dfn>) is what &latex; is in when processing ordinary text.  It breaks
the input text into lines and finds the positions of line breaks, so that
in vertical mode page breaks can be done.  This is the mode &latex; is
in most of the time.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="706">left-to-right mode</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="707">LR mode</indexterm></cindex>
<anchor name="modes-lr-mode">modes lr mode</anchor>
<para><dfn>LR mode</dfn> (for left-to-right mode; in plain &tex; this is called
<dfn>restricted horizontal mode</dfn>) is in effect when &latex; starts
making a box with an <code>\mbox</code> command.  As in paragraph mode,
&latex;&textrsquo;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&textrsquo;t fit there.)
</para>
</listitem><listitem><prepend>&bullet;</prepend>
<cindex index="cp" spaces=" "><indexterm index="cp" number="708">math mode</indexterm></cindex>
<anchor name="modes-math-mode">modes math mode</anchor> <para><dfn>Math mode</dfn> is when &latex; is generating
an inline mathematical formula.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="709">display math mode</indexterm></cindex>
<para><dfn>Display math mode</dfn> 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</code>
differs in the two situations.)
</para>
</listitem><listitem><prepend>&bullet;</prepend>
<cindex index="cp" spaces=" "><indexterm index="cp" number="710">vertical mode</indexterm></cindex>
<anchor name="modes-vertical-mode">modes vertical mode</anchor> <para><dfn>Vertical mode</dfn> is when &latex; is
building the list of lines and other material making the output page,
which comprises insertion of page breaks.  This is the mode &latex; is
in when it starts a document.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="711">internal vertical mode</indexterm></cindex>
<anchor name="modes-internal-vertical-mode">modes internal vertical mode</anchor>
<para><dfn>Internal vertical mode</dfn> is in effect when &latex; starts making a
<code>\vbox</code>. It has not such thing as page breaks, and as such is the
vertical analogue of LR mode.
</para>
</listitem></itemize>

<noindent></noindent>
<para>For instance, if you begin a &latex; article with <samp>Let \( x \) be
...</samp> then these are the modes: first &latex; starts every document in
vertical mode, then it reads the <samp>L</samp> and switches to paragraph
mode, then the next switch happens at the <samp>\(</samp> where &latex;
changes to math mode, and then when it leaves the formula it pops
back to paragraph mode.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="712">inner paragraph mode</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="713">outer paragraph mode</indexterm></cindex>
<anchor name="modes-inner-paragraph-mode">modes inner paragraph mode</anchor>
<anchor name="modes-outer-paragraph-mode">modes outer paragraph mode</anchor>
<para>Paragraph mode has two subcases.  If you use a <code>\parbox</code> command
or a <code>minipage</code> 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</dfn>, &latex; is in <dfn>inner paragraph mode</dfn>.  Its more usual
situation, where it can put page breaks, is <dfn>outer paragraph mode</dfn>
(<pxref label="Page-breaking"><xrefnodename>Page breaking</xrefnodename></pxref>).
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator=":: ">\ensuremath</menunode><menudescription><pre xml:space="preserve">Ensure that math mode is active.
</pre></menudescription></menuentry></menu>

<node name="_005censuremath" spaces=" "><nodename>\ensuremath</nodename><nodeup automatic="on">Modes</nodeup></node>
<section spaces=" "><sectiontitle><code>\ensuremath</code></sectiontitle>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\ensuremath&lbrace;<var>formula</var>&rbrace;
</pre></example>

<para>Ensure that <var>formula</var> is typeset in math mode.
</para>
<para>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.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcommand&lbrace;\dx&rbrace;&lbrace;\ensuremath&lbrace;dx&rbrace;&rbrace;
In $\int f(x)\, \dx$, the \dx&lbrace;&rbrace; is an infinitesimal.
</pre></example>

<para>Caution: the <code>\ensuremath</code> command is useful but not a panacea.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcommand&lbrace;\alf&rbrace;&lbrace;\ensuremath&lbrace;\alpha&rbrace;&rbrace;
You get an alpha in text mode: \alf.
But compare the correct spacing in $\alf+\alf$ with that in \alf+\alf.
</pre></example>

<noindent></noindent>
<para>Best is to typeset math things in a math mode.
</para>

</section>
</chapter>
<node name="Page-styles" spaces=" "><nodename>Page styles</nodename><nodenext automatic="on">Spaces</nodenext><nodeprev automatic="on">Modes</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Page styles</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="714">styles, page</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="715">page styles</indexterm></cindex>

<para>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.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="716"><r>package</r>, <code>fancyhdr</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="717"><code>fancyhdr</code> <r>package</r></indexterm></cindex>

<para>The package <code>fancyhdr</code> is very helpful for constructing page
styles.  See its documentation on CTAN.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::          ">\maketitle</menunode><menudescription><pre xml:space="preserve">Generate a title page.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::      ">\pagenumbering</menunode><menudescription><pre xml:space="preserve">Set the style used for page numbers.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::		">\pagestyle</menunode><menudescription><pre xml:space="preserve">Change the headings/footings style.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::      ">\thispagestyle</menunode><menudescription><pre xml:space="preserve">Change the headings/footings style for this page.
</pre></menudescription></menuentry></menu>


<node name="_005cmaketitle" spaces=" "><nodename>\maketitle</nodename><nodenext automatic="on">\pagenumbering</nodenext><nodeup automatic="on">Page styles</nodeup></node>
<section spaces=" "><sectiontitle><code>\maketitle</code></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="718">titles, making</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="907" mergedindex="cp">\maketitle</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\maketitle
</pre></example>

<para>Generate a title.  In the standard classes the title appears on a
separate page, except in the <code>article</code> class where it is at the top
of the first page.  (<xref label="Document-class-options"><xrefnodename>Document class options</xrefnodename></xref>, for information about
the <code>titlepage</code> document class option.)
</para>
<para>This example shows <code>\maketitle</code> appearing in its usual place,
immediately after <code>\begin&lbrace;document&rbrace;</code>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\documentclass&lbrace;article&rbrace;
\title&lbrace;Constructing a Nuclear Reactor Using Only Coconuts&rbrace;
\author&lbrace;Jonas Grumby\thanks&lbrace;%
    With the support of a Ginger Grant from the Roy Hinkley Society.&rbrace; \\
  Skipper, \textit&lbrace;Minnow&rbrace;
  \and
  Willy Gilligan\thanks&lbrace;%
    Thanks to the Mary Ann Summers foundation
    and to Thurston and Lovey Howell.&rbrace;           \\
  Mate, \textit&lbrace;Minnow&rbrace;
  &rbrace;
\date&lbrace;1964-Sep-26&rbrace;
\begin&lbrace;document&rbrace;
\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.
  ...
</pre></example>

<para>You tell &latex; the information used to produce the title by making
the following declarations.  These must come before the
<code>\maketitle</code>, either in the preamble or in the document body.
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="908" mergedindex="cp">\author&lbrace;<var>name1</var> \and <var>name2</var> \and ...&rbrace;</indexterm>\author&lbrace;<var>name1</var> \and <var>name2</var> \and ...&rbrace;</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="719">author, for titlepage</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="909" mergedindex="cp">\\ <r>for <code>\author</code></r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="910" mergedindex="cp">\and <r>for <code>\author</code></r></indexterm></findex>
<para>Required.  Declare the document author or authors.  The argument is a
list of authors separated by <code>\and</code> commands.  To separate lines
within a single author&textrsquo;s entry, for instance to give the author&textrsquo;s
institution or address, use a double backslash, <code>\\</code>.  If you omit
the <code>\author</code> declaration then you get <samp>LaTeX Warning: No
\author given</samp>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="911" mergedindex="cp">\date&lbrace;<var>text</var>&rbrace;</indexterm>\date&lbrace;<var>text</var>&rbrace;</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="720">date, for titlepage</indexterm></cindex>
<para>Optional.  Declare <var>text</var> to be the document&textrsquo;s date.  The <var>text</var>
doesn&textrsquo;t need to be in a date format; it can be any text at all.  If you
omit <code>\date</code> then &latex; uses the current date (<pxref label="_005ctoday"><xrefnodename>\today</xrefnodename></pxref>).
To have no date, instead use <code>\date&lbrace;&rbrace;</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="912" mergedindex="cp">\thanks&lbrace;<var>text</var>&rbrace;</indexterm>\thanks&lbrace;<var>text</var>&rbrace;</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="721">thanks, for titlepage</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="722">credit footnote</indexterm></cindex>
<para>Optional.  Produce a footnote.  You can use it in the author information
for acknowledgements as illustrated above, but you can also use it in
the title, or any place a footnote makes sense.  It can be any text at
all so you can use it for any purpose, such as to print an email
address.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="913" mergedindex="cp">\title&lbrace;<var>text</var>&rbrace;</indexterm>\title&lbrace;<var>text</var>&rbrace;</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="723">title, for titlepage</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="914" mergedindex="cp">\\ <r>for <code>\title</code></r></indexterm></findex>
<para>Required.  Declare <var>text</var> to be the title of the document.  Get line
breaks inside <var>text</var> with a double backslash, <code>\\</code>.  If you
omit the <code>\title</code> declaration then you get <samp>LaTeX Error: No
\title given</samp>.
</para>
</tableitem></tableentry></ftable>

<para>To make your own title page, see&nbsp;<ref label="titlepage"><xrefnodename>titlepage</xrefnodename></ref>. You can either
create this as a one-off or you can include it as part of a renewed
<code>\maketitle</code> command.  (Many publishers will provide a class to use
in place of <code>article</code> that formats the title according to their
house requirements.)
</para>

</section>
<node name="_005cpagenumbering" spaces=" "><nodename>\pagenumbering</nodename><nodenext automatic="on">\pagestyle</nodenext><nodeprev automatic="on">\maketitle</nodeprev><nodeup automatic="on">Page styles</nodeup></node>
<section spaces=" "><sectiontitle><code>\pagenumbering</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="915" mergedindex="cp">\pagenumbering</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="724">page numbering style</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\pagenumbering&lbrace;<var>number-style</var>&rbrace;
</pre></example>

<para>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.
</para>
<para>In this example, before the Main section the pages are numbered
<samp>a</samp>, etc.  Starting on the page containing that section, the pages
are numbered <samp>1</samp>, etc.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;document&rbrace;\pagenumbering&lbrace;alph&rbrace;
  ...
\section&lbrace;Main&rbrace;\pagenumbering&lbrace;arabic&rbrace;
  ...
</pre></example>

<para>The argument <var>number-style</var> is one of the following (see
also&nbsp;<ref label="_005calph-_005cAlph-_005carabic-_005croman-_005cRoman-_005cfnsymbol"><xrefnodename>\alph \Alph \arabic \roman \Roman \fnsymbol</xrefnodename></ref>).
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">arabic</itemformat></item>
</tableterm><tableitem><para>Arabic numerals: 1, 2, &dots; 
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">roman</itemformat></item>
</tableterm><tableitem><para>lowercase Roman numerals: i, ii, &dots;
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">Roman</itemformat></item>
</tableterm><tableitem><para>uppercase Roman numerals: I, II, &dots;
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">alph</itemformat></item>
</tableterm><tableitem><para>lowercase letters: a, b, &dots; If you have more than 26 pages then you
get <samp>LaTeX Error: Counter too large</samp>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">Alph</itemformat></item>
</tableterm><tableitem><para>uppercase letters: A, B, &dots; If you have more than 26 pages then you
get <samp>LaTeX Error: Counter too large</samp>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">gobble</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="725"><r>package</r>, <code>hyperref</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="726"><code>hyperref</code> <r>package</r></indexterm></cindex>
 <para>&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 <code>hyperref</code> so to have the page number
not appear you may want to instead use <code>\pagestyle&lbrace;empty&rbrace;</code> or
<code>\thispagestyle&lbrace;empty&rbrace;</code>.)
</para>
</tableitem></tableentry></table>

<para>Traditionally, if a document has front matter&textmdash;preface, table of
contents, etc.&textmdash;then it is numbered with lowercase Roman numerals. The
main matter of a document uses arabic.  <xref label="_005cfrontmatter-_0026-_005cmainmatter-_0026-_005cbackmatter"><xrefnodename>\frontmatter &amp; \mainmatter
&amp; \backmatter</xrefnodename></xref>.
</para>
<para>If you want to change where the page number appears on the page,
see&nbsp;<ref label="_005cpagestyle"><xrefnodename>\pagestyle</xrefnodename></ref>.  If you want to change the value of the page
number, then you manipulate the <code>page</code> counter (<pxref label="Counters"><xrefnodename>Counters</xrefnodename></pxref>).
</para>

</section>
<node name="_005cpagestyle" spaces=" "><nodename>\pagestyle</nodename><nodenext automatic="on">\thispagestyle</nodenext><nodeprev automatic="on">\pagenumbering</nodeprev><nodeup automatic="on">Page styles</nodeup></node>
<section spaces=" "><sectiontitle><code>\pagestyle</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="916" mergedindex="cp">\pagestyle</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="727">header style</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="728">footer style</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="729">running header and footer style</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\pagestyle&lbrace;<var>style</var>&rbrace;
</pre></example>

<para>Declaration that specifies how the page headers and footers are typeset,
from the current page onwards.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="730"><r>package</r>, <code>fancyhdr</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="731"><code>fancyhdr</code> <r>package</r></indexterm></cindex>

<para>A discussion with an example is below.  Note first that the package
<code>fancyhdr</code> 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.
</para>
<para>Values for <var>style</var>:
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">plain</itemformat></item>
</tableterm><tableitem><para>The header is empty.  The footer contains only a page number, centered.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">empty</itemformat></item>
</tableterm><tableitem><para>The header and footer are both empty.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">headings</itemformat></item>
</tableterm><tableitem><para>Put running headers and footers on each page.  The document style
specifies what goes in there; see the discussion below.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">myheadings</itemformat></item>
</tableterm><tableitem><para>Custom headers, specified via the <code>\markboth</code> or the
<code>\markright</code> commands.
</para>
</tableitem></tableentry></table>

<para>Some discussion of the motivation for &latex;&textrsquo;s mechanism will help you
work with the options <code>headings</code> or <code>myheadings</code>.  The
document source below produces an article, two-sided, with the pagestyle
<code>headings</code>.  On this document&textrsquo;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</code> and <code>\rightmark</code>.  So it is up to
<code>\section</code> and <code>\subsection</code> to store that information there.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\documentclass[twoside]&lbrace;article&rbrace;
\pagestyle&lbrace;headings&rbrace;
\begin&lbrace;document&rbrace;
  ... \section&lbrace;Section 1&rbrace; ... \subsection&lbrace;Subsection 1.1&rbrace; ...
\section&lbrace;Section 2&rbrace;
  ...
\subsection&lbrace;Subsection 2.1&rbrace;
  ...
\subsection&lbrace;Subsection 2.2&rbrace;
  ...
</pre></example>

<noindent></noindent>
<para>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&nbsp;2</samp> 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.
</para>
<para>To accomplish this, in a two-sided article, &latex; has <code>\section</code>
issue a command <code>\markboth</code>, setting <code>\leftmark</code>
to <samp>Section&nbsp;2</samp> and setting <code>\rightmark</code> to blank.
And, &latex; has <code>\subsection</code> issue a command <code>\markright</code>,
setting <code>\rightmark</code> to <samp>Subsection&nbsp;2.1</samp>, etc.
</para>
<para>Here are the descriptions of <code>\markboth</code> and <code>\markright</code>:
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="917" mergedindex="cp">\markboth&lbrace;<var>left-head</var>&rbrace;&lbrace;<var>right-head</var>&rbrace;</indexterm>\markboth&lbrace;<var>left-head</var>&rbrace;&lbrace;<var>right-head</var>&rbrace;</itemformat></item>
</tableterm><tableitem><para>Sets both the right hand and left hand heading information for either a
page style of <code>headings</code> or <code>myheadings</code>.  A left hand page
heading <var>left-head</var> is generated by the last <code>\markboth</code>
command before the end of the page.  A right hand page heading
<var>right-head</var> is generated by the first <code>\markboth</code> or
<code>\markright</code> that comes on the page if there is one, otherwise by
the last one that came before that page.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="918" mergedindex="cp">\markright&lbrace;<var>right</var>&rbrace;</indexterm>\markright&lbrace;<var>right</var>&rbrace;</itemformat></item>
</tableterm><tableitem><para>Sets the right hand page heading, leaving the left unchanged.
</para>
</tableitem></tableentry></ftable>


</section>
<node name="_005cthispagestyle" spaces=" "><nodename>\thispagestyle</nodename><nodeprev automatic="on">\pagestyle</nodeprev><nodeup automatic="on">Page styles</nodeup></node>
<section spaces=" "><sectiontitle><code>\thispagestyle</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="919" mergedindex="cp">\thispagestyle</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="732">page style, this page</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\thispagestyle&lbrace;<var>style</var>&rbrace;
</pre></example>

<para>Works in the same way as the <code>\pagestyle</code> (<pxref label="_005cpagestyle"><xrefnodename>\pagestyle</xrefnodename></pxref>),
except that it changes to <var>style</var> for the current page only.  This
declaration has global scope, so its effect is not delimited by braces
or environments.
</para>
<para>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 <code>plain</code> style, as is the default (<pxref label="Page-styles"><xrefnodename>Page
styles</xrefnodename></pxref>).
</para>
<example endspaces=" ">
<pre xml:space="preserve">\documentclass&lbrace;book&rbrace;
\pagestyle&lbrace;headings&rbrace;
\begin&lbrace;document&rbrace;
\chapter&lbrace;First chapter&rbrace;
  ...
\chapter&lbrace;Second chapter&rbrace;\thispagestyle&lbrace;empty&rbrace;
  ...
</pre></example>

<noindent></noindent>
<para>The <code>plain</code> style has a page number on it, centered in the footer.
To make the page entirely empty, the command
<code>\thispagestyle&lbrace;empty&rbrace;</code> immediately follows the second
<code>\chapter</code>.
</para>

</section>
</chapter>
<node name="Spaces" spaces=" "><nodename>Spaces</nodename><nodenext automatic="on">Boxes</nodenext><nodeprev automatic="on">Page styles</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Spaces</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="733">spaces</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="734">white space</indexterm></cindex>

<para>&latex; has many ways to produce white space, or filled space.  Some of
these are best suited to mathematical text; for these
see&nbsp;<ref label="Spacing-in-math-mode"><xrefnodename>Spacing in math mode</xrefnodename></ref>.
</para>
<menu endspaces=" ">
<menucomment><pre xml:space="preserve">Horizontal space 
</pre></menucomment><menuentry leadingtext="* "><menunode separator="::  ">\enspace &amp; \quad &amp; \qquad</menunode><menudescription><pre xml:space="preserve">Traditional horizontal spaces.  
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::               ">\hspace</menunode><menudescription><pre xml:space="preserve">Any horizontal space.  
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                ">\hfill</menunode><menudescription><pre xml:space="preserve">Stretchable horizontal space.  
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                  ">\hss</menunode><menudescription><pre xml:space="preserve">Infinitely stretchable/shrinkable horizontal space.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::          ">\spacefactor</menunode><menudescription><pre xml:space="preserve">Stretchability of following space
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::              ">\(SPACE)</menunode><menudescription><pre xml:space="preserve">Backslash-space, and explicit space.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                     ">~</menunode><menudescription><pre xml:space="preserve">Tie, an unbreakable space.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::  ">\thinspace &amp; \negthinspace</menunode><menudescription><pre xml:space="preserve">One-sixth of an em, and negative one-sixth.  
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                    ">\/</menunode><menudescription><pre xml:space="preserve">Italic correction.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator=":: ">\hrulefill &amp; \dotfill</menunode><menudescription><pre xml:space="preserve">Stretchable horizontal rule or dots.
</pre></menudescription></menuentry><menucomment><pre xml:space="preserve">
Vertical space
</pre></menucomment><menuentry leadingtext="* "><menunode separator="::  ">\bigskip &amp; \medskip &amp; \smallskip</menunode><menudescription><pre xml:space="preserve">Inter-paragraph vertical spaces.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::  ">\bigbreak &amp; \medbreak &amp; \smallbreak</menunode><menudescription><pre xml:space="preserve">Inter-paragraph space and page breaks.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                            ">\strut</menunode><menudescription><pre xml:space="preserve">Ensure height of a line.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                           ">\vspace</menunode><menudescription><pre xml:space="preserve">Vertical space.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                            ">\vfill</menunode><menudescription><pre xml:space="preserve">Stretchable vertical space.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                        ">\addvspace</menunode><menudescription><pre xml:space="preserve">Add arbitrary vertical space if needed.
</pre></menudescription></menuentry></menu>


<node name="_005censpace-_0026-_005cquad-_0026-_005cqquad" spaces=" "><nodename>\enspace &amp; \quad &amp; \qquad</nodename><nodenext automatic="on">\hspace</nodenext><nodeup automatic="on">Spaces</nodeup></node>
<section spaces=" "><sectiontitle><code>\enspace</code> &amp; <code>\quad</code> &amp; <code>\qquad</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="920" mergedindex="cp">\enspace</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="921" mergedindex="cp">\quad</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="922" mergedindex="cp">\qquad</indexterm></findex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\enspace
\quad
\qquad
</pre></example>

<para>Insert a horizontal space of 1/2<dmn>em</dmn>, 1<dmn>em</dmn>, or 2<dmn>em</dmn>. The
em is a length defined by a font designer, often thought of as being the
width of a capital&nbsp;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 label="Lengths_002fem"><xrefnodename>Lengths/em</xrefnodename></pxref>).
</para>
<para>This puts a suitable gap between two graphics.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;center&rbrace;
  \includegraphics&lbrace;womensmile.png&rbrace;%
  \qquad\includegraphics&lbrace;mensmile.png&rbrace;
\end&lbrace;center&rbrace;
</pre></example>

<noindent></noindent>
<para><xref label="Spacing-in-math-mode"><xrefnodename>Spacing in math mode</xrefnodename></xref>, for <code>\quad</code> and <code>\qquad</code>.  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</code>.
</para>

</section>
<node name="_005chspace" spaces=" "><nodename>\hspace</nodename><nodenext automatic="on">\hfill</nodenext><nodeprev automatic="on">\enspace &amp; \quad &amp; \qquad</nodeprev><nodeup automatic="on">Spaces</nodeup></node>
<section spaces=" "><sectiontitle><code>\hspace</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="923" mergedindex="cp">\hspace</indexterm></findex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\hspace&lbrace;<var>length</var>&rbrace;
\hspace*&lbrace;<var>length</var>&rbrace;
</pre></example>

<para>Insert the amount <var>length</var> of horizontal space. The <var>length</var> can
be positive, negative, or zero; adding a negative amount of space is
like backspacing.  It is a rubber length, that is, it may contain a
<code>plus</code> or <code>minus</code> component, or both (<pxref label="Lengths"><xrefnodename>Lengths</xrefnodename></pxref>).
Because the space is stretchable and shrinkable, it is sometimes called
<dfn>glue</dfn>.
</para>
<para>This makes a line with <samp>Name:</samp> an inch from the right margin.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\noindent\makebox[\linewidth][r]&lbrace;Name:\hspace&lbrace;1in&rbrace;&rbrace;
</pre></example>

<para>The <code>*</code>-form inserts horizontal space that is non-discardable.  More
precisely, when &tex; breaks a paragraph into lines any white
space&textmdash;glues and kerns&textmdash;that come at a line break are discarded.  The
<code>*</code>-form avoids that (technically, it adds a non-discardable
invisible item in front of the space).
</para>
<para>In this example
</para>
<example endspaces=" ">
<pre xml:space="preserve">\parbox&lbrace;0.8\linewidth&rbrace;&lbrace;%
  Fill in each blank: Four \hspace*&lbrace;1in&rbrace; and seven years ago our
  fathers brought forth on this continent, a new \hspace*&lbrace;1in&rbrace;,
  conceived in \hspace*&lbrace;1in&rbrace;, and dedicated to the proposition
  that all men are created \hspace*&lbrace;1in&rbrace;.&rbrace;
</pre></example>

<noindent></noindent>
<para>the 1&nbsp;inch blank following <samp>conceived in</samp> falls at the start
of a line.  If you erase the <code>*</code> then &latex; discards the blank.
</para>
<para>Here, the <code>\hspace</code> separates the three graphics.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;center&rbrace;
  \includegraphics&lbrace;lion.png&rbrace;%   comment keeps out extra space
  \hspace&lbrace;1cm minus 0.25cm&rbrace;\includegraphics&lbrace;tiger.png&rbrace;%
  \hspace&lbrace;1cm minus 0.25cm&rbrace;\includegraphics&lbrace;bear.png&rbrace;
\end&lbrace;center&rbrace;
</pre></example>

<noindent></noindent>
<para>Because the argument to each <code>\hspace</code> has <code>minus 0.25cm</code>,
each can shrink a little if the three figures are too wide.  But each
space won&textrsquo;t shrink more than 0.25<dmn>cm</dmn> (<pxref label="Lengths"><xrefnodename>Lengths</xrefnodename></pxref>).
</para>

</section>
<node name="_005chfill" spaces=" "><nodename>\hfill</nodename><nodenext automatic="on">\hss</nodenext><nodeprev automatic="on">\hspace</nodeprev><nodeup automatic="on">Spaces</nodeup></node>
<section spaces=" "><sectiontitle><code>\hfill</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="924" mergedindex="cp">\hfill</indexterm></findex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="735">stretch, infinite horizontal</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="736">infinite horizontal stretch</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\hfill
</pre></example>

<para>Produce a rubber length which has no natural space but that can stretch
horizontally as far as needed (<pxref label="Lengths"><xrefnodename>Lengths</xrefnodename></pxref>).
</para>
<para>This creates a one-line paragraph with <samp>Name:</samp> on the left side
of the page and <samp>Quiz One</samp> on the right.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\noindent Name:\hfill Quiz One
</pre></example>

<findex index="fn" spaces=" "><indexterm index="fn" number="925" mergedindex="cp">\fill</indexterm></findex>
<para>The <code>\hfill</code> command is equivalent to <code>\hspace&lbrace;\fill&rbrace;</code> and
so the space can be discarded at line breaks.  To avoid that instead use
<code>\hspace*&lbrace;\fill&rbrace;</code> (<pxref label="_005chspace"><xrefnodename>\hspace</xrefnodename></pxref>).
</para>
<para>Here the graphs are evenly spaced in the middle of the figure.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcommand*&lbrace;\vcenteredhbox&rbrace;[1]&lbrace;\begin&lbrace;tabular&rbrace;&lbrace;&arobase;&lbrace;&rbrace;c&arobase;&lbrace;&rbrace;&rbrace;#1\end&lbrace;tabular&rbrace;&rbrace;
  ...
\begin&lbrace;figure&rbrace;
  \hspace*&lbrace;\fill&rbrace;%
  \vcenteredhbox&lbrace;\includegraphics&lbrace;graph0.png&rbrace;&rbrace;%
    \hfill\vcenteredhbox&lbrace;\includegraphics&lbrace;graph1.png&rbrace;&rbrace;%
  \hspace*&lbrace;\fill&rbrace;%
  \caption&lbrace;Comparison of two graphs&rbrace; \label&lbrace;fig:twographs&rbrace;
\end&lbrace;figure&rbrace;
</pre></example>

<noindent></noindent>
<para>Note the <code>\hspace*</code>&textrsquo;s where the space could otherwise be dropped.
</para>

</section>
<node name="_005chss" spaces=" "><nodename>\hss</nodename><nodenext automatic="on">\spacefactor</nodenext><nodeprev automatic="on">\hfill</nodeprev><nodeup automatic="on">Spaces</nodeup></node>
<section spaces=" "><sectiontitle><code>\hss</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="926" mergedindex="cp">\hss</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="737">horizontal space</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="738">horizontal space, stretchable</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="739">space, inserting horizontal</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\hss
</pre></example>

<para>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</code> command to get the
effects of <code>\hss</code> (<pxref label="_005cmbox-_0026-_005cmakebox"><xrefnodename>\mbox &amp; \makebox</xrefnodename></pxref>).
</para>
<para>Here, the first line&textrsquo;s <code>\hss</code> 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.
</para>
<example endspaces=" ">
<pre xml:space="preserve">X\hbox to 0pt&lbrace;Z\hss&rbrace;Y
X\hbox to 0pt&lbrace;\hss Z&rbrace;Y
</pre></example>

<noindent></noindent>
<para>Without the <code>\hss</code> you get something like <samp>Overfull \hbox
(6.11111pt too wide) detected at line 20</samp>.
</para>

</section>
<node name="_005cspacefactor" spaces=" "><nodename>\spacefactor</nodename><nodenext automatic="on">\(SPACE)</nodenext><nodeprev automatic="on">\hss</nodeprev><nodeup automatic="on">Spaces</nodeup></node>
<section spaces=" "><sectiontitle><code>\spacefactor</code></sectiontitle>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\spacefactor=<var>integer</var>
</pre></example>

<findex index="fn" spaces=" "><indexterm index="fn" number="927" mergedindex="cp">\spacefactor</indexterm></findex>
<para>Influence &latex;&textrsquo;s glue stretch and shrink behavior.  Most user-level
documents do not use this command.
</para>
<para>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</dfn>; <pxref label="_005chspace"><xrefnodename>\hspace</xrefnodename></pxref>).  The <code>\spacefactor</code> command
(from Plain&nbsp;&tex;) allows you to, for instance, have the space
after a period stretch more than the space after a word-ending letter.
</para>
<para>After &latex; places each character, or rule or other box, it sets a
parameter called the <dfn>space factor</dfn>.  If the next thing in the input
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.
</para>
<para>If the space factor&nbsp;<var>f</var> is 1000 then the glue gap will be the
font&textrsquo;s normal space value (for Computer Modern Roman 10 point this is
3.3333&nbsp;points).  Otherwise, if the space factor <var>f</var> is greater
than 2000 then &tex; adds the font&textrsquo;s extra space value (for Computer
Modern Roman 10 point this is 1.11111&nbsp;points), and then the font&textrsquo;s
normal stretch value is multiplied by <math>f /1000</math> and the normal
shrink value is multiplied by <math>1000/f</math> (for Computer Modern Roman
10 point these are 1.66666 and 1.11111&nbsp;points).
</para>
<para>For example, consider the period ending <code>A man's best friend is his
dog.</code>  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</code>, which does not end in a period.
</para>
<para>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 label="_005c_0040"><xrefnodename>\&arobase;</xrefnodename></pxref>).
</para>
<para>You can only use <code>\spacefactor</code> in paragraph mode or LR mode
(<pxref label="Modes"><xrefnodename>Modes</xrefnodename></pxref>).  You can see the current value with
<code>\the\spacefactor</code> or <code>\showthe\spacefactor</code>.
</para>
<para>(Comment, not really related to <code>\spacefactor</code>: if you get errors
like <samp>You can't use `\spacefactor' in vertical mode</samp>, or <samp>You
can't use `\spacefactor' in math mode.</samp>, or <samp>Improper \spacefactor</samp>
then you have probably tried to redefine an internal command.
<xref label="_005cmakeatletter-_0026-_005cmakeatother"><xrefnodename>\makeatletter &amp; \makeatother</xrefnodename></xref>.)
</para>

<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::              ">\&arobase;</menunode><menudescription><pre xml:space="preserve">Distinguish sentence-ending periods from abbreviations.  
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::   ">\frenchspacing &amp; \nonfrenchspacing</menunode><menudescription><pre xml:space="preserve">Equal interword and inter-sentence space.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::   ">\normalsfcodes</menunode><menudescription><pre xml:space="preserve">Restore space factor settings to the default.
</pre></menudescription></menuentry></menu>


<node name="_005c_0040" spaces=" "><nodename trailingspaces=" ">\&arobase;</nodename><nodenext automatic="on">\frenchspacing &amp; \nonfrenchspacing</nodenext><nodeup automatic="on">\spacefactor</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\&arobase;</code>  </sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="928" mergedindex="cp">\&arobase;</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="929" mergedindex="cp">at-sign</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="740">period, sentence-ending</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="741">period, abbreviation-ending</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="742">period, spacing after</indexterm></cindex>
<anchor name="_005cAT">\AT</anchor><!-- c old name -->

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve"><var>capital-letter</var>\&arobase;.    
</pre></example>

<para>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 label="_005cspacefactor"><xrefnodename>\spacefactor</xrefnodename></pxref>).
</para>
<para>This example shows the two cases to remember.
</para>
<example endspaces=" ">
<pre xml:space="preserve">The songs \textit&lbrace;Red Guitar&rbrace;, etc.\ are by Loudon Wainwright~III\&arobase;.
</pre></example>

<noindent></noindent>
<para>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>\&arobase;</code> before it.  The first period ends the abbreviation
<samp>etc.</samp> but not the sentence.  The backslash-space, <code>\ </code>,
produces a mid-sentence space.
</para>
<para>So: if you have a capital letter followed by a period that ends the
sentence, then put <code>\&arobase;</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
</para>
<example endspaces=" ">
<pre xml:space="preserve">Use the \textit&lbrace;Instructional Practices Guide&rbrace;,
(a book by the MAA)\&arobase;.
</pre></example>

<noindent></noindent>
<para>will have correct inter-sentence spacing after the period.
</para>
<para>The <code>\&arobase;</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</samp> (<pxref label="Modes"><xrefnodename>Modes</xrefnodename></pxref>).
</para>
<para>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>\ </code>), or a tie, (<code>~</code>), or <code>\&arobase;</code>.
Examples are <code>Nat.\ Acad.\ Science</code>, and <code>Mr.~Bean</code>, and
<code>(manure, etc.\&arobase;) for sale</code> (note in the last one that the
<code>\&arobase;</code> comes before the closing parenthesis).
</para>

</subsection>
<node name="_005cfrenchspacing-_0026-_005cnonfrenchspacing" spaces=" "><nodename>\frenchspacing &amp; \nonfrenchspacing</nodename><nodenext automatic="on">\normalsfcodes</nodenext><nodeprev automatic="on">\&arobase;</nodeprev><nodeup automatic="on">\spacefactor</nodeup></node>
<anchor name="_005cfrenchspacing">\frenchspacing</anchor><!-- c old node name -->
<subsection spaces=" "><sectiontitle><code>\frenchspacing</code> &amp; <code>\nonfrenchspacing</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="930" mergedindex="cp">\frenchspacing</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="931" mergedindex="cp">\nonfrenchspacing</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="743">spacing, inter-sentence</indexterm></cindex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\frenchspacing
\nonfrenchspacing
</pre></example>

<para>The first declaration causes &latex; to handle spacing between
sentences in the same way as spacing between words in the middle of a
sentence.  The second switches back to the default handling in which
spacing between sentences stretches or shrinks more
(<pxref label="_005cspacefactor"><xrefnodename>\spacefactor</xrefnodename></pxref>).
</para>
<para>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</code>
(the command is from plain &tex;) switches to the tradition that all
spaces are treated equally.
</para>

</subsection>
<node name="_005cnormalsfcodes" spaces=" "><nodename>\normalsfcodes</nodename><nodeprev automatic="on">\frenchspacing &amp; \nonfrenchspacing</nodeprev><nodeup automatic="on">\spacefactor</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\normalsfcodes</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="932" mergedindex="cp">\normalsfcodes</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="744">spacing, inter-sentence</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\normalsfcodes
</pre></example>

<para>Reset the &latex; space factors to the default values
(<pxref label="_005cspacefactor"><xrefnodename>\spacefactor</xrefnodename></pxref>).
</para>

</subsection>
</section>
<node name="_005c_0028SPACE_0029" spaces=" "><nodename trailingspaces=" ">\(SPACE)</nodename><nodenext automatic="on">~</nodenext><nodeprev automatic="on">\spacefactor</nodeprev><nodeup automatic="on">Spaces</nodeup></node>
<section spaces=" "><sectiontitle>Backslash-space, <code>\ </code></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="745">\<key>NEWLINE</key></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="746">\<key>SPACE</key></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="747">\<key>TAB</key></indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="933" mergedindex="cp">\<w> </w> <r>(backslash-space)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="934" mergedindex="cp">\<key>SPACE</key></indexterm></findex>

<para>This section refers to the command consisting of two characters, a
backslash followed by a space.&linebreak;Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\<w> </w>
</pre></example>

<para>Produce a space. By default it produces white space of length
3.33333<dmn>pt</dmn> plus 1.66666<dmn>pt</dmn> minus 1.11111<dmn>pt</dmn>.
</para>
<para>When you type one or more blanks between words, &latex; produces white
space.  But that is different than an explicit space.  This illustrates.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;tabular&rbrace;&lbrace;rl&rbrace;
One blank:&amp; makes some space \\
Three blanks:&amp;   in a row \\
Three spaces:&amp;\ \ \ in a row \\
\end&lbrace;tabular&rbrace;
</pre></example>

<noindent></noindent>
<para>On the first line &latex; puts some space after the colon.  On the
second line &latex; collapses the three blanks to output one
whitespace, so you end with the same space after the colon as in the
first line.  &latex; would similarly collapse them to a single
whitespace if one, two or all of the three blanks were replaced by a
tab, or by a newline.  However, the bottom line asks for three spaces so
the white area is wider.  That is, the backslash-space command creates a
fixed amount of horizontal space.  (Note that you can define a
horizontal space of any width at all with <code>\hspace</code>;
see&nbsp;<ref label="_005chspace"><xrefnodename>\hspace</xrefnodename></ref>.)
</para>
<para>The backslash-space command has two main uses.  It is often used after
control sequences to keep them from gobbling the blank that follows, as
after <code>\TeX</code> in <code>\TeX\ (or \LaTeX)</code>.  (But using curly braces
has the advantage of still working whether the next character is a blank
or any other non-letter, as in <code>\TeX&lbrace;&rbrace; (or \LaTeX&lbrace;&rbrace;)</code> in which
<code>&lbrace;&rbrace;</code> can be added after <code>\LaTeX</code> as well as after
<code>\TeX</code>.)  The other common use is that it marks a period as ending
an abbreviation instead of ending a sentence, as in <code>Prof.\ Smith</code>
or <code>Jones et al.\ (1993)</code> (<pxref label="_005c_0040"><xrefnodename>\&arobase;</xrefnodename></pxref>).
</para>
<para>Under normal circumstances, <code>\</code><key>TAB</key> and <code>\</code><key>NEWLINE</key>
are equivalent to backslash-space, <code>\ </code>.
</para>
<anchor name="Leading-blanks">Leading blanks</anchor>
<para>Please also note that in order to allow source code indentation, under
normal circumstances, &tex; ignores leading blanks in a line. So the
following prints <samp>one word</samp>:
</para>
<example endspaces=" ">
<pre xml:space="preserve">one
 word
</pre></example>

<noindent></noindent>
<para>where the white space between <samp>one</samp> and <samp>word</samp> is produced by
the newline after <samp>one</samp>, not by the space before <samp>word</samp>.
</para>
<!-- c @PkgIndex{xspace} -->
<!-- c Some individual commands, notably those defined with the @package{xspace}, -->
<!-- c package do not follow the standard behavior. -->


</section>
<node name="_007e" spaces=" "><nodename>~</nodename><nodenext automatic="on">\thinspace &amp; \negthinspace</nodenext><nodeprev automatic="on">\(SPACE)</nodeprev><nodeup automatic="on">Spaces</nodeup></node>
<section spaces=" "><sectiontitle><code>~</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="935" mergedindex="cp">~</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="748">tie</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="749">space, unbreakable</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="750">hard space</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="751">unbreakable space</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="752">NBSP</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve"><var>before</var>~<var>after</var>
</pre></example>

<para>The <dfn>tie</dfn> character, <code>~</code>, produces a space between <var>before</var> and
<var>after</var> at which the line will not be broken. By default the white
space has length 3.33333<dmn>pt</dmn> plus 1.66666<dmn>pt</dmn> minus
1.11111<dmn>pt</dmn> (<pxref label="Lengths"><xrefnodename>Lengths</xrefnodename></pxref>).
</para>
<!-- c This paragraph is not translated to French, as the French translation -->
<!-- c uses a term that means ``unbreakable''. -->
<para>Note that the word <samp>tie</samp> has this meaning in the &tex;/Texinfo
community; this differs from the typographic term &textldquo;tie&textrdquo;, which
is a diacritic in the shape of an arc, called a &textldquo;tie-after&textrdquo; accent
in <cite>The &tex;book</cite>.
</para>
<para>Here &latex; will not break the line between the final two words:
</para>
<example endspaces=" ">
<pre xml:space="preserve">Thanks to Prof.~Lerman.
</pre></example>

<noindent></noindent>
<para>In addition, despite the period, &latex; does not use the
end-of-sentence spacing (<pxref label="_005c_0040"><xrefnodename>\&arobase;</xrefnodename></pxref>).
</para>
<para>Ties prevent the end of line separation of things where that could
cause confusion. They also still allow hyphenation (of either of the
tied words), so they are generally preferable to putting consecutive
words in an <code>\mbox</code> (<pxref label="_005cmbox-_0026-_005cmakebox"><xrefnodename>\mbox &amp; \makebox</xrefnodename></pxref>). 
</para>
<para>They are also matters of taste, sometimes alarmingly dogmatic taste,
among readers. Nevertheless, here are some usage models, many of them
from <cite>The &tex;book</cite>.
</para>
<itemize commandarg="bullet" spaces=" " endspaces=" "><itemprepend><formattingcommand command="bullet"/></itemprepend>
<listitem><prepend>&bullet;</prepend>
<para>Between an enumerator label and number, such as in references:
<code>Chapter~12</code>, or <code>Theorem~\ref&lbrace;th:Wilsons&rbrace;</code>, or
<code>Figure~\ref&lbrace;fig:KGraph&rbrace;</code>.
</para>
</listitem><listitem><prepend>&bullet;</prepend>
<para>When cases are enumerated inline: <code>(b)~Show that $f(x)$ is
(1)~continuous, and (2)~bounded</code>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="753"><r>package</r>, <code>siunitx</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="754"><code>siunitx</code> <r>package</r></indexterm></cindex>

</listitem><listitem><prepend>&bullet;</prepend>
<para>Between a number and its unit: <code>$745.7.8$~watts</code> (the
<code>siunitx</code> package has a special facility for this) or
<code>144~eggs</code>. This includes between a month and day number in a date:
<code>October~12</code> or <code>12~Oct</code>. In general, in any expressions where
numbers and abbreviations or symbols are separated by a space:
<code>AD~565</code>, or <code>2:50~pm</code>, or <code>Boeing~747</code>, or
<code>268~Plains Road</code>, or <code>\$$1.4$~billion</code>. Other common
choices here are a thin space (<pxref label="_005cthinspace-_0026-_005cnegthinspace"><xrefnodename>\thinspace &amp; \negthinspace</xrefnodename></pxref>) and
no space at all.
</para>
</listitem><listitem><prepend>&bullet;</prepend>
<para>When mathematical phrases are rendered in words: <code>equals~$n$</code>, or
<code>less than~$\epsilon$</code>, or <code>given~$X$</code>, or <code>modulo~$p^e$
for all large~$n$</code> (but compare <code>is~$15$</code> with <code>is $15$~times
the height</code>). Between mathematical symbols in apposition with nouns:
<code>dimension~$d$</code> or <code>function~$f(x)$</code> (but compare <code>with
length $l$~or more</code>). When a symbol is a tightly bound object of a
preposition: <code>of~$x$</code>, or <code>from $0$ to~$1$</code>, or <code>in
common with~$m$</code>.
</para>
</listitem><listitem><prepend>&bullet;</prepend>
<para>Between symbols in series: <code>$1$,~$2$, or~$3$</code> or <code>$1$,~$2$,
\ldots,~$n$</code>.
</para>
</listitem><listitem><prepend>&bullet;</prepend>
<para>Between a person&textrsquo;s given names and between multiple surnames:
<code>Donald~E. Knuth</code>, or <code>Luis~I. Trabb~Pardo</code>, or
<code>Charles~XII</code>&textmdash;but you must give &tex; places to break the line
so you might do <code>Charles Louis Xavier~Joseph de~la
Vall\'ee~Poussin</code>.
</para>
</listitem></itemize>


</section>
<node name="_005cthinspace-_0026-_005cnegthinspace" spaces=" "><nodename>\thinspace &amp; \negthinspace</nodename><nodenext automatic="on">\/</nodenext><nodeprev automatic="on">~</nodeprev><nodeup automatic="on">Spaces</nodeup></node>
<section spaces=" "><sectiontitle><code>\thinspace</code> &amp; <code>\negthinspace</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="936" mergedindex="cp">\thinspace</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="937" mergedindex="cp">\negthinspace</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="755">thin space</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="756">space, thin</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="757">thin space, negative</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="758">space, negative thin</indexterm></cindex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\thinspace
\negthinspace
</pre></example>

<para>These produce unbreakable and unstretchable spaces of 1/6<dmn>em</dmn> and
-1/6<dmn>em</dmn>, respectively.  These are the text mode equivalents of
<code>\,</code> and <code>\!</code> (<pxref label="Spacing-in-math-mode_002f_005cthinspace"><xrefnodename>Spacing in math mode/\thinspace</xrefnodename></pxref>).
</para>
<para>You can use <code>\,</code> as a synonym for <code>\thinspace</code> in text mode.
</para>
<para>One common use of <code>\thinspace</code> is as the space between nested
quotes:
</para>
<example endspaces=" ">
<pre xml:space="preserve">Killick replied, ``I heard the Captain say, `Ahoy there.'\thinspace''
</pre></example>

<noindent></noindent>
<para>Another use is that some style guides call for a <code>\thinspace</code>
between an ellipsis and a sentence ending period (other style guides,
think the three dots and/or four dots are plenty).  Another
style-specific use is between initials, as in <code>D.\thinspace E.\
Knuth</code>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="759"><r>package</r>, <code>amsmath</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="760"><code>amsmath</code> <r>package</r></indexterm></cindex>

<para>&latex; provides a variety of similar spacing commands for math mode
(<pxref label="Spacing-in-math-mode"><xrefnodename>Spacing in math mode</xrefnodename></pxref>).  With the <code>amsmath</code> package, or as
of the 2020-10-01 &latex; release, they can be used in text mode as
well as math mode, including <code>\!</code> for <code>\negthinspace</code>; but
otherwise, they are available only in math mode.
</para>
</section>
<node name="_005c_002f" spaces=" "><nodename>\/</nodename><nodenext automatic="on">\hrulefill &amp; \dotfill</nodenext><nodeprev automatic="on">\thinspace &amp; \negthinspace</nodeprev><nodeup automatic="on">Spaces</nodeup></node>
<section spaces=" "><sectiontitle><code>\/</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="938" mergedindex="cp">\/</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="761">italic correction</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve"><var>before-character</var>\/<var>after-character</var>
</pre></example>

<para>Insert an <dfn>italic correction</dfn>, a small space defined by the font
designer for each character (possibly zero), to avoid the character
colliding with whatever follows. When you use <code>\/</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.
</para>
<para>Here, were it not for the <code>\/</code>, the <var>before-character</var>
italic&nbsp;f would hit the <var>after-character</var> roman&nbsp;H
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcommand&lbrace;\companylogo&rbrace;&lbrace;&lbrace;\it f&rbrace;\/H&rbrace;
</pre></example>

<noindent></noindent> 
<para>because the italic letter f leans far to the right.
</para>
<para>If <var>after-character</var> is a period or comma then don&textrsquo;t insert an
italic correction since those punctuation symbols are so low to the
baseline already.  However, with semicolons or colons, as well as with
normal letters, the italic correction can help. It is typically used
between a switch from italic or slanted fonts to an upright font.
</para>
<para>When you use commands such as <code>\emph</code> and <code>\textit</code> and
<code>\textsl</code> to change fonts, &latex; automatically inserts the
italic correction when needed (<pxref label="Font-styles"><xrefnodename>Font styles</xrefnodename></pxref>).  However,
declarations such as <code>\em</code> and <code>\itshape</code> and
<code>\slshape</code> do not automatically insert italic corrections.
</para>
<para>Upright characters can also have an italic correction.  An example
where this is needed is the name <code>pdf\/\TeX</code>. However, most
upright characters have a zero italic correction. Some font creators
do not include italic correction values even for italic fonts.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="939" mergedindex="cp">\fontdimen1</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="762">font dimension, slant</indexterm></cindex>
<para>Technically, &latex; uses another font-specific value, the so-called
<dfn>slant parameter</dfn> (namely <code>\fontdimen1</code>), to determine whether
to possibly insert an italic correction, rather than tying the action to
particular font commands.
</para>
<para>There is no concept of italic correction in math mode; math spacing is
done in a different way.
</para>

</section>
<node name="_005chrulefill-_0026-_005cdotfill" spaces=" "><nodename>\hrulefill &amp; \dotfill</nodename><nodenext automatic="on">\bigskip &amp; \medskip &amp; \smallskip</nodenext><nodeprev automatic="on">\/</nodeprev><nodeup automatic="on">Spaces</nodeup></node>
<section spaces=" "><sectiontitle><code>\hrulefill</code> &amp; <code>\dotfill</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="940" mergedindex="cp">\hrulefill</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="941" mergedindex="cp">\dotfill</indexterm></findex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\hrulefill
\dotfill
</pre></example>

<para>Produce an infinite horizontal rubber length (<pxref label="Lengths"><xrefnodename>Lengths</xrefnodename></pxref>) that
&latex; fills with a rule (that is, a line) or with dots, instead of
white space.
</para>
<para>This outputs a line 2 inches long.
</para>
<example endspaces=" ">
<pre xml:space="preserve">Name:~\makebox[2in]&lbrace;\hrulefill&rbrace;
</pre></example>

<noindent></noindent>
<para>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.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\noindent John Aubrey, RN \dotfill&lbrace;&rbrace; Melbury Lodge
</pre></example>

<para>To make the rule or dots go to the line&textrsquo;s end use <code>\null</code> at the
start or end.  
</para>
<para>To change the rule&textrsquo;s thickness, copy the definition and adjust it, as
here
</para>
<example endspaces=" ">
<pre xml:space="preserve">\renewcommand&lbrace;\hrulefill&rbrace;&lbrace;%
  \leavevmode\leaders\hrule height 1pt\hfill\kern0pt &rbrace;
</pre></example>

<noindent></noindent>
<para>which changes the default thickness of 0.4<dmn>pt</dmn> to 1<dmn>pt</dmn>.
Similarly, adjust the dot spacing as with
</para>
<example endspaces=" ">
<pre xml:space="preserve">\renewcommand&lbrace;\dotfill&rbrace;&lbrace;%
  \leavevmode\cleaders\hbox to 1.00em&lbrace;\hss .\hss &rbrace;\hfill\kern0pt &rbrace;
</pre></example>

<noindent></noindent>
<para>which changes the default length of 0.33<dmn>em</dmn> to 1.00<dmn>em</dmn>.
</para>
<para>This example produces a line for a signature.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;minipage&rbrace;&lbrace;4cm&rbrace;
  \centering
  \hrulefill\\
  Signed
\end&lbrace;minipage&rbrace;
</pre></example>

<noindent></noindent>
<para>The line is 4<dmn>cm</dmn> long.
</para>

</section>
<node name="_005cbigskip-_0026-_005cmedskip-_0026-_005csmallskip" spaces=" "><nodename>\bigskip &amp; \medskip &amp; \smallskip</nodename><nodenext automatic="on">\bigbreak &amp; \medbreak &amp; \smallbreak</nodenext><nodeprev automatic="on">\hrulefill &amp; \dotfill</nodeprev><nodeup automatic="on">Spaces</nodeup></node>
<section spaces=" "><sectiontitle><code>\bigskip</code> &amp; <code>\medskip</code> &amp; <code>\smallskip</code></sectiontitle>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\bigskip
\medskip
\smallskip
</pre></example>

<para>Produce an amount of vertical space, large or medium-sized or
small. These commands are fragile (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>Here the skip suggests the passage of time (from <i>The Golden Ocean</i> by
O&textrsquo;Brian).
</para>
<example endspaces=" ">
<pre xml:space="preserve">Mr Saumarez would have something rude to say to him, no doubt: he
was at home again, and it was delightful.

\bigskip
``A hundred and fifty-seven miles and one third, in twenty-four hours,''
said Peter.
</pre></example>

<para>Each command is associated with a length defined in the document class
file.
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<beforefirstitem><anchor name="bigskip">bigskip</anchor>
</beforefirstitem><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="942" mergedindex="cp">\bigskip</indexterm>\bigskip</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="943" mergedindex="cp">\bigskipamount</indexterm></findex>
<para>The same as <code>\vspace&lbrace;\bigskipamount&rbrace;</code>, ordinarily about one line
space, with stretch and shrink.  The default for the <code>book</code> and
<code>article</code> classes is <code>12pt plus 4pt minus 4pt</code>.
</para>
<anchor name="medskip">medskip</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="944" mergedindex="cp">\medskip</indexterm>\medskip</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="945" mergedindex="cp">\medskipamount</indexterm></findex>
<para>The same as <code>\vspace&lbrace;\medskipamount&rbrace;</code>, ordinarily about half of a
line space, with stretch and shrink.  The default for the <code>book</code>
and <code>article</code> classes is <code>6pt plus 2pt minus 2pt</code>.
</para>
<anchor name="smallskip">smallskip</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="946" mergedindex="cp">\smallskip</indexterm>\smallskip</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="947" mergedindex="cp">\smallskipamount</indexterm></findex>
<para>The same as <code>\vspace&lbrace;\smallskipamount&rbrace;</code>, ordinarily about a
quarter of a line space, with stretch and shrink.  The default for the
<code>book</code> and <code>article</code> classes is <code>3pt plus 1pt minus 1pt</code>.
</para>
</tableitem></tableentry></ftable>

<para>Because each command is a <code>\vspace</code>, if you use it 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.
</para>
<para>The commands <code>\bigbreak</code>, <code>\medbreak</code>, and <code>\smallbreak</code>
are similar but also suggest to &latex; that this is a good place to
put a page break (<pxref label="_005cbigbreak-_0026-_005cmedbreak-_0026-_005csmallbreak"><xrefnodename>\bigbreak &amp; \medbreak &amp; \smallbreak</xrefnodename></pxref>.
</para>

</section>
<node name="_005cbigbreak-_0026-_005cmedbreak-_0026-_005csmallbreak" spaces=" "><nodename>\bigbreak &amp; \medbreak &amp; \smallbreak</nodename><nodenext automatic="on">\strut</nodenext><nodeprev automatic="on">\bigskip &amp; \medskip &amp; \smallskip</nodeprev><nodeup automatic="on">Spaces</nodeup></node>
<section spaces=" "><sectiontitle><code>\bigbreak</code> &amp; <code>\medbreak</code> &amp; <code>\smallbreak</code></sectiontitle>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\bigbreak
\medbreak
\smallbreak
</pre></example>

<para>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.)
</para>
<para><xref label="_005cbigskip-_0026-_005cmedskip-_0026-_005csmallskip"><xrefnodename>\bigskip &amp; \medskip &amp; \smallskip</xrefnodename></xref>, 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</code>).  In addition, they terminate a paragraph where
they are used: this example
</para>
<example endspaces=" ">
<pre xml:space="preserve">abc\bigbreak def ghi

jkl mno pqr
</pre></example>

<noindent></noindent>
<para>will output three paragraphs, the first ending in <samp>abc</samp> and the
second starting, after an extra vertical space and a paragraph indent,
with <samp>def</samp>.
</para>

</section>
<node name="_005cstrut" spaces=" "><nodename>\strut</nodename><nodenext automatic="on">\vspace</nodenext><nodeprev automatic="on">\bigbreak &amp; \medbreak &amp; \smallbreak</nodeprev><nodeup automatic="on">Spaces</nodeup></node>
<section spaces=" "><sectiontitle><code>\strut</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="948" mergedindex="cp">\strut</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="763">strut</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\strut
</pre></example>

<para>Ensure that the current line has height at least <code>0.7\baselineskip</code>
and depth at least <code>0.3\baselineskip</code>.  Essentially, &latex;
inserts into the line a rectangle having zero width,
<code>\rule[-0.3\baselineskip]&lbrace;0pt&rbrace;&lbrace;\baselineskip&rbrace;</code> (<pxref label="_005crule"><xrefnodename>\rule</xrefnodename></pxref>).
The <code>\baselineskip</code> changes with the current font or fontsize.
</para>
<para>In this example the <code>\strut</code> keeps the box inside the frame from
having zero height.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\setlength&lbrace;\fboxsep&rbrace;&lbrace;0pt&rbrace;\framebox[2in]&lbrace;\strut&rbrace;
</pre></example>

<para>This example has four lists.  In the first there is a much bigger gap
between items 2 and&nbsp;3 than there is between items 1 and&nbsp;2.
The second list fixes that with a <code>\strut</code> at the end of its first
item&textrsquo;s second line.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\setlength&lbrace;\fboxsep&rbrace;&lbrace;0pt&rbrace;
\noindent\begin&lbrace;minipage&rbrace;[t]&lbrace;0.2\linewidth&rbrace;
\begin&lbrace;enumerate&rbrace;
  \item \parbox[t]&lbrace;15pt&rbrace;&lbrace;test \\ test&rbrace;
  \item test
  \item test
\end&lbrace;enumerate&rbrace;
\end&lbrace;minipage&rbrace;%
\begin&lbrace;minipage&rbrace;[t]&lbrace;0.2\linewidth&rbrace;
\begin&lbrace;enumerate&rbrace;
  \item \parbox[t]&lbrace;15pt&rbrace;&lbrace;test \\ test\strut&rbrace;
  \item test
  \item test
\end&lbrace;enumerate&rbrace;
\end&lbrace;minipage&rbrace;%
\begin&lbrace;minipage&rbrace;[t]&lbrace;0.2\linewidth&rbrace;
\begin&lbrace;enumerate&rbrace;
  \item \fbox&lbrace;\parbox[t]&lbrace;15pt&rbrace;&lbrace;test \\ test&rbrace;&rbrace;
  \item \fbox&lbrace;test&rbrace;
  \item \fbox&lbrace;test&rbrace;
\end&lbrace;enumerate&rbrace;
\end&lbrace;minipage&rbrace;%
\begin&lbrace;minipage&rbrace;[t]&lbrace;0.2\linewidth&rbrace;
\begin&lbrace;enumerate&rbrace;
  \item \fbox&lbrace;\parbox[t]&lbrace;15pt&rbrace;&lbrace;test \\ test\strut&rbrace;&rbrace;
  \item \fbox&lbrace;test&rbrace;
  \item \fbox&lbrace;test&rbrace;
\end&lbrace;enumerate&rbrace;
\end&lbrace;minipage&rbrace;%
</pre></example>

<noindent></noindent>
<para>The final two lists use <code>\fbox</code> to show what&textrsquo;s happening.  The
first item <code>\parbox</code> of the third list goes only to the bottom of
its second <samp>test</samp>, 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.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="764"><r>package</r>, <code>TikZ</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="765"><code>TikZ</code> <r>package</r></indexterm></cindex>
 <cindex index="cp" spaces=" "><indexterm index="cp" number="766"><r>package</r>, <code>Asymptote</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="767"><code>Asymptote</code> <r>package</r></indexterm></cindex>

<para>The <code>\strut</code> command is often useful in graphics, such as in
<code>TikZ</code> or <code>Asymptote</code>.  For instance, you may have a command
such as <code>\graphnode&lbrace;<var>node-name</var>&rbrace;</code> that fits a circle around
<var>node-name</var>.  However, unless you are careful the <var>node-name</var>&textrsquo;s
<samp>x</samp> and <samp>y</samp> will produce different-diameter circles because
the characters are different sizes.  A careful <code>\graphnode</code> might
insert a <code>\strut</code>, then <var>node-name</var>, and then draw the circle.
</para>
<para>The general approach of using a zero width <code>\rule</code> is useful in
many circumstances.  In this table, the zero-width rule keeps the top of
the first integral from hitting the <code>\hline</code>.  Similarly, the
second rule keeps the second integral from hitting the first.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;tabular&rbrace;&lbrace;rl&rbrace;
  \textsc&lbrace;Integral&rbrace;   &amp;\textsc&lbrace;Value&rbrace;           \\
  \hline
  $\int_0^x t\, dt$   &amp;$x^2/2$  \rule&lbrace;0em&rbrace;&lbrace;2.5ex&rbrace; \\  
  $\int_0^x t^2\, dt$ &amp;$x^3/3$  \rule&lbrace;0em&rbrace;&lbrace;2.5ex&rbrace;
\end&lbrace;tabular&rbrace;
</pre></example>

<noindent></noindent>
<para>(Although the line-ending double backslash command has an available
optional argument to change the corresponding baseline skip, that won&textrsquo;t
solve this issue.  Changing the first double backslash to something like
<code>\\[2.5ex]</code> will put more room between the header line and the
<code>\hline</code> rule, and the integral would still hit the rule.)
</para>

</section>
<node name="_005cvspace" spaces=" "><nodename>\vspace</nodename><nodenext automatic="on">\vfill</nodenext><nodeprev automatic="on">\strut</nodeprev><nodeup automatic="on">Spaces</nodeup></node>
<section spaces=" "><sectiontitle><code>\vspace</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="949" mergedindex="cp">\vspace</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="768">vertical space</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="769">space, vertical</indexterm></cindex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\vspace&lbrace;<var>length</var>&rbrace;
\vspace*&lbrace;<var>length</var>&rbrace;
</pre></example>

<para>Add the vertical space <var>length</var>.  The <var>length</var> can be positive,
negative, or zero.  It is a rubber length&textmdash;it may contain a <code>plus</code>
or <code>minus</code> component (<pxref label="Lengths"><xrefnodename>Lengths</xrefnodename></pxref>).
</para>
<para>This puts space between the two paragraphs.
</para>
<example endspaces=" ">
<pre xml:space="preserve">And I slept.

\vspace&lbrace;1ex plus 0.5ex&rbrace;
The new day dawned cold.
</pre></example>

<noindent></noindent>
<para>(<xref label="_005cbigskip-_0026-_005cmedskip-_0026-_005csmallskip"><xrefnodename>\bigskip &amp; \medskip &amp; \smallskip</xrefnodename></xref>, for common inter-paragraph
spaces.)
</para>
<para>The <code>*</code>-form inserts vertical space that is non-discardable.  More
precisely, &latex; discards vertical space at a page break and the
<code>*</code>-form causes the space to stay.  This example leaves space
between the two questions.
</para>
<example endspaces=" ">
<pre xml:space="preserve">Question: Find the integral of \( 5x^4+5 \).

\vspace*&lbrace;2cm plus 0.5cm&rbrace;
Question: Find the derivative of \( x^5+5x+9 \).
</pre></example>

<noindent></noindent>
<para>That space will be present even if the page break happens to fall
between the questions.
</para>
<para>If you use <code>\vspace</code> in the middle of a paragraph (i.e., in
horizontal mode) then the space is inserted after the line containing
the <code>\vspace</code> command; it does not start a new paragraph at the
<code>\vspace</code> command.
</para>
<para>In this example the two questions will be evenly spaced vertically on
the page, with at least one inch of space below each.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;document&rbrace;
1) Who put the bomp in the bomp bah bomp bah bomp?
\vspace&lbrace;1in plus 1fill&rbrace;

2) Who put the ram in the rama lama ding dong?
\vspace&lbrace;1in plus 1fill&rbrace;
\end&lbrace;document&rbrace;
</pre></example>


</section>
<node name="_005cvfill" spaces=" "><nodename>\vfill</nodename><nodenext automatic="on">\addvspace</nodenext><nodeprev automatic="on">\vspace</nodeprev><nodeup automatic="on">Spaces</nodeup></node>
<section spaces=" "><sectiontitle><code>\vfill</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="950" mergedindex="cp">\vfill</indexterm></findex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="770">stretch, infinite vertical</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="771">infinite vertical stretch</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\vfill
</pre></example> 

<para>End the current paragraph and insert a vertical rubber length that is
infinite, so it can stretch or shrink as far as needed
(<pxref label="Lengths"><xrefnodename>Lengths</xrefnodename></pxref>).
</para>
<para>It is often used in the same way as <code>\vspace&lbrace;\fill&rbrace;</code>, except that
<code>\vfill</code> ends the current paragraph whereas <code>\vspace&lbrace;\fill&rbrace;</code>
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&nbsp;<ref label="_005cvspace"><xrefnodename>\vspace</xrefnodename></ref>.
</para>
<para>In this example the page is filled, so the top and bottom lines contain
the text <samp>Lost Dog!</samp> and the second <samp>Lost Dog!</samp> is exactly
halfway between them.
</para> 
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;document&rbrace;
Lost Dog!
\vfill
Lost Dog!  % perfectly in the middle
\vfill
Lost Dog!
\end&lbrace;document&rbrace;
</pre></example>


</section>
<node name="_005caddvspace" spaces=" "><nodename>\addvspace</nodename><nodeprev automatic="on">\vfill</nodeprev><nodeup automatic="on">Spaces</nodeup></node>
<section spaces=" "><sectiontitle><code>\addvspace</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="951" mergedindex="cp">\addvspace</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="772">vertical space</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="773">space, inserting vertical</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\addvspace&lbrace;<var>vert-length</var>&rbrace;
</pre></example>

<para>Add a vertical space of <var>vert-length</var>.  However, if there are two or
more <code>\addvspace</code>&textrsquo;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</var>&textrsquo;s in that sequence. This command is fragile
(<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).  The <var>vert-length</var> is a rubber length
(<pxref label="Lengths"><xrefnodename>Lengths</xrefnodename></pxref>).
</para>
<para>This example illustrates.  The <code>picture</code> draws a scale over which
to rules are placed.  In a standard &latex; article the length
<code>\baselineskip</code> is 12<dmn>pt</dmn>.  As shown by the scale, the two
rules are 22<dmn>pt</dmn> apart: the sum of the <code>\baselineskip</code> and the
10<dmn>pt</dmn> from the first <code>\addvspace</code>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\documentclass&lbrace;article&rbrace;
\usepackage&lbrace;color&rbrace;
\begin&lbrace;document&rbrace;
\setlength&lbrace;\unitlength&rbrace;&lbrace;2pt&rbrace;%
\noindent\begin&lbrace;picture&rbrace;(0,0)%
  \multiput(0,0)(0,-1)&lbrace;25&rbrace;&lbrace;&lbrace;\color&lbrace;blue&rbrace;\line(1,0)&lbrace;1&rbrace;&rbrace;&rbrace;
  \multiput(0,0)(0,-5)&lbrace;6&rbrace;&lbrace;&lbrace;\color&lbrace;red&rbrace;\line(1,0)&lbrace;2&rbrace;&rbrace;&rbrace;
\end&lbrace;picture&rbrace;%
\rule&lbrace;0.25\linewidth&rbrace;&lbrace;0.1pt&rbrace;% 
\par\addvspace&lbrace;10pt&rbrace;% \addvspace&lbrace;20pt&rbrace;%
\par\noindent\rule&lbrace;0.25\linewidth&rbrace;&lbrace;0.1pt&rbrace;%
\end&lbrace;document&rbrace;
</pre></example>

<noindent></noindent>
<para>Now uncomment the second <code>\addvspace</code>.  It does not make the gap
20<dmn>pt</dmn> longer; instead the gap is the sum of <code>\baselineskip</code>
and 20<dmn>pt</dmn>.  So <code>\addvspace</code> in a sense does the opposite of
its name&textmdash;it makes sure that multiple vertical spaces do not
accumulate, but instead that only the largest one is used.
</para>
<para>&latex; uses this command to adjust the vertical space above or below
an environment that starts a new paragraph.  For instance, a
<code>theorem</code> environment begins and ends with <code>\addvspace</code> so
that two consecutive <code>theorem</code>&textrsquo;s are separated by one vertical
space, not two.
</para>
<para>A error <samp>Something's wrong--perhaps a missing \item</samp> pointing to an
<code>\addvspace</code> means that you were not in vertical mode when you hit
this command. One way to change that is to precede <code>\addvspace</code>
with a <code>\par</code> command (<pxref label="_005cpar"><xrefnodename>\par</xrefnodename></pxref>), as in the above example.
</para>

</section>
</chapter>
<node name="Boxes" spaces=" "><nodename>Boxes</nodename><nodenext automatic="on">Color</nodenext><nodeprev automatic="on">Spaces</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Boxes</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="774">boxes</indexterm></cindex>

<!-- c xx Expand on boxes and glue, for xref from elsewhere. -->
<para>At its core, &latex; puts things in boxes and then puts the boxes on a
page.  So these commands are central.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="775"><r>package</r>, <code>adjustbox</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="776"><code>adjustbox</code> <r>package</r></indexterm></cindex>

<para>There are many packages on CTAN that are useful for manipulating boxes.
One useful adjunct to the commands here is <code>adjustbox</code>.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::    ">\mbox &amp; \makebox</menunode><menudescription><pre xml:space="preserve">Horizontal boxes.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::   ">\fbox &amp; \framebox</menunode><menudescription><pre xml:space="preserve">Put a frame around a box.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::             ">\parbox</menunode><menudescription><pre xml:space="preserve">Box with text in paragraph mode.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::           ">\raisebox</menunode><menudescription><pre xml:space="preserve">Raise or lower text.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::    ">\sbox &amp; \savebox</menunode><menudescription><pre xml:space="preserve">Like <code>\makebox</code> but save the text for later.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::               ">lrbox</menunode><menudescription><pre xml:space="preserve">Environment version of <code>\sbox</code>.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::             ">\usebox</menunode><menudescription><pre xml:space="preserve">Print saved text.
</pre></menudescription></menuentry></menu>


<node name="_005cmbox-_0026-_005cmakebox" spaces=" "><nodename>\mbox &amp; \makebox</nodename><nodenext automatic="on">\fbox &amp; \framebox</nodenext><nodeup automatic="on">Boxes</nodeup></node>
<section spaces=" "><sectiontitle><code>\mbox</code> &amp; <code>\makebox</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="952" mergedindex="cp">\mbox</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="953" mergedindex="cp">\makebox</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="777">box</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="778">make a box</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="779">hyphenation, preventing</indexterm></cindex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\mbox&lbrace;<var>text</var>&rbrace;
\makebox&lbrace;<var>text</var>&rbrace;
\makebox[<var>width</var>]&lbrace;<var>text</var>&rbrace;
\makebox[<var>width</var>][<var>position</var>]&lbrace;<var>text</var>&rbrace;
</pre></example>

<para>Create a box, a container for material.  The <var>text</var> is typeset in
LR mode (<pxref label="Modes"><xrefnodename>Modes</xrefnodename></pxref>) so it is not broken into lines.  The
<code>\mbox</code> command is robust, while <code>\makebox</code> is fragile
(<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>Because <code>text</code> is not broken into lines, you can use <code>\mbox</code>
to prevent hyphenation.  In this example, &latex; will not hyphenate
the tank name, <samp>T-34</samp>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">The soviet tank \mbox&lbrace;T-34&rbrace; is a symbol of victory against nazism.
</pre></example>

<para>The first two command synopsis versions, <code>\mbox</code> and <code>\makebox</code>, are
roughly equivalent.  They create a box just wide enough to contain the
<var>text</var>.  (They are like plain &tex;&textrsquo;s <code>\hbox</code>.)
</para>
<para>In the third version the optional argument <var>width</var> 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</var> can be too small;
this creates a full-line box
</para>
<example endspaces=" ">
<pre xml:space="preserve">\makebox[\linewidth]&lbrace;Chapter Exam&rbrace;
</pre></example>

<noindent></noindent>
<para>with <samp>Chapter Exam</samp> centered.  But <var>text</var> can also be too wide
for <var>width</var>.  See the example below of zero-width boxes.
</para>
<anchor name="mbox-makebox-depth">mbox makebox depth</anchor>
<anchor name="mbox-makebox-height">mbox makebox height</anchor>
<anchor name="mbox-makebox-width">mbox makebox width</anchor>
<anchor name="mbox-makebox-totalheight">mbox makebox totalheight</anchor>
<para>In the <var>width</var> argument you can use the following lengths that refer
to the dimension of the box that &latex; gets on typesetting
<var>text</var>: <code>\depth</code>, <code>\height</code>, <code>\width</code>,
<code>\totalheight</code> (this is the box&textrsquo;s height plus its depth).  For
example, to make a box with the text stretched to double the natural
size you can say this.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\makebox[2\width]&lbrace;Get a stretcher&rbrace;
</pre></example>

<para>For the fourth command synopsis version the optional argument <var>position</var>
gives position of the text within the box. It may take the following
values:
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">c</itemformat></item>
</tableterm><tableitem><para>The <var>text</var> is centered (default).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">l</itemformat></item>
</tableterm><tableitem><para>The <var>text</var> is flush left.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">r</itemformat></item>
</tableterm><tableitem><para>Flush right.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">s</itemformat></item>
</tableterm><tableitem><!-- c xx TODO add a generic node to make clear that some statement may be -->
<!-- c not true for some internationalization or some script. Eg. in Arabic -->
<!-- c script or with microtype package I think that the strech also plays -->
<!-- c on word width -->
<para>Stretch the interword space in <var>text</var> across the entire <var>width</var>.
The <var>text</var> must contain stretchable space for this to work.  For
instance, this could head a press release:
<code>\noindent\makebox[\textwidth][s]&lbrace;\large\hfil IMMEDIATE\hfil
RELEASE\hfil&rbrace;</code>
</para></tableitem></tableentry></table>

<para>A common use of <code>\makebox</code> is to make zero-width text boxes.  This
puts the value of the quiz questions to the left of those questions.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcommand&lbrace;\pts&rbrace;[1]&lbrace;\makebox[0em][r]&lbrace;#1 points\hspace*&lbrace;1em&rbrace;&rbrace;&rbrace;
\pts&lbrace;10&rbrace;What is the air-speed velocity of an unladen swallow?

\pts&lbrace;90&rbrace;An African or European swallow?
</pre></example>

<noindent></noindent>
<para><cindex index="cp" spaces=" "><indexterm index="cp" number="780"><r>package</r>, <code>TikZ</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="781"><code>TikZ</code> <r>package</r></indexterm></cindex>
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="782"><r>package</r>, <code>Asymptote</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="783"><code>Asymptote</code> <r>package</r></indexterm></cindex>

<para>The right edge of the output <samp>10 points </samp> (note the ending space
after <samp>points</samp>) will be just before the <samp>What</samp>.  You can use
<code>\makebox</code> similarly when making graphics, such as in <code>TikZ</code>
or <code>Asymptote</code>, where you put the edge of the text at a known
location, regardless of the length of that text.
</para>
<para>For boxes with frames see&nbsp;<ref label="_005cfbox-_0026-_005cframebox"><xrefnodename>\fbox &amp; \framebox</xrefnodename></ref>. For colors
see&nbsp;<ref label="Colored-boxes"><xrefnodename>Colored boxes</xrefnodename></ref>.
</para>
<para>There is a related version of <code>\makebox</code> that is used within the
<code>picture</code> environment, where the length is given in terms of
<code>\unitlength</code> (<pxref label="_005cmakebox-_0028picture_0029"><xrefnodename>\makebox (picture)</xrefnodename></pxref>).
</para>
<para>As <var>text</var> is typeset in LR mode, neither a double backslash
<code>\\</code> nor <code>\par</code> will give you a new line; for instance
<code>\makebox&lbrace;abc def \\ ghi&rbrace;</code> outputs <samp>abc defghi</samp> while
<code>\makebox&lbrace;abc def \par ghi&rbrace;</code> outputs <samp>abc def ghi</samp>, both on
a single line.  To get multiple lines see&nbsp;<ref label="_005cparbox"><xrefnodename>\parbox</xrefnodename></ref>
and&nbsp;<ref label="minipage"><xrefnodename>minipage</xrefnodename></ref>.
</para>

</section>
<node name="_005cfbox-_0026-_005cframebox" spaces=" "><nodename>\fbox &amp; \framebox</nodename><nodenext automatic="on">\parbox</nodenext><nodeprev automatic="on">\mbox &amp; \makebox</nodeprev><nodeup automatic="on">Boxes</nodeup></node>
<section spaces=" "><sectiontitle><code>\fbox</code> &amp; <code>\framebox</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="954" mergedindex="cp">\fbox</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="955" mergedindex="cp">\framebox</indexterm></findex>

<para>Synopses, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\fbox&lbrace;<var>text</var>&rbrace;
\framebox&lbrace;<var>text</var>&rbrace;
\framebox[<var>width</var>]&lbrace;<var>text</var>&rbrace;
\framebox[<var>width</var>][<var>position</var>]&lbrace;<var>text</var>&rbrace;
</pre></example>

<para>Create a box with an enclosing frame, four rules surrounding the <var>text</var>.
These commands are the same as <code>\mbox</code> and <code>\makebox</code> except
for the frame (<pxref label="_005cmbox-_0026-_005cmakebox"><xrefnodename>\mbox &amp; \makebox</xrefnodename></pxref>). The <code>\fbox</code> command is
robust, the <code>\framebox</code> command is fragile (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<example endspaces=" ">
<pre xml:space="preserve">\fbox&lbrace;Warning! No work shown, no credit given.&rbrace;
</pre></example>

<noindent></noindent>
<para>&latex; puts the text into a box, the text cannot be hyphenated.
Around that box, separated from it by a small gap, are four rules making
a frame.
</para>
<para>The first two command invocations, <code>\fbox&lbrace;...&rbrace;</code> and
<code>\framebox&lbrace;...&rbrace;</code>, are roughly the same.  As to the third and
fourth invocations, the optional arguments allow you to specify the box
width as <var>width</var> and the position of the text inside that box as
<var>position</var>.  <xref label="_005cmbox-_0026-_005cmakebox"><xrefnodename>\mbox &amp; \makebox</xrefnodename></xref>, for the full description but
here is an example creating an empty box that is 1/4<dmn>in</dmn> wide.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\setlength&lbrace;\fboxsep&rbrace;&lbrace;0pt&rbrace;\framebox[0.25in]&lbrace;\strut&rbrace;&rbrace;
</pre></example>

<noindent></noindent>
<para>The <code>\strut</code> ensures a total height of <code>\baselineskip</code>
(<pxref label="_005cstrut"><xrefnodename>\strut</xrefnodename></pxref>).
</para>
<para>These parameters determine the frame layout.
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<beforefirstitem><anchor name="fbox-framebox-fboxrule">fbox framebox fboxrule</anchor>
</beforefirstitem><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="956" mergedindex="cp">\fboxrule</indexterm>\fboxrule</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="957" mergedindex="cp">frame, line width</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="958" mergedindex="cp">frame rule width</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="784">\fboxrule</indexterm></cindex>
<para>The thickness of the rules around the enclosed box.  The default is
0.2<dmn>pt</dmn>.  Change it with a command such as
<code>\setlength&lbrace;\fboxrule&rbrace;&lbrace;0.8pt&rbrace;</code> (<pxref label="_005csetlength"><xrefnodename>\setlength</xrefnodename></pxref>).
</para>
<anchor name="fbox-framebox-fboxsep">fbox framebox fboxsep</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="959" mergedindex="cp">\fboxsep</indexterm>\fboxsep</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="960" mergedindex="cp">frame, separation from contents</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="785">\fboxsep</indexterm></cindex>
<para>The distance from the frame to the enclosed box. The default is 3<dmn>pt</dmn>.
Change it with a command such as <code>\setlength&lbrace;\fboxsep&rbrace;&lbrace;0pt&rbrace;</code>
(<pxref label="_005csetlength"><xrefnodename>\setlength</xrefnodename></pxref>).  Setting it to 0<dmn>pt</dmn> is useful sometimes:
this will put a frame around the picture with no white border.
</para>
<example endspaces=" ">
<pre xml:space="preserve">&lbrace;\setlength&lbrace;\fboxsep&rbrace;&lbrace;0pt&rbrace;%
 \framebox&lbrace;%
   \includegraphics[width=0.5\textwidth]&lbrace;prudence.jpg&rbrace;&rbrace;&rbrace;
</pre></example>

<noindent></noindent>
<para>The extra curly braces keep the effect of the <code>\setlength</code> local.
</para>
</tableitem></tableentry></ftable>

<para>As with <code>\mbox</code> and <code>\makebox</code>, &latex; will not break lines
in <var>text</var>.  But this example has &latex; break lines to make a
paragraph, and then frame the result.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\framebox&lbrace;%
  \begin&lbrace;minipage&rbrace;&lbrace;0.6\linewidth&rbrace;
    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&lbrace;minipage&rbrace;&rbrace;
</pre></example>

<para><xref label="Colored-boxes"><xrefnodename>Colored boxes</xrefnodename></xref>, for colors other than black and white.
</para>
<para>The <code>picture</code> environment has a version of the <code>\framebox</code>
command where the units depend on <code>picture</code>&textrsquo;s <code>\unitlength</code>
(<pxref label="_005cframebox-_0028picture_0029"><xrefnodename>\framebox (picture)</xrefnodename></pxref>).
</para>

</section>
<node name="_005cparbox" spaces=" "><nodename>\parbox</nodename><nodenext automatic="on">\raisebox</nodenext><nodeprev automatic="on">\fbox &amp; \framebox</nodeprev><nodeup automatic="on">Boxes</nodeup></node>
<section spaces=" "><sectiontitle><code>\parbox</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="961" mergedindex="cp">\parbox</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="786">paragraph mode</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="787">paragraph, in a box</indexterm></cindex>

<para>Synopses, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\parbox&lbrace;<var>width</var>&rbrace;&lbrace;<var>contents</var>&rbrace;
\parbox[<var>position</var>]&lbrace;<var>width</var>&rbrace;&lbrace;<var>contents</var>&rbrace;
\parbox[<var>position</var>][<var>height</var>]&lbrace;<var>width</var>&rbrace;&lbrace;<var>contents</var>&rbrace;
\parbox[<var>position</var>][<var>height</var>][<var>inner-pos</var>]&lbrace;<var>width</var>&rbrace;&lbrace;<var>contents</var>&rbrace;
</pre></example>

<para>Produce a box of text that is <var>width</var> wide. Use this command to make
a box of small pieces of text, of a single paragraph.  This command is
fragile (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;picture&rbrace;(0,0)
  ...
  \put(1,2)&lbrace;\parbox&lbrace;1.75in&rbrace;&lbrace;\raggedright Because the graph is a line on
                         this semilog paper, the relationship is
                         exponential.&rbrace;&rbrace;
\end&lbrace;picture&rbrace;
</pre></example>

<para>The <var>contents</var> are processed in a text mode (<pxref label="Modes"><xrefnodename>Modes</xrefnodename></pxref>) so
&latex; will break lines to make a paragraph.  But it won&textrsquo;t make
multiple paragraphs; for that, use a <code>minipage</code> environment
(<pxref label="minipage"><xrefnodename>minipage</xrefnodename></pxref>).
</para>
<para>The options for <code>\parbox</code> (except for <var>contents</var>) are the same
as those for <code>minipage</code>.  For convenience a summary of the options
is here but see&nbsp;<ref label="minipage"><xrefnodename>minipage</xrefnodename></ref> for a complete description.
</para>
<para>There are two required arguments.  The <var>width</var> is a rigid length
(<pxref label="Lengths"><xrefnodename>Lengths</xrefnodename></pxref>).  It sets the width of the box into which &latex;
typesets <var>contents</var>.  The <var>contents</var> is the text that is placed
in that box.  It should not have any paragraph-making components.
</para>
<para>There are three optional arguments, <var>position</var>, <var>height</var>, and
<var>inner-pos</var>.  The <var>position</var> gives the vertical alignment of the
<dfn>parbox</dfn> with respect to the surrounding material.  The supported
values are <code>c</code> or <code>m</code> to make the vertical center of the
parbox lines up with the center of the adjacent text line (this is the
default), or <code>t</code> to match the top line of the parbox with
the baseline of the surrounding material, or <code>b</code> to match the
bottom line.
</para>
<para>The optional argument <var>height</var> overrides the natural height of the
box.
</para>
<para>The optional argument <var>inner-pos</var> controls the placement of
<var>content</var> inside the <code>parbox</code>. Its default is the value of
<var>position</var>.  Its possible values are: <code>t</code> to put the
<var>content</var> at the top of the box, <code>c</code> to put it in the vertical
center, <code>b</code> to put it at the bottom of the box, and <code>s</code> to
stretch it out vertically (for this, the text must contain vertically
stretchable space).
</para>
</section>
<node name="_005craisebox" spaces=" "><nodename>\raisebox</nodename><nodenext automatic="on">\sbox &amp; \savebox</nodenext><nodeprev automatic="on">\parbox</nodeprev><nodeup automatic="on">Boxes</nodeup></node>
<section spaces=" "><sectiontitle><code>\raisebox</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="962" mergedindex="cp">\raisebox</indexterm></findex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\raisebox&lbrace;<var>distance</var>&rbrace;&lbrace;<var>text</var>&rbrace;
\raisebox&lbrace;<var>distance</var>&rbrace;[<var>height</var>]&lbrace;<var>text</var>&rbrace;
\raisebox&lbrace;<var>distance</var>&rbrace;[<var>height</var>][<var>depth</var>]&lbrace;<var>text</var>&rbrace;
</pre></example>

<para>Raise or lower <var>text</var>. This command is fragile (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>This example makes a command for denoting the restriction of a function
by lowering the vertical bar symbol.
</para>
<!-- c credit: egreg https://tex.stackexchange.com/a/278631/121234 -->
<example endspaces=" ">
<pre xml:space="preserve">\newcommand*\restricted[1]&lbrace;\raisebox&lbrace;-.5ex&rbrace;&lbrace;$|$&rbrace;_&lbrace;#1&rbrace;&rbrace;
$f\restricted&lbrace;A&rbrace;$
</pre></example>

<para>The first mandatory argument <var>distance</var> specifies how far to raise
the second mandatory argument <var>text</var>. This is a rigid length
(<pxref label="Lengths"><xrefnodename>Lengths</xrefnodename></pxref>).  If it is negative then it lowers <var>text</var>.  The
<var>text</var> is processed in LR mode so it cannot contain line breaks
(<pxref label="Modes"><xrefnodename>Modes</xrefnodename></pxref>).
</para>
<para>The optional arguments <var>height</var> and <var>depth</var> are dimensions.  If
they are specified, they override the natural height and depth of the
box &latex; gets by typesetting <var>text</var>.
</para>
<anchor name="raisebox-depth">raisebox depth</anchor>
<anchor name="raisebox-height">raisebox height</anchor>
<anchor name="raisebox-width">raisebox width</anchor>
<anchor name="raisebox-totalheight">raisebox totalheight</anchor>
<para>In the arguments <var>distance</var>, <var>height</var>, and <var>depth</var> you can
use the following lengths that refer to the dimension of the box that
&latex; gets on typesetting <var>text</var>: <code>\depth</code>, <code>\height</code>,
<code>\width</code>, <code>\totalheight</code> (this is the box&textrsquo;s height plus its
depth).
</para>
<para>This will align two graphics on their top (<pxref label="Graphics"><xrefnodename>Graphics</xrefnodename></pxref>).
</para>
<!-- c credit: FAQ https://texfaq.org/FAQ-topgraph -->
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;graphicx,calc&rbrace;  % in preamble
   ...
\begin&lbrace;center&rbrace;
  \raisebox&lbrace;1ex-\height&rbrace;&lbrace;%
    \includegraphics[width=0.4\linewidth]&lbrace;lion.png&rbrace;&rbrace;
  \qquad
  \raisebox&lbrace;1ex-\height&rbrace;&lbrace;%
    \includegraphics[width=0.4\linewidth]&lbrace;meta.png&rbrace;&rbrace;
\end&lbrace;center&rbrace;
</pre></example>

<noindent></noindent>
<para>The first <code>\height</code> is the height of <file>lion.png</file> while the
second is the height of <file>meta.png</file>.
</para>

</section>
<node name="_005csbox-_0026-_005csavebox" spaces=" "><nodename>\sbox &amp; \savebox</nodename><nodenext automatic="on">lrbox</nodenext><nodeprev automatic="on">\raisebox</nodeprev><nodeup automatic="on">Boxes</nodeup></node>
<section spaces=" "><sectiontitle><code>\sbox</code> &amp; <code>\savebox</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="963" mergedindex="cp">\sbox</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="964" mergedindex="cp">\savebox</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="788">box, save</indexterm></cindex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\sbox&lbrace;<var>box-cmd</var>&rbrace;&lbrace;<var>text</var>&rbrace;
\savebox&lbrace;<var>box-cmd</var>&rbrace;&lbrace;<var>text</var>&rbrace;
\savebox&lbrace;<var>box-cmd</var>&rbrace;[<var>width</var>]&lbrace;<var>text</var>&rbrace;
\savebox&lbrace;<var>box-cmd</var>&rbrace;[<var>width</var>][<var>pos</var>]&lbrace;<var>text</var>&rbrace;
</pre></example>

<para>Typeset <var>text</var> just as with <code>\makebox</code> (<pxref label="_005cmbox-_0026-_005cmakebox"><xrefnodename>\mbox &amp;
\makebox</xrefnodename></pxref>) except that &latex; does not output it but instead saves it
in a box register referred to by a variable named <var>box-cmd</var>.  The
variable name <var>box-cmd</var> begins with a backslash, <code>\</code>.  You must
have previously allocated the box register <var>box-cmd</var> with <code>\newsavebox</code>
(<pxref label="_005cnewsavebox"><xrefnodename>\newsavebox</xrefnodename></pxref>). The <code>\sbox</code> command is robust while
<code>\savebox</code> is fragile (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>This creates and uses a box register.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newsavebox&lbrace;\fullname&rbrace;
\sbox&lbrace;\fullname&rbrace;&lbrace;John Jacob Jingleheimer Schmidt&rbrace;
  ...
\usebox&lbrace;\fullname&rbrace;! His name is my name, too!
Whenever we go out, the people always shout!
There goes \usebox&lbrace;\fullname&rbrace;!  Ya da da da da da da.
</pre></example>

<noindent></noindent>
<para>One advantage of using and reusing a box register over a
<code>\newcommand</code> macro variable is efficiency, that &latex; need not
repeatedly retypeset the contents.  See the example below.
</para>
<para>The first two command invocations,
<code>\sbox&lbrace;<var>box-cmd</var>&rbrace;&lbrace;<var>text</var>&rbrace;</code> and
<code>\savebox&lbrace;<var>box-cmd</var>&rbrace;&lbrace;<var>text</var>&rbrace;</code>, are roughly equivalent.
As to the third and fourth, the optional arguments allow you to specify
the box width as <var>width</var>, and the position of the text inside that
box as <var>position</var>.  <xref label="_005cmbox-_0026-_005cmakebox"><xrefnodename>\mbox &amp; \makebox</xrefnodename></xref>, for the full
description.
</para>
<para>In the <code>\sbox</code> and <code>\savebox</code> commands the <var>text</var> is
typeset in LR mode so it does not have line breaks (<pxref label="Modes"><xrefnodename>Modes</xrefnodename></pxref>).  If
you use these then &latex; doesn&textrsquo;t give you an error but it ignores
what you want: if you enter <code>\sbox&lbrace;\newreg&rbrace;&lbrace;test \\ test&rbrace;</code> and
<code>\usebox&lbrace;\newreg&rbrace;</code> then you get <samp>testtest</samp>, while if you
enter <code>\sbox&lbrace;\newreg&rbrace;&lbrace;test \par test&rbrace;</code> and
<code>\usebox&lbrace;\newreg&rbrace;</code> then you get <samp>test test</samp>, but no error or
warning.  To fix this use a <code>\parbox</code> or <code>minipage</code> as here.
</para>
<!-- c credit: egreg https://tex.stackexchange.com/a/41668/121234 -->
<example endspaces=" ">
<pre xml:space="preserve">\newsavebox&lbrace;\areg&rbrace;
\savebox&lbrace;\areg&rbrace;&lbrace;%
  \begin&lbrace;minipage&rbrace;&lbrace;\linewidth&rbrace;
    \begin&lbrace;enumerate&rbrace;
      \item First item
      \item Second item
    \end&lbrace;enumerate&rbrace;
  \end&lbrace;minipage&rbrace;&rbrace;
  ...
\usebox&lbrace;\areg&rbrace;
</pre></example>

<para>As an example of the efficiency of reusing a register&textrsquo;s contents, this puts
the same picture on each page of the document by putting it in the
header.  &latex; only typesets it once.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;graphicx&rbrace;  % all this in the preamble
\newsavebox&lbrace;\sealreg&rbrace;
\savebox&lbrace;\sealreg&rbrace;&lbrace;%
  \setlength&lbrace;\unitlength&rbrace;&lbrace;1in&rbrace;%
  \begin&lbrace;picture&rbrace;(0,0)%
     \put(1.5,-2.5)&lbrace;%
       \begin&lbrace;tabular&rbrace;&lbrace;c&rbrace;
          \includegraphics[height=2in]&lbrace;companylogo.png&rbrace; \\
          Office of the President
       \end&lbrace;tabular&rbrace;&rbrace;
  \end&lbrace;picture&rbrace;%
&rbrace;
\markright&lbrace;\usebox&lbrace;\sealreg&rbrace;&rbrace;
\pagestyle&lbrace;headings&rbrace;
</pre></example>

<noindent></noindent>
<para>The <code>picture</code> environment is good for fine-tuning the placement.
</para>
<para>If the register <code>\noreg</code> has not already been defined then you get something like
<samp>Undefined control sequence. &lt;argument&gt; \noreg</samp>.
</para>

</section>
<node name="lrbox" spaces=" "><nodename>lrbox</nodename><nodenext automatic="on">\usebox</nodenext><nodeprev automatic="on">\sbox &amp; \savebox</nodeprev><nodeup automatic="on">Boxes</nodeup></node>
<section spaces=" "><sectiontitle><code>lrbox</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="965" mergedindex="cp">lrbox</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;lrbox&rbrace;&lbrace;<var>box-cmd</var>&rbrace; 
  <var>text</var>
\end&lbrace;lrbox&rbrace;
</pre></example>

<para>This is the environment form of the <code>\sbox</code> and <code>\savebox</code>
commands, and is equivalent to them.  <xref label="_005csbox-_0026-_005csavebox"><xrefnodename>\sbox &amp; \savebox</xrefnodename></xref>, for the
full description.
</para>
<para>The <var>text</var> inside the environment is saved in the box register
referred to by variable <code><var>box-cmd</var></code>.  The variable name
<var>box-cmd</var> must begin with a backslash, <code>\</code>. You must allocate
this box register in advance with <code>\newsavebox</code>
(<pxref label="_005cnewsavebox"><xrefnodename>\newsavebox</xrefnodename></pxref>).  In this example the environment is convenient
for entering the <code>tabular</code>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newsavebox&lbrace;\jhreg&rbrace;
\begin&lbrace;lrbox&rbrace;&lbrace;\jhreg&rbrace;
  \begin&lbrace;tabular&rbrace;&lbrace;c&rbrace;
    \includegraphics[height=1in]&lbrace;jh.png&rbrace; \\
    Jim Hef&lbrace;&rbrace;feron
  \end&lbrace;tabular&rbrace;
\end&lbrace;lrbox&rbrace;    
  ...
\usebox&lbrace;\jhreg&rbrace;
</pre></example>


</section>
<node name="_005cusebox" spaces=" "><nodename>\usebox</nodename><nodeprev automatic="on">lrbox</nodeprev><nodeup automatic="on">Boxes</nodeup></node>
<section spaces=" "><sectiontitle><code>\usebox</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="966" mergedindex="cp">\usebox</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="789">box, use saved box</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usebox&lbrace;<var>box-cmd</var>&rbrace;
</pre></example>

<para>Produce the box most recently saved in the box register <var>box-cmd</var> by
the commands <code>\sbox</code> or <code>\savebox</code>, or the <code>lrbox</code>
environment.  For more information and examples, <pxref label="_005csbox-_0026-_005csavebox"><xrefnodename>\sbox &amp;
\savebox</xrefnodename></pxref>.  (Note that the variable name <var>box-cmd</var> starts with a
backslash, <code>\</code>.)  This command is robust (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>

</section>
</chapter>
<node name="Color" spaces=" "><nodename>Color</nodename><nodenext automatic="on">Graphics</nodenext><nodeprev automatic="on">Boxes</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Color</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="790">color</indexterm></cindex>

<para>You can add color to text, rules, etc.  You can also have color in a box
or on an entire page and write text on top of it.
</para>
<para>Color support comes as an additional package.  So put
<code>\usepackage&lbrace;color&rbrace;</code> in your document preamble to use the
commands described here.
</para>
<para>Many other packages also supplement &latex;&textrsquo;s color abilities.
Particularly worth mentioning is <file>xcolor</file>, which is widely used and
significantly extends the capabilities described here, including adding
<samp>HTML</samp> and <samp>Hsb</samp> color models.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::       ">Color package options</menunode><menudescription><pre xml:space="preserve">Options when you load the standard package.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                ">Color models</menunode><menudescription><pre xml:space="preserve">How colors are represented.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::          ">Commands for color</menunode><menudescription><pre xml:space="preserve">The available commands.
</pre></menudescription></menuentry></menu>


<node name="Color-package-options" spaces=" "><nodename>Color package options</nodename><nodenext automatic="on">Color models</nodenext><nodeup automatic="on">Color</nodeup></node>
<section spaces=" "><sectiontitle><code>color</code> package options</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="791">color package options</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="792">options, color package</indexterm></cindex>

<para>Synopsis (must be in the document preamble):
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage[<var>comma-separated option list</var>]&lbrace;color&rbrace;
</pre></example>

<para>When you load the <file>color</file> package there are two kinds of available
options.
</para>
<para>The first specifies the <dfn>printer driver</dfn>.  &latex; doesn&textrsquo;t contain
information about different output systems but instead depends on
information stored in a file.  Normally you should not specify the
driver option in the document, and instead rely on your system&textrsquo;s
default. One advantage of this is that it makes the document portable
across systems.  For completeness we include a list of the drivers.  The
currently relevant ones are: <file>dvipdfmx</file>, <file>dvips</file>,
<file>dvisvgm</file>, <file>luatex</file>, <file>pdftex</file>, <file>xetex</file>.  The two
<file>xdvi</file> and <file>oztex</file> are essentially aliases for <file>dvips</file>
(and <file>xdvi</file> is monochrome).  Ones that should not be used for new
systems are: <file>dvipdf</file>, <file>dvipdfm</file>, <file>dviwin</file>,
<file>dvipsone</file>, <file>emtex</file>, <file>pctexps</file>, <file>pctexwin</file>,
<file>pctexhp</file>, <file>pctex32</file>, <file>truetex</file>, <file>tcidvi</file>,
<file>vtex</file> (and <file>dviwindo</file> is an alias for <file>dvipsone</file>).
</para>
<para>The second kind of options, beyond the drivers, are below.
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<beforefirstitem>
</beforefirstitem><tableentry><tableterm><item spaces=" "><itemformat command="code">monochrome</itemformat></item>
</tableterm><tableitem><para>Disable the color commands, so that they do not generate errors but do
not generate color either.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">dvipsnames</itemformat></item>
</tableterm><tableitem><para>Make available a list of 68 color names that are often used,
particularly in legacy documents.  These color names were originally
provided by the <file>dvips</file> driver, giving the option name.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">nodvipsnames</itemformat></item>
</tableterm><tableitem><para>Do not load that list of color names, saving &latex; a tiny amount of
memory space.
</para>
</tableitem></tableentry></table>


</section>
<node name="Color-models" spaces=" "><nodename>Color models</nodename><nodenext automatic="on">Commands for color</nodenext><nodeprev automatic="on">Color package options</nodeprev><nodeup automatic="on">Color</nodeup></node>
<section spaces=" "><sectiontitle>Color models</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="793">color models</indexterm></cindex>

<para>A <dfn>color model</dfn> is a way of representing colors.  &latex;&textrsquo;s
capabilities depend on the printer driver.  However, the <file>pdftex</file>,
<file>xetex</file>, and <file>luatex</file> printer drivers are today by far the
most commonly used.  The models below work for those drivers.  All but
one of these is also supported by essentially all other printer drivers
used today.
</para>
<para>Note that color combination can be additive or subtractive.  Additive
mixes colors of light, so that for instance combining full intensities
of red, green, and blue produces white.  Subtractive mixes pigments,
such as with inks, so that combining full intensity of cyan, magenta,
and yellow makes black.
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<beforefirstitem><anchor name="color-models-cmyk">color models cmyk</anchor>
</beforefirstitem><tableentry><tableterm><item spaces=" "><itemformat command="code">cmyk</itemformat></item>
</tableterm><tableitem><para>A comma-separated list with four real numbers between 0 and 1,
inclusive.  The first number is the intensity of cyan, the second is
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.
</para>
<anchor name="color-models-gray">color models gray</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">gray</itemformat></item>
</tableterm><tableitem><para>A single real number between 0 and 1, inclusive.  The colors are shades
of grey.  The number 0 produces black while 1 gives white.
</para>
<anchor name="color-models-rgb">color models rgb</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">rgb</itemformat></item>
</tableterm><tableitem><para>A comma-separated list with three real numbers between 0 and 1,
inclusive.  The first number is the intensity of the red component, the
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.
</para>
<anchor name="color-models-RGB">color models RGB</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">RGB</itemformat></item>
</tableterm><tableitem><para>(<file>pdftex</file>, <file>xetex</file>, <file>luatex</file> drivers) A comma-separated
list with three integers between 0 and 255, inclusive.  This model is a
convenience for using <code>rgb</code> since outside of &latex; colors are
often described in a red-green-blue model using numbers in this range.
The values entered here are converted to the <code>rgb</code> model by
dividing by 255.
</para>
<anchor name="color-models-named">color models named</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">named</itemformat></item>
</tableterm><tableitem><para>Colors are accessed by name, such as <samp>PrussianBlue</samp>.  The list of
names depends on the driver, but all support the names <samp>black</samp>,
<samp>blue</samp>, <samp>cyan</samp>, <samp>green</samp>, <samp>magenta</samp>, <samp>red</samp>,
<samp>white</samp>, and <samp>yellow</samp> (See the <code>dvipsnames</code> option in
<ref label="Color-package-options"><xrefnodename>Color package options</xrefnodename></ref>).
</para>
</tableitem></tableentry></table>


</section>
<node name="Commands-for-color" spaces=" "><nodename>Commands for color</nodename><nodeprev automatic="on">Color models</nodeprev><nodeup automatic="on">Color</nodeup></node>
<section spaces=" "><sectiontitle>Commands for color</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="794">color package commands</indexterm></cindex>

<para>These are the commands available with the <file>color</file> package.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::            ">Define colors</menunode><menudescription><pre xml:space="preserve">Give a color a name.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::             ">Colored text</menunode><menudescription><pre xml:space="preserve">Text or rules in color.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::            ">Colored boxes</menunode><menudescription><pre xml:space="preserve">A box of color, to write over.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::            ">Colored pages</menunode><menudescription><pre xml:space="preserve">A whole page colored.
</pre></menudescription></menuentry></menu>


<node name="Define-colors" spaces=" "><nodename>Define colors</nodename><nodenext automatic="on">Colored text</nodenext><nodeup automatic="on">Commands for color</nodeup></node>
<subsection spaces=" "><sectiontitle>Define colors</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="795">color</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="796">define color</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="797">color, define</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\definecolor&lbrace;<var>name</var>&rbrace;&lbrace;<var>model</var>&rbrace;&lbrace;<var>specification</var>&rbrace;
</pre></example>

<para>Give the name <var>name</var> to the color.  For example, after this
</para>
<example endspaces=" ">
<pre xml:space="preserve">\definecolor&lbrace;silver&rbrace;&lbrace;rgb&rbrace;&lbrace;0.75,0.75,0.74&rbrace;
</pre></example>

<noindent></noindent>
<para>you can use that color name with <code>Hi ho,
\textcolor&lbrace;silver&rbrace;&lbrace;Silver&rbrace;!</code>.
</para>
<para>This example gives the color a more abstract name, so it could change and
not be misleading.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\definecolor&lbrace;logocolor&rbrace;&lbrace;RGB&rbrace;&lbrace;145,92,131&rbrace;    % RGB needs pdflatex
\newcommand&lbrace;\logo&rbrace;&lbrace;\textcolor&lbrace;logocolor&rbrace;&lbrace;Bob's Big Bagels&rbrace;&rbrace;
</pre></example>

<para>Often a document&textrsquo;s colors are defined in the preamble, or in the class
or style, rather than in the document body.
</para>

</subsection>
<node name="Colored-text" spaces=" "><nodename>Colored text</nodename><nodenext automatic="on">Colored boxes</nodenext><nodeprev automatic="on">Define colors</nodeprev><nodeup automatic="on">Commands for color</nodeup></node>
<subsection spaces=" "><sectiontitle>Colored text</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="798">color</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="799">colored text</indexterm></cindex>

<para>Synopses:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\textcolor&lbrace;<var>name</var>&rbrace;&lbrace;...&rbrace;
\textcolor[<var>color model</var>]&lbrace;<var>color specification</var>&rbrace;&lbrace;...&rbrace;
</pre></example>

<noindent></noindent>
<para>or
</para>
<example endspaces=" ">
<pre xml:space="preserve">\color&lbrace;<var>name</var>&rbrace;
\color[<var>color model</var>]&lbrace;<var>specification</var>&rbrace;
</pre></example>

<para>The affected text gets the color.  This line
</para>
<example endspaces=" ">
<pre xml:space="preserve">\textcolor&lbrace;magenta&rbrace;&lbrace;My name is Ozymandias, king of kings:&rbrace;
Look on my works, ye Mighty, and despair!
</pre></example>

<noindent></noindent>
<para>causes the first half to be in magenta while the rest is in black.  You
can use a color declared with <code>\definecolor</code> in exactly the same
way that we just used the builtin color <samp>magenta</samp>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\definecolor&lbrace;MidlifeCrisisRed&rbrace;&lbrace;rgb&rbrace;&lbrace;1.0,0.11,0.0&rbrace;
I'm thinking about getting a \textcolor&lbrace;MidlifeCrisisRed&rbrace;&lbrace;sports car&rbrace;.
</pre></example>

<para>The two <code>\textcolor</code> and <code>\color</code> differ in that the first is
a command form, enclosing the text to be colored as an argument.  Often
this form is more convenient, or at least more explicit.  The second
form is a declaration, as in <code>The moon is made of &lbrace;\color&lbrace;green&rbrace;
green&rbrace; cheese</code>, so it is in effect until the end of the current group
or environment.  This is sometimes useful when writing macros or as
below where it colors everything inside the <code>center</code> environment,
including the vertical and horizontal lines.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;center&rbrace; \color&lbrace;blue&rbrace;
  \begin&lbrace;tabular&rbrace;&lbrace;l|r&rbrace;
    UL &amp;UR \\ \hline
    LL &amp;LR 
  \end&lbrace;tabular&rbrace;
\end&lbrace;center&rbrace;
</pre></example>

<para>You can use color in equations.  A document might have this definition
in the preamble
</para>
<example endspaces=" ">
<pre xml:space="preserve">\definecolor&lbrace;highlightcolor&rbrace;&lbrace;RGB&rbrace;&lbrace;225,15,0&rbrace;
</pre></example>

<noindent></noindent>
<para>and then contain this equation.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;equation&rbrace;
  \int_a^b \textcolor&lbrace;highlightcolor&rbrace;&lbrace;f'(x)&rbrace;\,dx=f(b)-f(a)
\end&lbrace;equation&rbrace;
</pre></example>

<para>Typically the colors used in a document are declared in a class or style
but sometimes you want a one-off.  Those are the second forms in the
synopses.
</para>
<example endspaces=" ">
<pre xml:space="preserve">Colors of \textcolor[rgb]&lbrace;0.33,0.14,0.47&rbrace;&lbrace;Purple&rbrace; and
&lbrace;\color[rgb]&lbrace;0.72,0.60,0.37&rbrace;Gold&rbrace; for the team.
</pre></example>

<para>The format of <var>color specification</var> depends on the color model
(<pxref label="Color-models"><xrefnodename>Color models</xrefnodename></pxref>).  For instance, while <code>rgb</code> takes three
numbers, <code>gray</code> takes only one.
</para>
<example endspaces=" ">
<pre xml:space="preserve">The selection was \textcolor[gray]&lbrace;0.5&rbrace;&lbrace;grayed out&rbrace;.
</pre></example>

<para>Colors inside colors do not combine.  Thus
</para>
<example endspaces=" ">
<pre xml:space="preserve">\textcolor&lbrace;green&rbrace;&lbrace;kind of \textcolor&lbrace;blue&rbrace;&lbrace;blue&rbrace;&rbrace;
</pre></example>

<noindent></noindent>
<para>has a final word that is blue, not a combination of blue and green.
</para>
<!-- c xx address coloring a line of a table? -->


</subsection>
<node name="Colored-boxes" spaces=" "><nodename>Colored boxes</nodename><nodenext automatic="on">Colored pages</nodenext><nodeprev automatic="on">Colored text</nodeprev><nodeup automatic="on">Commands for color</nodeup></node>
<subsection spaces=" "><sectiontitle>Colored boxes</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="800">color</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="801">colored boxes</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="802">box, colored</indexterm></cindex>

<para>Synopses:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\colorbox&lbrace;<var>name</var>&rbrace;&lbrace;...&rbrace;
\colorbox[<var>model name</var>]&lbrace;<var>box background color</var>&rbrace;&lbrace;...&rbrace;
</pre></example>

<noindent></noindent>
<para>or
</para>
<example endspaces=" ">
<pre xml:space="preserve">\fcolorbox&lbrace;<var>frame color</var>&rbrace;&lbrace;<var>box background color</var>&rbrace;&lbrace;...&rbrace;
\fcolorbox[<var>model name</var>]&lbrace;<var>frame color</var>&rbrace;&lbrace;<var>box background color</var>&rbrace;&lbrace;...&rbrace;
</pre></example>

<para>Make a box with the stated background color.  The <code>\fcolorbox</code>
command puts a frame around the box.  For instance this
</para>
<example endspaces=" ">
<pre xml:space="preserve">Name:~\colorbox&lbrace;cyan&rbrace;&lbrace;\makebox[5cm][l]&lbrace;\strut&rbrace;&rbrace;
</pre></example>

<noindent></noindent>
<para>makes a cyan-colored box that is five centimeters long and gets its
depth and height from the <code>\strut</code> (so the depth is
<code>-.3\baselineskip</code> and the height is <code>\baselineskip</code>).  This
puts white text on a blue background.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\colorbox&lbrace;blue&rbrace;&lbrace;\textcolor&lbrace;white&rbrace;&lbrace;Welcome to the machine.&rbrace;&rbrace;
</pre></example>

<para>The <code>\fcolorbox</code> commands use the same parameters as <code>\fbox</code>
(<pxref label="_005cfbox-_0026-_005cframebox"><xrefnodename>\fbox &amp; \framebox</xrefnodename></pxref>), <code>\fboxrule</code> and <code>\fboxsep</code>, to
set the thickness of the rule and the boundary between the box interior
and the surrounding rule.  &latex;&textrsquo;s defaults are <code>0.4pt</code> and
<code>3pt</code>, respectively.
</para>
<para>This example changes the thickness of the border to 0.8 points.  Note
that it is surrounded by curly braces so that the change ends at the end
of the second line.
</para>
<example endspaces=" ">
<pre xml:space="preserve">&lbrace;\setlength&lbrace;\fboxrule&rbrace;&lbrace;0.8pt&rbrace;
\fcolorbox&lbrace;black&rbrace;&lbrace;red&rbrace;&lbrace;Under no circumstances turn this knob.&rbrace;&rbrace;
</pre></example>


</subsection>
<node name="Colored-pages" spaces=" "><nodename>Colored pages</nodename><nodeprev automatic="on">Colored boxes</nodeprev><nodeup automatic="on">Commands for color</nodeup></node>
<subsection spaces=" "><sectiontitle>Colored pages</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="803">color</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="804">colored page</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="805">page, colored</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="806">background, colored</indexterm></cindex>

<para>Synopses:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\pagecolor&lbrace;<var>name</var>&rbrace;
\pagecolor[<var>color model</var>]&lbrace;<var>color specification</var>&rbrace;
\nopagecolor
</pre></example>

<para>The first two set the background of the page, and all subsequent pages,
to the color.  For an explanation of the specification in the second
form <pxref label="Colored-text"><xrefnodename>Colored text</xrefnodename></pxref>.  The third returns the background to normal,
which is a transparent background.  (If that is not supported use
<code>\pagecolor&lbrace;white&rbrace;</code>, although that will make a white background
rather than the default transparent background.)
</para>
<example endspaces=" ">
<pre xml:space="preserve"> ...
\pagecolor&lbrace;cyan&rbrace;
 ...
\nopagecolor
</pre></example>


</subsection>
</section>
</chapter>
<node name="Graphics" spaces=" "><nodename>Graphics</nodename><nodenext automatic="on">Special insertions</nodenext><nodeprev automatic="on">Color</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Graphics</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="807">graphics</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="808">graphics package</indexterm></cindex>

<para>You can use graphics such as PNG or PDF files in your &latex; document.
You need an additional package, which comes standard with &latex;.
This example is the short how-to.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\include&lbrace;graphicx&rbrace;  % goes in the preamble
  ...
\includegraphics[width=0.5\linewidth]&lbrace;plot.pdf&rbrace;
</pre></example>

<para>To use the commands described here your document preamble must contain
either <code>\usepackage&lbrace;graphicx&rbrace;</code> or
<code>\usepackage&lbrace;graphics&rbrace;</code>. Most of the time, <code>graphicx</code> is the
better choice.
</para>
<para>Graphics come in two main types, raster and vector.  &latex; can use
both.  In raster graphics the file contains an entry for each location
in an array, describing what color it is.  An example is a photograph
in JPG format.  In vector graphics, the file contains a list of
instructions such as <samp>draw a circle with this radius and that
center</samp>.  An example is a line drawing produced by the Asymptote
program, in PDF format.  Generally vector graphics are more useful
because you can rescale their size without pixelation or other problems,
and because they often have a smaller size.
</para>
<para>There are systems particularly well-suited to make graphics for a
&latex; document.  For example, these allow you to use the same fonts
as in your document.  &latex; comes with a <code>picture</code> environment
(<pxref label="picture"><xrefnodename>picture</xrefnodename></pxref>) that has simple capabilities.  Besides that, there are
other ways to include the graphic-making commands in the document.  Two
such systems are the PSTricks and TikZ packages.  There are also systems
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 on CTAN.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::         ">Graphics package options</menunode><menudescription><pre xml:space="preserve">Options when you load the package.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::   ">Graphics package configuration</menunode><menudescription><pre xml:space="preserve">Where to look for files, which file types.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::            ">Commands for graphics</menunode><menudescription><pre xml:space="preserve">The available commands.
</pre></menudescription></menuentry></menu>


<node name="Graphics-package-options" spaces=" "><nodename>Graphics package options</nodename><nodenext automatic="on">Graphics package configuration</nodenext><nodeup automatic="on">Graphics</nodeup></node>
<section spaces=" "><sectiontitle><code>graphics</code> package options</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="809">graphics package options</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="810">options, graphics package</indexterm></cindex>

<para>Synopsis (must be in the document preamble):
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage[<var>comma-separated option list</var>]&lbrace;graphics&rbrace;
</pre></example>

<noindent></noindent>
<para>or
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage[<var>comma-separated option list</var>]&lbrace;graphicx&rbrace;
</pre></example>

<para>The <code>graphicx</code> package has a format for optional arguments to the
<code>\includegraphics</code> command that is convenient (it is the key-value
format), so it is the better choice for new documents.  When you load
the <code>graphics</code> or <code>graphicx</code> package with <code>\usepackage</code>
there are two kinds of available options.
</para>
<para>The first is that &latex; does not contain information about different
output systems but instead depends on information stored in a
<dfn>printer driver</dfn> file.  Normally you should not specify the driver
option in the document, and instead rely on your system&textrsquo;s default. One
advantage of this is that it makes the document portable across systems.
</para>
<para>For completeness here is a list of the drivers.  The currently relevant
ones are: <file>dvipdfmx</file>, <file>dvips</file>, <file>dvisvgm</file>, <file>luatex</file>,
<file>pdftex</file>, <file>xetex</file>.  The two <file>xdvi</file> and <file>oztex</file> are
essentially aliases for <file>dvips</file> (and <file>xdvi</file> is monochrome).
Ones that should not be used for new systems are: <file>dvipdf</file>,
<file>dvipdfm</file>, <file>dviwin</file>, <file>dvipsone</file>, <file>emtex</file>,
<file>pctexps</file>, <file>pctexwin</file>, <file>pctexhp</file>, <file>pctex32</file>,
<file>truetex</file>, <file>tcidvi</file>, <file>vtex</file> (and <file>dviwindo</file> is an
alias for <file>dvipsone</file>).  These are stored in files with a
<file>.def</file> extension, such as <file>pdftex.def</file>.
</para>
<para>The second kind of options are below.
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">demo</itemformat></item>
</tableterm><tableitem><para>Instead of an image file, &latex; puts in a 150&nbsp;pt by 100&nbsp;pt
rectangle (unless another size is specified in the
<code>\includegraphics</code> command).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">draft</itemformat></item>
</tableterm><tableitem><para>For each graphic file, it is not shown but instead its file name is
printed in a box of the correct size.  In order to determine the size,
the file must be present.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">final</itemformat></item>
</tableterm><tableitem><para>(Default) Override any previous <code>draft</code> option, so that the
document shows the contents of the graphic files.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">hiderotate</itemformat></item>
</tableterm><tableitem><para>Do not show rotated text.  (This allows for the possibility that a
previewer does not have the capability to rotate text.)
<!-- c what does it show? -->
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">hidescale</itemformat></item>
</tableterm><tableitem><para>Do not show scaled text.  (This allows for the possibility that a
previewer does not have the capability to scale.)
<!-- c what does it show? -->
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">hiresbb</itemformat></item>
</tableterm><tableitem><para>In a PS or EPS file the graphic size may be specified in two ways.  The
<code>%%BoundingBox</code> lines describe the graphic size using integer
multiples of a PostScript point, that is, integer multiples of 1/72
inch.  A later addition to the PostScript language allows decimal
multiples, such as 1.23, in <code>%%HiResBoundingBox</code> lines.  This
option has &latex; to read the size from the latter.
</para>
</tableitem></tableentry></table>


</section>
<node name="Graphics-package-configuration" spaces=" "><nodename>Graphics package configuration</nodename><nodenext automatic="on">Commands for graphics</nodenext><nodeprev automatic="on">Graphics package options</nodeprev><nodeup automatic="on">Graphics</nodeup></node>
<section spaces="  "><sectiontitle><code>graphics</code> package configuration</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="811">graphics</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="812">graphics package</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="813">configuration, graphics package</indexterm></cindex>

<para>These commands configure the way &latex; searches the file system for
the graphic.
</para>
<para>The behavior of file system search code is necessarily platform
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</file>, or the &latex; source, or your
&tex; distribution&textrsquo;s documentation.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::                ">\graphicspath</menunode><menudescription><pre xml:space="preserve">Directories to search.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::   ">\DeclareGraphicsExtensions</menunode><menudescription><pre xml:space="preserve">File types, such as JPG or EPS.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::         ">\DeclareGraphicsRule</menunode><menudescription><pre xml:space="preserve">How to handle file types.
</pre></menudescription></menuentry></menu>


<node name="_005cgraphicspath" spaces=" "><nodename>\graphicspath</nodename><nodenext automatic="on">\DeclareGraphicsExtensions</nodenext><nodeup automatic="on">Graphics package configuration</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\graphicspath</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="967" mergedindex="cp">\graphicspath</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\graphicspath&lbrace;<var>list of directories inside curly braces</var>&rbrace;
</pre></example>

<para>Declare a list of directories to search for graphics files.  This allows
you to later say something like <code>\includegraphics&lbrace;lion.png&rbrace;</code>
instead of having to give its path.
</para>
<para>&latex; always looks for graphic files first in the current directory
(and the output directory, if specified; <pxref label="output-directory"><xrefnodename>output directory</xrefnodename></pxref>).
The declaration below tells the system to then look in the
subdirectory <file>pix</file>, and then <file>../pix</file>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;graphicx&rbrace;   % or graphics; put in preamble
  ...
\graphicspath&lbrace; &lbrace;pix/&rbrace; &lbrace;../pix/&rbrace; &rbrace;
</pre></example>

<para>The <code>\graphicspath</code> declaration is optional.  If you don&textrsquo;t include
it then &latex;&textrsquo;s default is to search all of the places that it
usually looks for a file (it uses &latex;&textrsquo;s <code>\input&arobase;path</code>).  In
particular, in this case one of the places it looks is the current
directory.
</para>
<para>Enclose each directory name in curly braces; for example, above it says
<samp><code>&lbrace;pix&rbrace;</code></samp>.  Do this even if there is only one directory.
Each directory name must end in a forward slash, <file>/</file>.  This is true
even on Windows, where good practice is to use forward slashes for all
the directory separators since it makes the document portable to other
platforms.  If you have spaces in your directory name then use double
quotes, as with <code>&lbrace;&quot;my docs/&quot;&rbrace;</code>. Getting one of these rules wrong
will cause &latex; to report <code>Error: File `<var>filename</var>' not
found</code>.
</para>
<para>Basically, the algorithm is that with this example, after looking in the
current directory,
</para>
<example endspaces=" ">
<pre xml:space="preserve">\graphicspath&lbrace; &lbrace;pix/&rbrace; &lbrace;../pix/&rbrace; &rbrace;
...
\usepackage&lbrace;lion.png&rbrace;
</pre></example>

<noindent></noindent>
<para>for each of the listed directories, &latex; concatenates it with the
filename and searches for the result, checking for <file>pix/lion.png</file>
and then <file>../pix/lion.png</file>.  This algorithm means that the
<code>\graphicspath</code> command does not recursively search subdirectories:
if you issue <code>\graphicspath&lbrace;&lbrace;a/&rbrace;&rbrace;</code> and the graphic is in
<file>a/b/lion.png</file> then &latex; will not find it.  It also means that
you can use absolute paths such as
<code>\graphicspath&lbrace;&lbrace;/home/jim/logos/&rbrace;&rbrace;</code> or
<code>\graphicspath&lbrace;&lbrace;C:/Users/Albert/Pictures/&rbrace;&rbrace;</code>.  However, using
these means that the document is not portable.  (You could preserve
portability by adjusting your &tex; system settings configuration file
parameter <code>TEXINPUTS</code>; see the documentation of your system.)
</para>
<para>You can use <code>\graphicspath</code> anywhere in the document.  You can use
it more than once.  Show its value with
<code>\makeatletter\typeout&lbrace;\Ginput&arobase;path&rbrace;\makeatother</code>.
</para>
<para>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</file>
and it contains <code>\include&lbrace;chapters/chap1&rbrace;</code>.  If in
<file>chap1.tex</file> you put <code>\graphicspath&lbrace;&lbrace;plots/&rbrace;&rbrace;</code> then
&latex; will not search for graphics in <file>book/chapters/plots</file>, but
instead in <file>book/plots</file>.
</para>

</subsection>
<node name="_005cDeclareGraphicsExtensions" spaces=" "><nodename>\DeclareGraphicsExtensions</nodename><nodenext automatic="on">\DeclareGraphicsRule</nodenext><nodeprev automatic="on">\graphicspath</nodeprev><nodeup automatic="on">Graphics package configuration</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\DeclareGraphicsExtensions</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="968" mergedindex="cp">\DeclareGraphicsExtensions</indexterm></findex>

<para>Synopses:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareGraphicsExtensions&lbrace;<var>comma-separated list of file extensions</var>&rbrace;
</pre></example>

<para>Declare the filename extensions to try.  This allows you to specify the
order in which to choose graphic formats when you include graphic files
by giving the filename without the extension, as in
<code>\includegraphics&lbrace;functionplot&rbrace;</code>.
</para>
<para>In this example, &latex; will find files in the PNG format before PDF
files.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareGraphicsExtensions&lbrace;.png,PNG,.pdf,.PDF&rbrace;
  ...
\includegraphics&lbrace;lion&rbrace;   % will find <file>lion.png</file> before <file>lion.pdf</file> 
</pre></example>

<noindent></noindent>
<para>Because the filename <file>lion</file> does not have a period, &latex; uses
the extension list.  For each directory in the graphics path
(<pxref label="_005cgraphicspath"><xrefnodename>\graphicspath</xrefnodename></pxref>), &latex; will try the extensions in the order
given.  If it does not find such a file after trying all the directories
and extensions then it reports <samp>! LaTeX Error: File `<file>lion</file>'
not found</samp>.  Note that you must include the periods at the start of the
extensions.
</para>
<para>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.
</para>
<para>You are not required to include <code>\DeclareGraphicsExtensions</code> in
your document; the printer driver has a sensible default.  For example,
the most recent <file>pdftex.def</file> has this extension list.
</para>
<example endspaces=" ">
<pre xml:space="preserve">.pdf,.png,.jpg,.mps,.jpeg,.jbig2,.jb2,.PDF,.PNG,.JPG,.JPEG,.JBIG2,.JB2
</pre></example>

<cindex index="cp" spaces=" "><indexterm index="cp" number="814"><r>package</r>, <code>grfext</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="815"><code>grfext</code> <r>package</r></indexterm></cindex>

<para>To change the order, use the <code>grfext</code> package.
</para>
<para>You can use this command anywhere in the document.  You can use it more
than once.  Show its value with
<code>\makeatletter\typeout&lbrace;\Gin&arobase;extensions&rbrace;\makeatother</code>.
</para>

</subsection>
<node name="_005cDeclareGraphicsRule" spaces=" "><nodename>\DeclareGraphicsRule</nodename><nodeprev automatic="on">\DeclareGraphicsExtensions</nodeprev><nodeup automatic="on">Graphics package configuration</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\DeclareGraphicsRule</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="969" mergedindex="cp">\DeclareGraphicsRule</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareGraphicsRule&lbrace;<var>extension</var>&rbrace;&lbrace;<var>type</var>&rbrace;&lbrace;<var>size-file extension</var>&rbrace;&lbrace;<var>command</var>&rbrace;
</pre></example>

<para>Declare how to handle graphic files whose names end in <var>extension</var>.
</para>
<para>This example declares that all files with names of the form
<file>filename-without-dot.mps</file> will be treated as output from MetaPost,
meaning that the printer driver will use its MetaPost-handling code to
input the file.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareGraphicsRule&lbrace;.mps&rbrace;&lbrace;mps&rbrace;&lbrace;.mps&rbrace;&lbrace;&rbrace;
</pre></example>

<para>This
</para>
<example endspaces=" ">
<pre xml:space="preserve">\DeclareGraphicsRule&lbrace;*&rbrace;&lbrace;mps&rbrace;&lbrace;*&rbrace;&lbrace;&rbrace;
</pre></example>

<noindent></noindent>
<para>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>,
<file>filename.2</file>, etc.
</para>
<para>This describes the four arguments.
</para>
<table commandarg="var" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="var">extension</itemformat></item>
</tableterm><tableitem><para>The file extension to which this rule applies. The extension is anything
after and including the first dot in the filename.  Use the Kleene star,
<code>*</code>, to denote the default behavior for all undeclared extensions.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">type</itemformat></item>
</tableterm><tableitem><para>The type of file involved.  This type is a string that must be defined
in the printer driver. For instance, files with extensions <file>.ps</file>,
<file>.eps</file>, or <file>.ps.gz</file> may all be classed as type <code>eps</code>.
All files of the same type will be input with the same internal command
by the printer driver. For example, the file types that <file>pdftex</file>
recognizes are: <code>jpg</code>, <code>jbig2</code>, <code>mps</code>, <code>pdf</code>,
<code>png</code>, <code>tif</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">size-file extension</itemformat></item>
</tableterm><tableitem><para>The extension of the file to be read to determine the size of the
graphic, if there is such a file. It may be the same as <var>extension</var>
but it may be different.
</para>
<para>As an example, consider a PostScript graphic.  To make it smaller, it
might be compressed into a <file>.ps.gz</file> file.  Compressed files are not
easily read by &latex; so you can put the bounding box information in a
separate file. If <var>size-file extension</var> is empty then you must
specify size information in the arguments of <code>\includegraphics</code>.
</para>
<para>If the driver file has a procedure for reading size files for
<code>type</code> then that will be used, otherwise it will use the procedure
for reading <file>.eps</file> files.  (Thus you may specify the size of bitmap
files in a file with a PostScript style <code>%%BoundingBox</code> line if no
other format is available.)
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">command</itemformat></item>
</tableterm><tableitem><para>A command that will be applied to the
file. This is very often left empty. This command must start with a
single backward quote.  Thus,
<code>\DeclareGraphicsRule&lbrace;.eps.gz&rbrace;&lbrace;eps&rbrace;&lbrace;.eps.bb&rbrace;&lbrace;`gunzip -c
#1&rbrace;</code> specifies that any file with the extension <file>.eps.gz</file> should
be treated as an <code>eps</code> file, with the BoundingBox information
stored in the file with extension <file>.eps.bb</file>, and that the command
<code>gunzip -c</code> will run on your platform to decompresses the file.
</para>
<para>Such a command is specific to your platform.  In addition, your &tex;
system must allow you to run external commands; as a security measure
modern systems restrict running commands unless you explicitly allow it.
See the documentation for your &tex; distribution.
</para>
</tableitem></tableentry></table>

</subsection>
</section>
<node name="Commands-for-graphics" spaces=" "><nodename>Commands for graphics</nodename><nodeprev automatic="on">Graphics package configuration</nodeprev><nodeup automatic="on">Graphics</nodeup></node>
<section spaces=" "><sectiontitle>Commands for graphics</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="816">graphics package commands</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="817">commands, graphics package</indexterm></cindex>

<para>These are the commands available with the <code>graphics</code> and
<code>graphicx</code> packages.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::     ">\includegraphics</menunode><menudescription><pre xml:space="preserve">Using a graphic in your document.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::           ">\rotatebox</menunode><menudescription><pre xml:space="preserve">Rotating boxes, including graphics.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::            ">\scalebox</menunode><menudescription><pre xml:space="preserve">Scaling boxes, including graphics.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::           ">\resizebox</menunode><menudescription><pre xml:space="preserve">Scaling boxes, including graphics, to a set size.
</pre></menudescription></menuentry></menu>


<node name="_005cincludegraphics" spaces=" "><nodename>\includegraphics</nodename><nodenext automatic="on">\rotatebox</nodenext><nodeup automatic="on">Commands for graphics</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\includegraphics</code></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="818">graphics</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="819">graphics package</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="820">including graphics</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="821">importing graphics</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="822">EPS files</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="823">JPEG files</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="824">JPG files</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="825">PDF graphic files</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="826">PNG files</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="970" mergedindex="cp">\includegraphics</indexterm></findex>

<para>Synopses for <code>graphics</code> package:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\includegraphics&lbrace;<var>filename</var>&rbrace;
\includegraphics[<var>urx</var>,<var>ury</var>]&lbrace;<var>filename</var>&rbrace;
\includegraphics[<var>llx</var>,<var>lly</var>][<var>urx</var>,<var>ury</var>]&lbrace;<var>filename</var>&rbrace;
\includegraphics*&lbrace;<var>filename</var>&rbrace;
\includegraphics*[<var>urx</var>,<var>ury</var>]&lbrace;<var>filename</var>&rbrace;
\includegraphics*[<var>llx</var>,<var>lly</var>][<var>urx</var>,<var>ury</var>]&lbrace;<var>filename</var>&rbrace;
</pre></example>

<para>Synopses for <code>graphicx</code> package:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\includegraphics&lbrace;<var>filename</var>&rbrace;
\includegraphics[<var>key-value list</var>]&lbrace;<var>filename</var>&rbrace;
\includegraphics*&lbrace;<var>filename</var>&rbrace;
\includegraphics*[<var>key-value list</var>]&lbrace;<var>filename</var>&rbrace;
</pre></example>

<para>Include a graphics file.  The starred form <code>\includegraphics*</code> will
clip the graphic to the size specified, while for the unstarred form any
part of the graphic that is outside the box of the specified size will
over-print the surrounding area.
</para>
<para>This 
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;graphicx&rbrace;  % in preamble
  ...
\begin&lbrace;center&rbrace;
  \includegraphics&lbrace;plot.pdf&rbrace;
\end&lbrace;center&rbrace;
</pre></example>

<noindent></noindent>
<para>will incorporate into the document the graphic in <file>plot.pdf</file>,
centered and at its nominal size.  You can also give a path to the file,
as with <code>\includegraphics&lbrace;graphics/plot.pdf&rbrace;</code>.  To specify a list
of locations to search for the file, <pxref label="_005cgraphicspath"><xrefnodename>\graphicspath</xrefnodename></pxref>.
</para>
<para>If your filename includes spaces then put it in double quotes. An example
is <code>\includegraphics&lbrace;&quot;sister picture.jpg&quot;&rbrace;</code>.
</para>
<para>The <code>\includegraphics&lbrace;<var>filename</var>&rbrace;</code> command decides on the
type of graphic by splitting <var>filename</var> on the first dot.  You can
instead use <var>filename</var> with no dot, as in
<code>\includegraphics&lbrace;turing&rbrace;</code>, and then &latex; tries a sequence of
extensions such as <code>.png</code> and <code>.pdf</code> until it finds a file
with that extension (<pxref label="_005cDeclareGraphicsExtensions"><xrefnodename>\DeclareGraphicsExtensions</xrefnodename></pxref>).
</para>
<para>If your file name contains dots before the extension then you can hide
them with curly braces, as in
<code>\includegraphics&lbrace;&lbrace;plot.2018.03.12.a&rbrace;.pdf&rbrace;</code>.  Or, if you use
the <code>graphicx</code> package then you can use the options <code>type</code> and
<code>ext</code>; see below.  This and other filename issues are also handled
with the package <file>grffile</file>.
</para>
<para>This example puts a graphic in a <code>figure</code> environment so &latex; can
move it to the next page if fitting it on the current page is awkward
(<pxref label="figure"><xrefnodename>figure</xrefnodename></pxref>).
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;figure&rbrace;
  \centering
  \includegraphics[width=3cm]&lbrace;lungxray.jpg&rbrace;
  \caption&lbrace;The evidence is overwhelming: don't smoke.&rbrace;  \label&lbrace;fig:xray&rbrace;
\end&lbrace;figure&rbrace;
</pre></example>

<para>This places a graphic that will not float, so it is sure to appear at
this point in the document even if makes &latex; stretch the text or
resort to blank areas on the page.  It will be centered and will have a
caption.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;caption&rbrace;  % in preamble
  ...
\begin&lbrace;center&rbrace;
  \includegraphics&lbrace;pix/nix.png&rbrace;
  \captionof&lbrace;figure&rbrace;&lbrace;The spirit of the night&rbrace; \label&lbrace;pix:nix&rbrace; % optional
\end&lbrace;center&rbrace;
</pre></example>

<para>This example puts a box with a graphic side by side with one having
text, with the two vertically centered.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcommand*&lbrace;\vcenteredhbox&rbrace;[1]&lbrace;\begin&lbrace;tabular&rbrace;&lbrace;&arobase;&lbrace;&rbrace;c&arobase;&lbrace;&rbrace;&rbrace;#1\end&lbrace;tabular&rbrace;&rbrace;
  ...
\begin&lbrace;center&rbrace;
  \vcenteredhbox&lbrace;\includegraphics[width=0.4\textwidth]&lbrace;plot&rbrace;&rbrace;
  \hspace&lbrace;1em&rbrace;
  \vcenteredhbox&lbrace;\begin&lbrace;minipage&rbrace;&lbrace;0.4\textwidth&rbrace;
                   \begin&lbrace;displaymath&rbrace;
                     f(x)=x\cdot \sin (1/x)
                   \end&lbrace;displaymath&rbrace;
                 \end&lbrace;minipage&rbrace;&rbrace;
\end&lbrace;center&rbrace;
</pre></example>

<para>If you use the <code>graphics</code> package then the only options involve the
size of the graphic (but see <ref label="_005crotatebox"><xrefnodename>\rotatebox</xrefnodename></ref> and <ref label="_005cscalebox"><xrefnodename>\scalebox</xrefnodename></ref>).
When one optional argument is present then it is
<code>[<var>urx</var>,<var>ury</var>]</code> and it gives the coordinates of the top
right corner of the image, as a pair of &tex; dimensions (<pxref label="Units-of-length"><xrefnodename>Units
of length</xrefnodename></pxref>).  If the units are omitted they default to <code>bp</code>.  In
this case, the lower left corner of the image is assumed to be at (0,0).
If two optional arguments are present then the leading one is
<code>[<var>llx</var>,<var>lly</var>]</code>, specifying the coordinates of the image&textrsquo;s
lower left.  Thus, <code>\includegraphics[1in,0.618in]&lbrace;...&rbrace;</code> calls for
the graphic to be placed so it is 1&nbsp;inch wide and 0.618&nbsp;inches
tall and so its origin is at (0,0).
</para>
<para>The <code>graphicx</code> package gives you many more options.  Specify them
in a key-value form, as here.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;center&rbrace;
  \includegraphics[width=1in,angle=90]&lbrace;lion&rbrace;
  \hspace&lbrace;2em&rbrace;
  \includegraphics[angle=90,width=1in]&lbrace;lion&rbrace;
\end&lbrace;center&rbrace;
</pre></example>

<noindent></noindent>
<para>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
two will end with different widths and heights.
</para>
<para>There are many options.  The primary ones are listed first.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="827">bounding box</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="828">box, bounding</indexterm></cindex>
<para>Note that a graphic is placed by &latex; into a box, which is
traditionally referred to as its <dfn>bounding box</dfn> (distinct from the
PostScript BoundingBox described below).  The graphic&textrsquo;s printed area may
go beyond this box, or sit inside this box, but when &latex; makes up a
page it puts together boxes and this is the box allocated for the
graphic.
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<beforefirstitem><anchor name="includegraphics-width">includegraphics width</anchor>
</beforefirstitem><tableentry><tableterm><item spaces=" "><itemformat command="code">width</itemformat></item>
</tableterm><tableitem><para>The graphic will be shown so its bounding box is this width.  An example
is <code>\includegraphics[width=1in]&lbrace;plot&rbrace;</code>.  You can use the standard
&tex; dimensions (<pxref label="Units-of-length"><xrefnodename>Units of length</xrefnodename></pxref>) and also convenient is
<code>\linewidth</code>, or in a two-column document, <code>\columnwidth</code>
(<pxref label="Page-layout-parameters"><xrefnodename>Page layout parameters</xrefnodename></pxref>).  An example is that by using the
<file>calc</file> package you can make the graphic be 1&nbsp;cm narrower than
the width of the text with
<code>\includegraphics[width=\linewidth-1.0cm]&lbrace;hefferon.jpg&rbrace;</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">height</itemformat></item>
</tableterm><tableitem><anchor name="includegraphics-height">includegraphics height</anchor>
<para>The graphic will be shown so its bounding box is this height.  You can
use the standard &tex; dimensions (<pxref label="Units-of-length"><xrefnodename>Units of length</xrefnodename></pxref>), and also
convenient are <code>\pageheight</code> and <code>\textheight</code> (<pxref label="Page-layout-parameters"><xrefnodename>Page
layout parameters</xrefnodename></pxref>).  For instance, the command
<code>\includegraphics[height=0.25\textheight]&lbrace;godel&rbrace;</code> will make the
graphic a quarter of the height of the text area.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">totalheight</itemformat></item>
</tableterm><tableitem><anchor name="includegraphics-totalheight">includegraphics totalheight</anchor>
<para>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.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">keepaspectratio</itemformat></item>
</tableterm><tableitem><anchor name="includegraphics-keepaspectratio">includegraphics keepaspectratio</anchor>
<para>If set to <code>true</code>, or just specified as here
</para>
<example endspaces=" ">
<pre xml:space="preserve"><code>\includegraphics[...,keepaspectratio,...]&lbrace;...&rbrace;</code>
</pre></example>

<noindent></noindent>
<para>and you give as options both <code>width</code> and <code>height</code> (or
<code>totalheight</code>), 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</code> nor taller than <code>height</code> (or
<code>totalheight</code>).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">scale</itemformat></item>
</tableterm><tableitem><para>Factor by which to scale the graphic.  To make a graphic twice its
nominal size, enter <code>\includegraphics[scale=2.0]&lbrace;...&rbrace;</code>.  This
number may be any value; a number between 0 and&nbsp;1 will shrink the
graphic and a negative number will reflect it.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">angle</itemformat></item>
</tableterm><tableitem><para>Rotate the graphic.  The angle is taken in degrees and counterclockwise.
The graphic is rotated about its <code>origin</code>; see that option.  For a
complete description of how rotated material is typeset,
<pxref label="_005crotatebox"><xrefnodename>\rotatebox</xrefnodename></pxref>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">origin</itemformat></item>
</tableterm><tableitem><para>The point of the graphic about which the rotation happens.  Possible
values are any string containing one or two of: <code>l</code> for left,
<code>r</code> for right, <code>b</code> for bottom, <code>c</code> for center, <code>t</code>
for top, and <code>B</code> for baseline.  Thus, entering the command
<code>\includegraphics[angle=180,origin=c]&lbrace;moon&rbrace;</code> will turn the
picture upside down about that picture&textrsquo;s center, while the command
<code>\includegraphics[angle=180,origin=lB]&lbrace;LeBateau&rbrace;</code> will turn its
picture upside down about its left baseline.  (The character <code>c</code>
gives the horizontal center in <code>bc</code> or <code>tc</code>, but gives the
vertical center in <code>lc</code> or <code>rc</code>.)  The default is <code>lB</code>.
</para>
<para>To rotate about an arbitrary point, <pxref label="_005crotatebox"><xrefnodename>\rotatebox</xrefnodename></pxref>.
</para>
</tableitem></tableentry></table>

<para>These are lesser-used options.
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<beforefirstitem><anchor name="includegraphics-viewport">includegraphics viewport</anchor>
</beforefirstitem><tableentry><tableterm><item spaces=" "><itemformat command="code">viewport</itemformat></item>
</tableterm><tableitem><para>Pick out a subregion of the graphic to show.  Takes four arguments,
separated by spaces and given in &tex; dimensions, as with
<code>\includegraphics[.., viewport=0in 0in 1in 0.618in]&lbrace;...&rbrace;</code>.  When
the unit is omitted, the dimensions default to big
points,&nbsp;<code>bp</code>.  They are taken relative to the origin specified
by the bounding box.  See also the <code>trim</code> option.
</para>
<anchor name="includegraphics-trim">includegraphics trim</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">trim</itemformat></item>
</tableterm><tableitem><para>Gives parts of the graphic to not show.  Takes four arguments, separated
by spaces, that are given in &tex; dimensions, as with
<code>\includegraphics[.., trim= 0in 0.1in 0.2in 0.3in, ...]&lbrace;...&rbrace;</code>.
These give the amounts of the graphic not to show, that is, &latex;
will crop the picture by 0&nbsp;inches on the left, 0.1&nbsp;inches on
the bottom, 0.2&nbsp;inches on the right, and 0.3&nbsp;inches on the
top.  See also the <code>viewport</code> option.
</para>
<anchor name="includegraphics-clip">includegraphics clip</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">clip</itemformat></item>
</tableterm><tableitem><para>If set to <code>true</code>, or just specified as here
</para>
<example endspaces=" ">
<pre xml:space="preserve">\includegraphics[...,clip,...]&lbrace;...&rbrace;
</pre></example>

<noindent></noindent>
<para>then the graphic is cropped to the bounding box.  This is the same as
using the starred form of the command,
<code>\includegraphics*[...]&lbrace;...&rbrace;</code>.
</para>
<anchor name="includegraphics-page">includegraphics page</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">page</itemformat></item>
</tableterm><tableitem><para>Give the page number of a multi-page PDF file.  The default is
<code>page=1</code>.
</para>
<anchor name="includegraphics-pagebox">includegraphics pagebox</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">pagebox</itemformat></item>
</tableterm><tableitem><para>Specifies which bounding box to use for PDF files from among
<code>mediabox</code>, <code>cropbox</code>, <code>bleedbox</code>, <code>trimbox</code>, or
<code>artbox</code>.  PDF files do not have the BoundingBox that PostScript
files have, but may specify up to four predefined rectangles. The
MediaBox gives the boundaries of the physical medium. The CropBox is the
region to which the contents of the page are to be clipped when
displayed.  The BleedBox is the region to which the contents of the page
should be clipped in production. The TrimBox is the intended dimensions
of the finished page.  The ArtBox is the extent of the page&textrsquo;s meaningful
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.
</para>
<anchor name="includegraphics-interpolate">includegraphics interpolate</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">interpolate</itemformat></item>
</tableterm><tableitem><para>Enable or disable interpolation of raster images by the viewer.  Can be
set with <code>interpolate=true</code> or just specified as here.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\includegraphics[...,interpolate,...]&lbrace;...&rbrace;
</pre></example>

<anchor name="includegraphics-quiet">includegraphics quiet</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">quiet</itemformat></item>
</tableterm><tableitem><para>Do not write information to the log.  You can set it with
<code>quiet=true</code> or just specified it with
<code>\includegraphics[...,quiet,...]&lbrace;...&rbrace;</code>,
</para>
<anchor name="includegraphics-draft">includegraphics draft</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">draft</itemformat></item>
</tableterm><tableitem><para>If you set it with <code>draft=true</code> or just specify it with
</para>
<example endspaces=" ">
<pre xml:space="preserve">\includegraphics[...,draft,...]&lbrace;...&rbrace;
</pre></example>

<noindent></noindent>
<para>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.
</para>
</tableitem></tableentry></table>

<para>These options address the bounding box for Encapsulated PostScript
graphic files, which have a size specified with a line
<code>%%BoundingBox</code> that appears in the file.  It has four values,
giving the lower <math>x</math> coordinate, lower <math>y</math> coordinate, upper
<math>x</math> coordinate, and upper <math>y</math> coordinate.  The units are
PostScript points, equivalent to &tex;&textrsquo;s big points, 1/72&nbsp;inch.
For example, if an <file>.eps</file> file has the line <code>%%BoundingBox 10
20 40 80</code> then its natural size is 30/72&nbsp;inch wide by
60/72&nbsp;inch tall.
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<beforefirstitem><anchor name="includegraphics-bb">includegraphics bb</anchor>
</beforefirstitem><tableentry><tableterm><item spaces=" "><itemformat command="code">bb</itemformat></item>
</tableterm><tableitem><para>Specify the bounding box of the displayed region.  The argument is four
dimensions separated by spaces, as with <code>\includegraphics[.., bb=
0in 0in 1in 0.618in]&lbrace;...&rbrace;</code>.  Usually <code>\includegraphics</code> reads the
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.
</para>
<anchor name="includegraphics-bbllx">includegraphics bbllx</anchor>
<anchor name="includegraphics-bblly">includegraphics bblly</anchor>
<anchor name="includegraphics-bburx">includegraphics bburx</anchor>
<anchor name="includegraphics-bbury">includegraphics bbury</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">bbllx, bblly, bburx, bbury</itemformat></item>
</tableterm><tableitem><para>Set the bounding box.  These four are obsolete, but are retained for
compatibility with old packages.
</para>
<anchor name="includegraphics-natwidth">includegraphics natwidth</anchor>
<anchor name="includegraphics-natheight">includegraphics natheight</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">natwidth, natheight</itemformat></item>
</tableterm><tableitem><para>An alternative for <code>bb</code>.  Setting
</para>
<example endspaces=" ">
<pre xml:space="preserve">\includegraphics[...,natwidth=1in,natheight=0.618in,...]&lbrace;...&rbrace;
</pre></example>

<noindent></noindent>
<para>is the same as setting <code>bb=0 0 1in 0.618in</code>.
</para> 
<anchor name="includegraphics-hiresbb">includegraphics hiresbb</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">hiresbb</itemformat></item>
</tableterm><tableitem><para>If set to <code>true</code>, or just specified as with
</para>
<example endspaces=" ">
<pre xml:space="preserve">\includegraphics[...,hiresbb,...]&lbrace;...&rbrace;
</pre></example>

<noindent></noindent>
<para>then &latex; will look for <code>%%HiResBoundingBox</code> lines instead of
<code>%%BoundingBox</code> lines.  (The <code>BoundingBox</code> lines use only
natural numbers while the <code>HiResBoundingBox</code> lines use decimals;
both use units equivalent to &tex;&textrsquo;s big points, 1/72&nbsp;inch.) To
override a prior setting of <code>true</code>, you can set it to <code>false</code>.
</para>
</tableitem></tableentry></table>

<para>These following options allow a user to override &latex;&textrsquo;s method of
choosing the graphic type based on the filename extension.  An example
is that <code>\includegraphics[type=png,ext=.xxx,read=.xxx]&lbrace;lion&rbrace;</code>
will read the file <file>lion.xxx</file> as though it were
<file>lion.png</file>. For more on these, <pxref label="_005cDeclareGraphicsRule"><xrefnodename>\DeclareGraphicsRule</xrefnodename></pxref>.
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<beforefirstitem><anchor name="includegraphics-type">includegraphics type</anchor>
</beforefirstitem><tableentry><tableterm><item spaces=" "><itemformat command="code">type</itemformat></item>
</tableterm><tableitem><para>Specify the graphics type.
</para>
<anchor name="includegraphics-ext">includegraphics ext</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">ext</itemformat></item>
</tableterm><tableitem><para>Specify the graphics extension.
Only use this in conjunction with the option <code>type</code>.
</para>
<anchor name="includegraphics-read">includegraphics read</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">read</itemformat></item>
</tableterm><tableitem><para>Specify the file extension of the read file.
Only use this in conjunction with the option <code>type</code>.
</para>
<anchor name="includegraphics-command">includegraphics command</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">command</itemformat></item>
</tableterm><tableitem><para>Specify a command to be applied to this file.  Only use this in
conjunction with the option <code>type</code>.  <xref label="Command-line-options"><xrefnodename>Command line options</xrefnodename></xref>,
for a discussion of enabling the <code>\write18</code> functionality to run
external commands.
</para>
</tableitem></tableentry></table>


</subsection>
<node name="_005crotatebox" spaces=" "><nodename>\rotatebox</nodename><nodenext automatic="on">\scalebox</nodenext><nodeprev automatic="on">\includegraphics</nodeprev><nodeup automatic="on">Commands for graphics</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\rotatebox</code></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="829">rotation</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="830">rotating graphics</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="831">rotating text</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="971" mergedindex="cp">\rotatebox</indexterm></findex>

<para>Synopsis if you use the <code>graphics</code> package:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\rotatebox&lbrace;<var>angle</var>&rbrace;&lbrace;<var>material</var>&rbrace;
</pre></example>

<para>Synopses if you use the <code>graphicx</code> package:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\rotatebox&lbrace;<var>angle</var>&rbrace;&lbrace;<var>material</var>&rbrace;
\rotatebox[<var>key-value list</var>]&lbrace;<var>angle</var>&rbrace;&lbrace;<var>material</var>&rbrace;
</pre></example>

<para>Put <var>material</var> in a box and rotate it <var>angle</var> degrees
counterclockwise.
</para>
<para>This example rotates the table column heads forty-five degrees.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;tabular&rbrace;&lbrace;ll&rbrace;
  \rotatebox&lbrace;45&rbrace;&lbrace;Character&rbrace; &amp;\rotatebox&lbrace;45&rbrace;&lbrace;NATO phonetic&rbrace;   \\
  A                         &amp;AL-FAH  \\
  B                         &amp;BRAH-VOH
\end&lbrace;tabular&rbrace;
</pre></example>

<para>The <var>material</var> can be anything that goes in a box, including a graphic.
</para>
<example endspaces=" ">
<pre xml:space="preserve">  \rotatebox[origin=c]&lbrace;45&rbrace;&lbrace;\includegraphics[width=1in]&lbrace;lion&rbrace;&rbrace;
</pre></example>

<para>To place the rotated material, the first step is that &latex; sets
<var>material</var> in a box, with a reference point on the left baseline.
The second step is the rotation, by default about the reference point.
The third step is that &latex; computes a box to bound the rotated
material.  Fourth, &latex; moves this box horizontally so that the left
edge of this new bounding box coincides with the left edge of the box
from the first step (they need not coincide vertically).  This new
bounding box, in its new position, is what &latex; uses as the box when
typesetting this material.
</para>
<para>If you use the <code>graphics</code> package then the rotation is about the
reference point of the box. If you use the <code>graphicx</code> package
then these are the options that can go in the <var>key-value list</var>,
but note that you can get the same effect without needing this
package, except for the <code>x</code> and <code>y</code> options
(<pxref label="_005cincludegraphics"><xrefnodename>\includegraphics</xrefnodename></pxref>).
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">origin</itemformat></item>
</tableterm><tableitem><para>The point of the <var>material</var>&textrsquo;s box about which the rotation happens.
Possible value is any string containing one or two of: <code>l</code> for
left, <code>r</code> for right, <code>b</code> for bottom, <code>c</code> for center,
<code>t</code> for top, and <code>B</code> for baseline.  Thus, the first line here
</para>
<example endspaces=" ">
<pre xml:space="preserve">\rotatebox[origin=c]&lbrace;180&rbrace;&lbrace;moon&rbrace;
\rotatebox[origin=lB]&lbrace;180&rbrace;&lbrace;LeBateau&rbrace;
</pre></example>

<noindent></noindent>
<para>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</code> gives the horizontal center in <code>bc</code> or <code>tc</code> but gives
the vertical center in <code>lc</code> or <code>rc</code>, and gives both in
<code>c</code>.)  The default is <code>lB</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">x, y</itemformat></item>
</tableterm><tableitem><para>Specify an arbitrary point of rotation with
<code>\rotatebox[x=<var>&tex; dimension</var>,y=<var>&tex;
dimension</var>]&lbrace;...&rbrace;</code> (<pxref label="Units-of-length"><xrefnodename>Units of length</xrefnodename></pxref>).  These give the offset
from the box&textrsquo;s reference point.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">units</itemformat></item>
</tableterm><tableitem><para>This key allows you to change the default of degrees counterclockwise.
Setting <code>units=-360</code> changes the direction to degrees clockwise and
setting <code>units=6.283185</code> changes to radians counterclockwise.
</para>
</tableitem></tableentry></table>


</subsection>
<node name="_005cscalebox" spaces=" "><nodename>\scalebox</nodename><nodenext automatic="on">\resizebox</nodenext><nodeprev automatic="on">\rotatebox</nodeprev><nodeup automatic="on">Commands for graphics</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\scalebox</code></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="832">graphics, scaling</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="833">graphics, resizing</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="834">scaling</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="835">resizing</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="836">text, scaling</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="837">text, resizing</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="972" mergedindex="cp">\scalebox</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="973" mergedindex="cp">\reflectbox</indexterm></findex>

<para>Synopses:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\scalebox&lbrace;<var>horizontal factor</var>&rbrace;&lbrace;<var>material</var>&rbrace;
\scalebox&lbrace;<var>horizontal factor</var>&rbrace;[<var>vertical factor</var>]&lbrace;<var>material</var>&rbrace;
\reflectbox&lbrace;<var>material</var>&rbrace;
</pre></example>

<para>Scale the <var>material</var>.
</para>
<para>This example halves the size, both horizontally and vertically, of the
first text and doubles the size of the second.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\scalebox&lbrace;0.5&rbrace;&lbrace;DRINK ME&rbrace; and \scalebox&lbrace;2.0&rbrace;&lbrace;Eat Me&rbrace;
</pre></example>

<para>If you do not specify the optional <var>vertical factor</var> then it
defaults to the same value as the <var>horizontal factor</var>.
</para>
<para>You can use this command to resize a graphic, as here.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\scalebox&lbrace;0.5&rbrace;&lbrace;\includegraphics&lbrace;lion&rbrace;&rbrace;
</pre></example>

<noindent></noindent>
<para>If you use the <code>graphicx</code> package then you can accomplish the same
thing with optional arguments to <code>\includegraphics</code>
(<pxref label="_005cincludegraphics"><xrefnodename>\includegraphics</xrefnodename></pxref>).
</para>
<para>The <code>\reflectbox</code> command abbreviates
<code>\scalebox&lbrace;-1&rbrace;[1]&lbrace;<var>material</var>&rbrace;</code>.  Thus, <code>Able was
I\reflectbox&lbrace;Able was I&rbrace;</code> will show the phrase <samp>Able was I</samp>
immediately followed by its mirror reflection against a vertical axis.
</para>

</subsection>
<node name="_005cresizebox" spaces=" "><nodename>\resizebox</nodename><nodeprev automatic="on">\scalebox</nodeprev><nodeup automatic="on">Commands for graphics</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\resizebox</code></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="838">graphics, scaling</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="839">graphics, resizing</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="840">scaling</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="841">resizing</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="842">text, scaling</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="843">text, resizing</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="974" mergedindex="cp">\resizebox</indexterm></findex>

<para>Synopses:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\resizebox&lbrace;<var>horizontal length</var>&rbrace;&lbrace;<var>vertical length</var>&rbrace;&lbrace;<var>material</var>&rbrace;
\resizebox*&lbrace;<var>horizontal length</var>&rbrace;&lbrace;<var>vertical length</var>&rbrace;&lbrace;<var>material</var>&rbrace;
</pre></example>

<para>Given a size, such as <code>3cm</code>, transform <var>material</var> to make it
that size.  If either <var>horizontal length</var> or <var>vertical length</var>
is an exclamation point&nbsp;<code>!</code>  then the other argument is used
to determine a scale factor for both directions.
</para>
<para>This example makes the graphic be a half inch wide and scales it
vertically by the same factor to keep it from being distorted.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\resizebox&lbrace;0.5in&rbrace;&lbrace;!&rbrace;&lbrace;\includegraphics&lbrace;lion&rbrace;&rbrace;
</pre></example>

<para>The unstarred form <code>\resizebox</code> takes <var>vertical length</var> to be
the box&textrsquo;s height while the starred form <code>\resizebox*</code> takes it to
be height+depth.  For instance, make the text have a height+depth of a
quarter-inch with <code>\resizebox*&lbrace;!&rbrace;&lbrace;0.25in&rbrace;&lbrace;\parbox&lbrace;3.5in&rbrace;&lbrace;This
box has both height and depth.&rbrace;&rbrace;</code>.
</para>
<para>You can use <code>\depth</code>, <code>\height</code>, <code>\totalheight</code>, and
<code>\width</code> to refer to the original size of the box.  Thus, make the
text two inches wide but keep the original height with
<code>\resizebox&lbrace;2in&rbrace;&lbrace;\height&rbrace;&lbrace;Two inches&rbrace;</code>.
</para>

</subsection>
</section>
</chapter>
<node name="Special-insertions" spaces=" "><nodename>Special insertions</nodename><nodenext automatic="on">Splitting the input</nodenext><nodeprev automatic="on">Graphics</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Special insertions</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="844">special insertions</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="845">insertions of special characters</indexterm></cindex>

<para>&latex; provides commands for inserting characters that have a
special meaning do not correspond to simple characters you can type.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::         ">Reserved characters</menunode><menudescription><pre xml:space="preserve">Inserting <samp># $ % &amp; &lbrace; &rbrace; _ ~ ^ \</samp>
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::        ">Upper and lower case</menunode><menudescription><pre xml:space="preserve">Make text upper or lower case.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::    ">Symbols by font position</menunode><menudescription><pre xml:space="preserve">Inserting font symbols by number.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                ">Text symbols</menunode><menudescription><pre xml:space="preserve">Inserting other non-letter symbols in text.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                     ">Accents</menunode><menudescription><pre xml:space="preserve">Inserting accents.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::    ">Additional Latin letters</menunode><menudescription><pre xml:space="preserve">Inserting other non-English characters.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::            ">inputenc package</menunode><menudescription><pre xml:space="preserve">Set the input file text encoding.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                       ">\rule</menunode><menudescription><pre xml:space="preserve">Inserting lines and rectangles.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                      ">\today</menunode><menudescription><pre xml:space="preserve">Inserting today&textrsquo;s date.
</pre></menudescription></menuentry></menu>


<node name="Reserved-characters" spaces=" "><nodename>Reserved characters</nodename><nodenext automatic="on">Upper and lower case</nodenext><nodeup automatic="on">Special insertions</nodeup></node>
<section spaces=" "><sectiontitle>Reserved characters</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="846">reserved characters</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="847">characters, reserved</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="848">special characters</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="849">characters, special</indexterm></cindex>
<para>&latex; sets aside the following characters for special purposes. For
example, the percent sign&nbsp;<code>%</code> is for comments.  They are
called <dfn>reserved characters</dfn> or <dfn>special characters</dfn>. They are
all discussed elsewhere in this manual.
</para>
<example endspaces=" ">
<pre xml:space="preserve"># $ % &amp; &lbrace; &rbrace; _ ~ ^ \ 
</pre></example>

<findex index="fn" spaces=" "><indexterm index="fn" number="975" mergedindex="cp">\#</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="976" mergedindex="cp">\$</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="977" mergedindex="cp">\%</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="978" mergedindex="cp">\&amp;</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="979" mergedindex="cp">\_</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="980" mergedindex="cp">\&lbrace;</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="981" mergedindex="cp">\&rbrace;</indexterm></findex>
<para>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&nbsp;<code>\</code> in front of the character.  Thus,
typing <code>\$1.23</code> will produce&nbsp;<code>$1.23</code> in your output.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="982" mergedindex="cp">\~</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="983" mergedindex="cp">\^</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="984" mergedindex="cp">\textbackslash</indexterm></findex>
<para>As to the last three characters, to get a tilde in the text body font
use <code>\~&lbrace;&rbrace;</code> (omitting the curly braces would result in the next
character receiving a tilde accent).  Similarly, to get a text body
font circumflex use <code>\^&lbrace;&rbrace;</code>.  To get a backslash in the font of
the text body, enter <code>\textbackslash&lbrace;&rbrace;</code>.
</para>
<para>To produce the reserved characters in a typewriter font use
<code>\verb!!</code> as below (the double backslash&nbsp;<code>\\</code> is only
there to split the lines in the output).
</para>
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;center&rbrace;
  \# \$ \% \&amp; \&lbrace; \&rbrace; \_ \~&lbrace;&rbrace; \^&lbrace;&rbrace; \textbackslash \\
  \verb!# $ % &amp; &lbrace; &rbrace; _ ~ ^ \!
\end&lbrace;center&rbrace;
</pre></example>


</section>
<node name="Upper-and-lower-case" spaces=" "><nodename>Upper and lower case</nodename><nodenext automatic="on">Symbols by font position</nodenext><nodeprev automatic="on">Reserved characters</nodeprev><nodeup automatic="on">Special insertions</nodeup></node>
<section spaces=" "><sectiontitle>Upper and lower case</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="850">uppercase</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="851">lowercase</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="852">characters, case of</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="853">changing case of characters</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\uppercase&lbrace;<var>text</var>&rbrace;
\lowercase&lbrace;<var>text</var>&rbrace;
\MakeUppercase&lbrace;<var>text</var>&rbrace;
\MakeLowercase&lbrace;<var>text</var>&rbrace;
</pre></example>

<para>Change the case of characters.  The &tex; primitive commands
<code>\uppercase</code> and <code>\lowercase</code> are set up by default to work
only with the 26 letters a&textndash;z and A&textndash;Z. The &latex; commands
<code>\MakeUppercase</code> and <code>\MakeLowercase</code> commands also change
characters accessed by commands such as <code>\ae</code> or <code>\aa</code>.  The
commands <code>\MakeUppercase</code> and <code>\MakeLowercase</code> are robust
but they have moving arguments (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>These commands do not change the case of letters used in the name of a
command within <var>text</var>.  But they do change the case of every other
Latin letter inside the argument <var>text</var>.  Thus,
<code>\MakeUppercase&lbrace;Let $y=f(x)$</code>&rbrace; produces <samp>LET Y=F(X)</samp>.  Another
example is that the name of an environment will be changed, so that
<code>\MakeUppercase&lbrace;\begin&lbrace;tabular&rbrace; ... \end&lbrace;tabular&rbrace;&rbrace;</code> will
produce an error because the first half is changed to
<code>\begin&lbrace;TABULAR&rbrace;</code>.
</para>
<para>&latex; uses the same fixed table for changing case throughout a
document, The table used is designed for the font encoding T1; this
works well with the standard &tex; fonts for all Latin alphabets but
will cause problems when using other alphabets.
</para>
<para>To change the case of text that results from a macro inside <var>text</var>
you need to do expansion.  Here the <code>\Schoolname</code> produces
<samp>COLLEGE OF MATHEMATICS</samp>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcommand&lbrace;\schoolname&rbrace;&lbrace;College of Mathematics&rbrace;
\newcommand&lbrace;\Schoolname&rbrace;&lbrace;\expandafter\MakeUppercase
<w>                           </w>\expandafter&lbrace;\schoolname&rbrace;&rbrace;
</pre></example>

<cindex index="cp" spaces=" "><indexterm index="cp" number="854"><r>package</r>, <code>textcase</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="855"><code>textcase</code> <r>package</r></indexterm></cindex>

<para>The <code>textcase</code> package brings some of the missing feature of the
standard &latex; commands <code>\MakeUppercase</code> and
<code>\MakeLowerCase</code>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="856"><r>package</r>, <code>mfirstuc</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="857"><code>mfirstuc</code> <r>package</r></indexterm></cindex>

<para>To uppercase only the first letter of words, you can use the package
<code>mfirstuc</code>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="858"><r>package</r>, <code>expl3</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="859"><code>expl3</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="860">Wright, Joseph</indexterm></cindex>
<para>Handling all the casing rules specified by Unicode, e.g., for
non-Latin scripts, is a much bigger job than anything envisioned in
the original &tex; and &latex;.  It has been implemented in the
<code>expl3</code> package as of 2020. The article &textldquo;Case changing: From
&tex; primitives to the Unicode algorithm&textrdquo;, (Joseph Wright,
<cite>TUGboat</cite>&nbsp;41:1,
<url><urefurl>https://tug.org/TUGboat/tb41-1/tb127wright-case.pdf</urefurl></url>), gives a
good overview of the topic, past and present.
</para>

</section>
<node name="Symbols-by-font-position" spaces=" "><nodename>Symbols by font position</nodename><nodenext automatic="on">Text symbols</nodenext><nodeprev automatic="on">Upper and lower case</nodeprev><nodeup automatic="on">Special insertions</nodeup></node>
<section spaces=" "><sectiontitle>Symbols by font position</sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="985" mergedindex="cp">\symbol</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="861">accessing any character of a font</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="862">font symbols, by number</indexterm></cindex>

<para>You can access any character of the current font using its number with
the <code>\symbol</code> command. For example, the visible space character
used in the <code>\verb*</code> command has the code decimal 32 in the
standard Computer Modern typewriter font, so it can be typed as
<code>\symbol&lbrace;32&rbrace;</code>.
</para>
<para>You can also specify numbers in octal (base 8) by using a <code>'</code>
prefix, or hexadecimal (base 16) with a <code>&quot;</code> prefix, so the
visible space at 32 decimal could also be written as
<code>\symbol&lbrace;'40&rbrace;</code> or <code>\symbol&lbrace;&quot;20&rbrace;</code>.
</para>

</section>
<node name="Text-symbols" spaces=" "><nodename>Text symbols</nodename><nodenext automatic="on">Accents</nodenext><nodeprev automatic="on">Symbols by font position</nodeprev><nodeup automatic="on">Special insertions</nodeup></node>
<section spaces=" "><sectiontitle>Text symbols</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="863">text symbols</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="864">symbols, text</indexterm></cindex>

<findex index="fn" spaces=" "><indexterm index="fn" number="986" mergedindex="cp">textcomp <r>package</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="865">TS1 encoding</indexterm></cindex>
<para>&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.  As of the &latex; February 2020 release, all
symbols are available by default; before that, it was necessary to use
the <code>textcomp</code> package for some (technically, those in the
<code>TS1</code> font encoding).
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="987" mergedindex="cp">\copyright</indexterm>\copyright</itemformat></item>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="988" mergedindex="cp">\textcopyright</indexterm>\textcopyright</itemformat></itemx>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="866">copyright symbol</indexterm></cindex>
<para>&copyright; The copyright symbol.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="989" mergedindex="cp">\dag</indexterm>\dag</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="867">dagger, in text</indexterm></cindex>
<para><U>2020</U> The dagger symbol (in text).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="990" mergedindex="cp">\ddag</indexterm>\ddag</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="868">double dagger, in text</indexterm></cindex>
<para><U>2021</U> The double dagger symbol (in text).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="991" mergedindex="cp">\LaTeX</indexterm>\LaTeX</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="869">&latex; logo</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="870">logo, &latex;</indexterm></cindex>
<para>The &latex; logo.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="992" mergedindex="cp">\LaTeXe</indexterm>\LaTeXe</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="871">&latex;2e logo</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="872">logo, &latex;2e</indexterm></cindex>
<para>The &latex;2e logo.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="993" mergedindex="cp">\guillemotleft <r>(&guillemotleft;)</r></indexterm>\guillemotleft <r>(&guillemotleft;)</r></itemformat></item>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="994" mergedindex="cp">\guillemotright <r>(&guillemotright;)</r></indexterm>\guillemotright <r>(&guillemotright;)</r></itemformat></itemx>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="995" mergedindex="cp">\guilsinglleft <r>(&lsaquo;)</r></indexterm>\guilsinglleft <r>(&lsaquo;)</r></itemformat></itemx>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="996" mergedindex="cp">\guilsinglright <r>(&rsaquo;)</r></indexterm>\guilsinglright <r>(&rsaquo;)</r></itemformat></itemx>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="873">double guillemets</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="874">single guillemets</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="875">left angle quotation marks</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="876">right angle quotation marks</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="877">double angle quotation marks</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="878">single angle quotation marks</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="879">French quotation marks</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="880">quotation marks, French</indexterm></cindex>
<para>&guillemotleft;, &guillemotright;, &lsaquo;, &rsaquo;
Double and single angle quotation marks, commonly used in French.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="997" mergedindex="cp">\ldots</indexterm>\ldots</itemformat></item>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="998" mergedindex="cp">\dots</indexterm>\dots</itemformat></itemx>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="999" mergedindex="cp">\textellipsis</indexterm>\textellipsis</itemformat></itemx>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="881">ellipsis</indexterm></cindex>
<para>&dots;  An ellipsis (three dots at the baseline):  <code>\ldots</code>
and <code>\dots</code> also work in math mode.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1000" mergedindex="cp">\lq</indexterm>\lq</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="882">left quote</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="883">opening quote</indexterm></cindex>
<para>&textlsquo; Left (opening) quote.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1001" mergedindex="cp">\P</indexterm>\P</itemformat></item>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="1002" mergedindex="cp">\textparagraph</indexterm>\textparagraph</itemformat></itemx>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="884">paragraph symbol</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="885">pilcrow</indexterm></cindex>
<para><U>00B6</U> Paragraph sign (pilcrow).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1003" mergedindex="cp">\pounds</indexterm>\pounds</itemformat></item>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="1004" mergedindex="cp">\textsterling</indexterm>\textsterling</itemformat></itemx>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="886">pounds symbol</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="887">sterling symbol</indexterm></cindex>
<para>&pound; English pounds sterling.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1005" mergedindex="cp">\quotedblbase <r>(&bdquo;)</r></indexterm>\quotedblbase <r>(&bdquo;)</r></itemformat></item>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="1006" mergedindex="cp">\quotesinglbase <r>(&sbquo;)</r></indexterm>\quotesinglbase <r>(&sbquo;)</r></itemformat></itemx>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="888">double low-9 quotation mark</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="889">single low-9 quotation mark</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="890">low-9 quotation marks, single and double</indexterm></cindex>
<para>&bdquo; and &sbquo;
Double and single quotation marks on the baseline.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1007" mergedindex="cp">\rq</indexterm>\rq</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="891">right quote</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="892">closing quote</indexterm></cindex>
<para>&textrsquo; Right (closing) quote.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1008" mergedindex="cp">\S</indexterm>\S</itemformat></item>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="1009" mergedindex="cp">\textsection</indexterm>\textsection</itemformat></itemx>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="893">section symbol</indexterm></cindex>
<para><U>00A7</U> Section sign.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1010" mergedindex="cp">\TeX</indexterm>\TeX</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="894">&tex; logo</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="895">logo, &tex;</indexterm></cindex>
<para>The &tex; logo.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1011" mergedindex="cp">\textasciicircum</indexterm>\textasciicircum</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="896">circumflex, ASCII, in text</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="897">ASCII circumflex, in text</indexterm></cindex>
<para>^ ASCII circumflex.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1012" mergedindex="cp">\textasciitilde</indexterm>\textasciitilde</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="898">tilde, ASCII, in text</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="899">ASCII tilde, in text</indexterm></cindex>
<para>~ ASCII tilde.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1013" mergedindex="cp">\textasteriskcentered</indexterm>\textasteriskcentered</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="900">asterisk, centered, in text</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="901">centered asterisk, in text</indexterm></cindex>
<para>* Centered asterisk.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1014" mergedindex="cp">\textbackslash</indexterm>\textbackslash</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="902">backslash, in text</indexterm></cindex>
<para>\ Backslash.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1015" mergedindex="cp">\textbar</indexterm>\textbar</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="903">vertical bar, in text</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="904">bar, vertical, in text</indexterm></cindex>
<para>| Vertical bar.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1016" mergedindex="cp">\textbardbl</indexterm>\textbardbl</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="905">vertical bar, double, in text</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="906">bar, double vertical, in text</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="907">double vertical bar, in text</indexterm></cindex>
<para><U>23F8</U> Double vertical bar.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1017" mergedindex="cp">\textbigcircle</indexterm>\textbigcircle</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="908">big circle symbols, in text</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="909">circle symbol, big, in text</indexterm></cindex>
<para><U>25EF</U>, Big circle symbol.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1018" mergedindex="cp">\textbraceleft</indexterm>\textbraceleft</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="910">left brace, in text</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="911">brace, left, in text</indexterm></cindex>
<para>&lbrace; Left brace.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1019" mergedindex="cp">\textbraceright</indexterm>\textbraceright</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="912">right brace, in text</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="913">brace, right, in text</indexterm></cindex>
<para>&rbrace; Right brace.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1020" mergedindex="cp">\textbullet</indexterm>\textbullet</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="914">bullet, in text</indexterm></cindex>
<para>&bullet; Bullet.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1021" mergedindex="cp">\textcircled&lbrace;<var>letter</var>&rbrace;</indexterm>\textcircled&lbrace;<var>letter</var>&rbrace;</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="915">circled letter, in text</indexterm></cindex>
<para><U>24B6</U>, Circle around <var>letter</var>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1022" mergedindex="cp">\textcompwordmark</indexterm>\textcompwordmark</itemformat></item>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="1023" mergedindex="cp">\textcapitalcompwordmark</indexterm>\textcapitalcompwordmark</itemformat></itemx>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="1024" mergedindex="cp">\textascendercompwordmark</indexterm>\textascendercompwordmark</itemformat></itemx>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="916">composite word mark, in text</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="917">cap height</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="918">ascender height</indexterm></cindex>
<para>Used to separate letters that would normally ligature. For example,
<code>f\textcompwordmark i</code> produces <samp>fi</samp> without a ligature. This
is most useful in non-English languages.  The
<code>\textcapitalcompwordmark</code> form has the cap height of the font
while the <code>\textascendercompwordmark</code> form has the ascender height.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1025" mergedindex="cp">\textdagger</indexterm>\textdagger</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="919">dagger, in text</indexterm></cindex>
<para><U>2020</U> Dagger.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1026" mergedindex="cp">\textdaggerdbl</indexterm>\textdaggerdbl</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="920">dagger, double, in text</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="921">double dagger, in text</indexterm></cindex>
<para><U>2021</U> Double dagger.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1027" mergedindex="cp">\textdollar <r>(or <code>\$</code>)</r></indexterm>\textdollar <r>(or <code>\$</code>)</r></itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="922">dollar sign</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="923">currency, dollar</indexterm></cindex>
<para>$ Dollar sign.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1028" mergedindex="cp">\textemdash <r>(or <code>---</code>)</r></indexterm>\textemdash <r>(or <code>---</code>)</r></itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="924">em-dash</indexterm></cindex>
<raggedright endspaces=" ">
<para>&textmdash; Em-dash.  Used for punctuation, usually similar to commas or
parentheses, as in &textlsquo;<code>The playoffs---if you're lucky
enough to make the playoffs---are more like a sprint.</code>&textrsquo; Conventions
for spacing around em-dashes vary widely.
</para></raggedright>

</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1029" mergedindex="cp">\textendash <r>(or <code>--</code>)</r></indexterm>\textendash <r>(or <code>--</code>)</r></itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="925">e-dash</indexterm></cindex>
<para>&textndash; En-dash. Used for ranges, as in &textlsquo;<code>see pages 12--14</code>&textrsquo;.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1030" mergedindex="cp">\texteuro</indexterm>\texteuro</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="926">euro symbol</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="927">currency, euro</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="928"><r>package</r>, <code>eurosym</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="929"><code>eurosym</code> <r>package</r></indexterm></cindex>

<para>The Euro currency symbol: &euro;.
<cindex index="cp" spaces=" "><indexterm index="cp" number="930"><r>package</r>, <code>eurosym</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="931"><code>eurosym</code> <r>package</r></indexterm></cindex>
</para>
<para>For an alternative glyph design, try the
<code>eurosym</code> package; also, most fonts nowadays come with their own
Euro symbol (Unicode U+20AC).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1031" mergedindex="cp">\textexclamdown <r>(or <code>!`</code>)</r></indexterm>\textexclamdown <r>(or <code>!`</code>)</r></itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="932">exclamation point, upside-down</indexterm></cindex>
<para>&iexcl; Upside down exclamation point.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1032" mergedindex="cp">\textfiguredash</indexterm>\textfiguredash</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="933">figure dash character</indexterm></cindex>
<para>Dash used between numerals, Unicode U+2012. Defined in the June 2021
release of &latex;. When used in pdf&tex;, approximated by an
en-dash; with a Unicode engine, either typesets the glyph if available
in the current font, or writes the usual &textldquo;Missing character&textrdquo; warning
to the log file.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1033" mergedindex="cp">\textgreater</indexterm>\textgreater</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="934">greater than symbol, in text</indexterm></cindex>
<para>&gt; Greater than symbol.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1034" mergedindex="cp">\texthorizontalbar</indexterm>\texthorizontalbar</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="935">horizontal bar character</indexterm></cindex>
<para>Horizontal bar character, Unicode U+2015. Defined in the June 2021
release of &latex;. Behavior as with <code>\textfiguredash</code> above;
the pdf&tex; approximation is an em-dash.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1035" mergedindex="cp">\textless</indexterm>\textless</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="936">less than symbol, in text</indexterm></cindex>
<para>&lt; Less than symbol.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1036" mergedindex="cp">\textleftarrow</indexterm>\textleftarrow</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="937">arrow, left, in text</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="938">left arrow, in text</indexterm></cindex>
<para><U>2190</U>, Left arrow.   
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1037" mergedindex="cp">\textnonbreakinghyphen</indexterm>\textnonbreakinghyphen</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="939">non-breaking hyphen character</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="940">hyphen character, non-breaking</indexterm></cindex>
<para>Non-breaking hyphen character, Unicode U+2011. Defined in the June
2021 release of &latex;. Behavior as with <code>\textfiguredash</code>
above; the pdf&tex; approximation is a regular ASCII hyphen (with
breaks disallowed after).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1038" mergedindex="cp">\textordfeminine</indexterm>\textordfeminine</itemformat></item>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="1039" mergedindex="cp">\textordmasculine</indexterm>\textordmasculine</itemformat></itemx>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="941">feminine ordinal symbol</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="942">masculine ordinal symbol</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="943">ordinals, feminine and masculine</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="944">Spanish ordinals, feminine and masculine</indexterm></cindex>
<para>&ordf;, &ordm; Feminine and masculine ordinal symbols.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1040" mergedindex="cp">\textperiodcentered</indexterm>\textperiodcentered</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="945">period, centered, in text</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="946">centered period, in text</indexterm></cindex>
<para><U>00B7</U> Centered period.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1041" mergedindex="cp">\textquestiondown <r>(or <code>?`</code>)</r></indexterm>\textquestiondown <r>(or <code>?`</code>)</r></itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="947">question mark, upside-down</indexterm></cindex>
<para>&iquest; Upside down question mark.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1042" mergedindex="cp">\textquotedblleft <r>(or <code>``</code>)</r></indexterm>\textquotedblleft <r>(or <code>``</code>)</r></itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="948">left quote, double</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="949">double left quote</indexterm></cindex>
<para>&textldquo; Double left quote.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1043" mergedindex="cp">\textquotedblright <r>(or <code>''</code>)</r></indexterm>\textquotedblright <r>(or <code>''</code>)</r></itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="950">right quote, double</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="951">double right quote</indexterm></cindex>
<para>&textrdquo; Double right quote.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1044" mergedindex="cp">\textquoteleft <r>(or <code>`</code>)</r></indexterm>\textquoteleft <r>(or <code>`</code>)</r></itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="952">left quote, single</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="953">single left quote</indexterm></cindex>
<para>&textlsquo; Single left quote.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1045" mergedindex="cp">\textquoteright <r>(or <code>'</code>)</r></indexterm>\textquoteright <r>(or <code>'</code>)</r></itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="954">right quote, single</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="955">single right quote</indexterm></cindex>
<para>&textrsquo; Single right quote.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1046" mergedindex="cp">\textquotesingle</indexterm>\textquotesingle</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="956">quote, single straight</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="957">straight single quote</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="958">single quote, straight</indexterm></cindex>
<para><U>0027</U>, Straight single quote.  (From TS1 encoding.)  
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1047" mergedindex="cp">\textquotestraightbase</indexterm>\textquotestraightbase</itemformat></item>
<itemx spaces=" "><itemformat command="code"><indexterm index="fn" number="1048" mergedindex="cp">\textquotestraightdblbase</indexterm>\textquotestraightdblbase</itemformat></itemx>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="959">quote, straight base</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="960">straight quote, base</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="961">double quote, straight base</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="962">straight double quote, base</indexterm></cindex>
<!-- c Unicode doesn't have these https://en.wikipedia.org/wiki/Quotation_mark -->
<para>Single and double straight quotes on the baseline.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1049" mergedindex="cp">\textregistered</indexterm>\textregistered</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="963">registered symbol</indexterm></cindex>
<para>&registered; Registered symbol.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1050" mergedindex="cp">\textrightarrow</indexterm>\textrightarrow</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="964">arrow, right, in text</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="965">right arrow, in text</indexterm></cindex>
<para><U>2192</U>, Right arrow.  
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1051" mergedindex="cp">\textthreequartersemdash</indexterm>\textthreequartersemdash</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="966">three-quarters em-dash</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="967">em-dash, three-quarters</indexterm></cindex>
<para><U>FE58</U>, &textldquo;Three-quarters&textrdquo; em-dash, between en-dash and em-dash.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1052" mergedindex="cp">\texttrademark</indexterm>\texttrademark</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="968">trademark symbol</indexterm></cindex>
<para><U>2122</U> Trademark symbol.
</para>
<!-- c ?? Diff from \textthreequartersemdash?  In Unicode? -->
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1053" mergedindex="cp">\texttwelveudash</indexterm>\texttwelveudash</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="969">two-thirds em-dash</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="970">em-dash, two-thirds</indexterm></cindex>
<para><U>FE58</U>, &textldquo;Two-thirds&textrdquo; em-dash, between en-dash and em-dash.   
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1054" mergedindex="cp">\textunderscore</indexterm>\textunderscore</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="971">underscore, in text</indexterm></cindex>
<para>_ Underscore.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1055" mergedindex="cp">\textvisiblespace</indexterm>\textvisiblespace</itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="972">visible space symbol, in text</indexterm></cindex>
<para><U>2423</U>, Visible space symbol.  
</para>
</tableitem></tableentry></ftable>


</section>
<node name="Accents" spaces=" "><nodename>Accents</nodename><nodenext automatic="on">Additional Latin letters</nodenext><nodeprev automatic="on">Text symbols</nodeprev><nodeup automatic="on">Special insertions</nodeup></node>
<section spaces=" "><sectiontitle>Accents</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="973">accents</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="974">characters, accented</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="975">letters, accented</indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="976"><r>package</r>, <code>babel</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="977"><code>babel</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="978"><r>package</r>, <code>polyglossia</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="979"><code>polyglossia</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="980">multilingual support</indexterm></cindex>
<para>&latex; has wide support for many of the world&textrsquo;s scripts and
languages, provided through the core <code>babel</code> package, which
supports pdf&latex;, Xe&latex; and Lua&latex;. The
<code>polyglossia</code> package provides similar support with the latter
two engines.
</para>
<para>This section does not cover that support. It only lists the core
&latex; commands for creating accented characters.  The
<code>\capital...</code>  commands shown here produce alternative forms for
use with capital letters.  These are not available with OT1.
</para>
<para>Below, to make them easier to find, the accents are all illustrated with
lowercase <samp>o</samp>.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="1056" mergedindex="cp">\i <r>(dotless i)</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="981">dotless i</indexterm></cindex>
<para>Note that <code>\i</code> produces a dotless i,
<!-- c @dotless{i}, -->
<findex index="fn" spaces=" "><indexterm index="fn" number="1057" mergedindex="cp">\j <r>(dotless j)</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="982">dotless j</indexterm></cindex>
and <code>\j</code> produces a dotless j.
<!-- c @dotless{j}. -->
These are often used in place of their dotted counterparts when they are
accented.
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">\&quot;</itemformat></item>
<itemx spaces=" "><itemformat command="code">\capitaldieresis</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1058" mergedindex="cp">\&quot; <r>(umlaut accent)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1059" mergedindex="cp">\capitaldieresis</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="983">umlaut accent</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="984">dieresis accent</indexterm></cindex>
<para><accent type="uml">o</accent> Umlaut (dieresis).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\'</itemformat></item>
<itemx spaces=" "><itemformat command="code">\capitalacute</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1060" mergedindex="cp">\' <r>(acute accent)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1061" mergedindex="cp">\capitalacute</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="985">acute accent</indexterm></cindex>
<para><accent type="acute">o</accent> Acute accent.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\.</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1062" mergedindex="cp">\. <r>(dot-over accent)</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="986">dot accent</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="987">dot-over accent</indexterm></cindex>
<para><accent type="dotaccent">o</accent>  Dot accent.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\=</itemformat></item>
<itemx spaces=" "><itemformat command="code">\capitalmacron</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1063" mergedindex="cp">\= <r>(macron accent)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1064" mergedindex="cp">\capitalmacron</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="988">macron accent</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="989">overbar accent</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="990">bar-over accent</indexterm></cindex>
<para><accent type="macr">o</accent> Macron (overbar) accent.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\^</itemformat></item>
<itemx spaces=" "><itemformat command="code">\capitalcircumflex</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1065" mergedindex="cp">\^ <r>(circumflex accent)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1066" mergedindex="cp">\capitalcircumflex</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="991">circumflex accent</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="992">hat accent</indexterm></cindex>
<para><accent type="circ">o</accent> Circumflex (hat) accent.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\`</itemformat></item>
<itemx spaces=" "><itemformat command="code">\capitalgrave</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1067" mergedindex="cp">\` <r>(grave accent)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1068" mergedindex="cp">\capitalgrave</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="993">grave accent</indexterm></cindex>
<para><accent type="grave">o</accent> Grave accent.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\~</itemformat></item>
<itemx spaces=" "><itemformat command="code">\capitaltilde</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1069" mergedindex="cp">\~ <r>(tilde accent)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1070" mergedindex="cp">\capitaltilde</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="994">tilde accent</indexterm></cindex>
<para><accent type="tilde">n</accent> Tilde accent.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\b</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1071" mergedindex="cp">\b <r>(bar-under accent)</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="995">bar-under accent</indexterm></cindex>
<para><accent type="ubaraccent">o</accent> Bar accent underneath.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="1072" mergedindex="cp">\underbar</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="996">underbar</indexterm></cindex>
<para>Related to this, <code>\underbar&lbrace;<var>text</var>&rbrace;</code> produces a bar under
<var>text</var>.  The argument is always processed in LR mode
(<pxref label="Modes"><xrefnodename>Modes</xrefnodename></pxref>).  The bar is always a fixed position under the baseline,
thus crossing through descenders.  See also <code>\underline</code> in
<ref label="Math-miscellany"><xrefnodename>Math miscellany</xrefnodename></ref>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\c</itemformat></item>
<itemx spaces=" "><itemformat command="code">\capitalcedilla</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1073" mergedindex="cp">\c <r>(cedilla accent)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1074" mergedindex="cp">\capitalcedilla</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="997">cedilla accent</indexterm></cindex>
<para><accent type="cedil">c</accent> Cedilla accent underneath.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\d</itemformat></item>
<itemx spaces=" "><itemformat command="code">\capitaldotaccent</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1075" mergedindex="cp">\d <r>(dot-under accent)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1076" mergedindex="cp">\capitaldotaccent</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="998">dot-under accent</indexterm></cindex>
<para><accent type="udotaccent">o</accent> Dot accent underneath.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\H</itemformat></item>
<itemx spaces=" "><itemformat command="code">\capitalhungarumlaut</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1077" mergedindex="cp">\H <r>(Hungarian umlaut accent)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1078" mergedindex="cp">\capitalhungarumlaut</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="999">hungarian umlaut accent</indexterm></cindex>
<para><accent type="doubleacute">o</accent> Long Hungarian umlaut accent.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\k</itemformat></item>
<itemx spaces=" "><itemformat command="code">\capitalogonek</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1079" mergedindex="cp">\k <r>(ogonek)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1080" mergedindex="cp">\capitalogonek</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1000">ogonek</indexterm></cindex>
<para><accent type="ogon">o</accent> Ogonek.  Not available in the OT1 encoding.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\r</itemformat></item>
<itemx spaces=" "><itemformat command="code">\capitalring</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1081" mergedindex="cp">\r <r>(ring accent)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1082" mergedindex="cp">\capitalring</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1001">ring accent</indexterm></cindex>
<para><accent type="ring">o</accent> Ring accent.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\t</itemformat></item>
<itemx spaces=" "><itemformat command="code">\capitaltie</itemformat></itemx>
<itemx spaces=" "><itemformat command="code">\newtie</itemformat></itemx>
<itemx spaces=" "><itemformat command="code">\capitalnewtie</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1083" mergedindex="cp">\t <r>(tie-after accent)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1084" mergedindex="cp">\capitaltie</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1085" mergedindex="cp">\newtie</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1086" mergedindex="cp">\capitalnewtie</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1002">tie-after accent</indexterm></cindex>
<para>Tie-after accent (used for transliterating from Cyrillic, such as in the
ALA-LC romanization).  It expects that the argument has two characters.
The <code>\newtie</code> form is centered in its box.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\u</itemformat></item>
<itemx spaces=" "><itemformat command="code">\capitalbreve</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1087" mergedindex="cp">\u <r>(breve accent)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1088" mergedindex="cp">\capitalbreve</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1003">breve accent</indexterm></cindex>
<para><accent type="breve">o</accent> Breve accent.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\v</itemformat></item>
<itemx spaces=" "><itemformat command="code">\capitalcaron</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1089" mergedindex="cp">\v <r>(breve accent)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1090" mergedindex="cp">\capitalcaron</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1004">hacek accent</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1005">check accent</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1006">caron accent</indexterm></cindex>
<para><accent type="caron">o</accent>  H<accent type="acute" bracketed="off">a</accent><accent type="caron">c</accent>ek (check, caron) accent.
</para>
</tableitem></tableentry></table>

<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::                 ">\accent</menunode><menudescription><pre xml:space="preserve">Low level command to produce an accented character.
</pre></menudescription></menuentry></menu>


<node name="_005caccent" spaces=" "><nodename>\accent</nodename><nodeup automatic="on">Accents</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\accent</code></sectiontitle>
<findex index="fn" spaces=" "><indexterm index="fn" number="1091" mergedindex="cp">\accent</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\accent <var>number</var> <var>character</var>
</pre></example>

<para>A &tex; primitive command used to generate accented characters from
accent marks and letters. The accent mark is selected by <var>number</var>, a
numeric argument, followed by a space and then a <var>character</var>
argument to construct the accented character in the current font.
</para>
<para>These are accented <samp>e</samp> characters.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\accent18 e
\accent20 e
\accent21 e
\accent22 e
\accent23 e
</pre></example>

<noindent></noindent>
<para>The first is a grave, the second a caron, the third a breve, the fourth
a macron, and the fifth a ring above.
</para>
<para>The position of the accent is determined by the font designer and so the
outcome of <code>\accent</code> use may differ between fonts. In &latex; it is
desirable to have glyphs for accented characters rather than building
them using <code>\accent</code>. Using glyphs that already contain the
accented characters (as in T1 encoding) allows correct hyphenation
whereas <code>\accent</code> disables hyphenation (specifically with OT1 font
encoding where accented glyphs are absent).
</para>
<para>There can be an optional font change between <var>number</var> and
<var>character</var>.  Note also that this command sets the
<code>\spacefactor</code> to 1000 (<pxref label="_005cspacefactor"><xrefnodename>\spacefactor</xrefnodename></pxref>).
</para>
<para>An unavoidable characteristic of some Cyrillic letters and
the majority of accented Cyrillic letters is that they must be
assembled from multiple elements (accents, modifiers, etc.) while
<code>\accent</code> provides for a single accent mark and a single letter
combination. There are also cases where accents must appear between
letters that \accent does not support.  Still other cases exist where
the letters I and J have dots above their lowercase counterparts that
conflict with dotted accent marks. The use of <code>\accent</code> in these
cases will not work as it cannot analyze upper/lower case.
</para>

</subsection>
</section>
<node name="Additional-Latin-letters" spaces=" "><nodename>Additional Latin letters</nodename><nodenext automatic="on">inputenc package</nodenext><nodeprev automatic="on">Accents</nodeprev><nodeup automatic="on">Special insertions</nodeup></node>
<section spaces=" "><sectiontitle>Additional Latin letters</sectiontitle>

<anchor name="Non_002dEnglish-characters">Non-English characters</anchor>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1007">Latin letters, additional</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1008">letters, additional Latin</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1009">extended Latin</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1010">special characters</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1011">non-English characters</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1012">characters, non-English</indexterm></cindex>

<para>Here are the basic &latex; commands for inserting letters beyond
A&textndash;Z that extend the Latin alphabet, used primarily in languages other
than English.
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">\aa</itemformat></item>
<itemx spaces=" "><itemformat command="code">\AA</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1092" mergedindex="cp">\aa <r>(&aring;)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1093" mergedindex="cp">\AA <r>(&Aring;)</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1013">aring</indexterm></cindex>
<para>&aring; and &Aring;.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\ae</itemformat></item>
<itemx spaces=" "><itemformat command="code">\AE</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1094" mergedindex="cp">\ae <r>(&aelig;)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1095" mergedindex="cp">\AE <r>(&AElig;)</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1014">ae ligature</indexterm></cindex>
<para>&aelig; and &AElig;.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\dh</itemformat></item>
<itemx spaces=" "><itemformat command="code">\DH</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1096" mergedindex="cp">\dh <r>(&eth;)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1097" mergedindex="cp">\DH <r>(&ETH;)</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1015">Icelandic eth</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1016">eth, Icelandic letter</indexterm></cindex>
<para>Icelandic letter eth: &eth; and &ETH;. Not available with <sc>OT1</sc>
encoding, you need the <file>fontenc</file> package to select an alternate
font encoding, such as <sc>T1</sc>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\dj</itemformat></item>
<itemx spaces=" "><itemformat command="code">\DJ</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1098" mergedindex="cp">\dj</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1099" mergedindex="cp">\DJ</indexterm></findex>
<para>Crossed d and D, a.k.a.&noeos; capital and small letter d with stroke.  Not
available with <sc>OT1</sc> encoding, you need the <file>fontenc</file> package to
select an alternate font encoding, such as <sc>T1</sc>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\ij</itemformat></item>
<itemx spaces=" "><itemformat command="code">\IJ</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1100" mergedindex="cp">\ij <r>(ij)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1101" mergedindex="cp">\IJ <r>(IJ)</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1017">ij letter, Dutch</indexterm></cindex>
<para>ij and IJ (except somewhat closer together than appears here).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\l</itemformat></item>
<itemx spaces=" "><itemformat command="code">\L</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1102" mergedindex="cp">\l <r>(&lslash;)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1103" mergedindex="cp">\L <r>(&Lslash;)</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1018">polish l</indexterm></cindex>
<para>&lslash; and &Lslash;.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\ng</itemformat></item>
<itemx spaces=" "><itemformat command="code">\NG</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1104" mergedindex="cp">\ng</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1105" mergedindex="cp">\NG</indexterm></findex>
<para>Lappish letter eng, also used in phonetics.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\o</itemformat></item>
<itemx spaces=" "><itemformat command="code">\O</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1106" mergedindex="cp">\o <r>(&oslash;)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1107" mergedindex="cp">\O <r>(&Oslash;)</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1019">oslash</indexterm></cindex>
<para>&oslash; and &Oslash;.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\oe</itemformat></item>
<itemx spaces=" "><itemformat command="code">\OE</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1108" mergedindex="cp">\oe <r>(&oelig;)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1109" mergedindex="cp">\OE <r>(&OElig;)</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1020">oe ligature</indexterm></cindex>
<para>&oelig; and &OElig;.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\ss</itemformat></item>
<itemx spaces=" "><itemformat command="code">\SS</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1110" mergedindex="cp">\ss <r>(&szlig;)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1111" mergedindex="cp">\SS <r>(SS)</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1021">es-zet German letter</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1022">sharp S letters</indexterm></cindex>
<para>&szlig; and SS.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">\th</itemformat></item>
<itemx spaces=" "><itemformat command="code">\TH</itemformat></itemx>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1112" mergedindex="cp">\th <r>(&thorn;)</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1113" mergedindex="cp">\TH <r>(&THORN;)</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1023">Icelandic thorn</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1024">thorn, Icelandic letter</indexterm></cindex>
<para>Icelandic letter thorn: &thorn; and &THORN;. Not available with <sc>OT1</sc>
encoding, you need the <file>fontenc</file> package to select an alternate
font encoding, such as <sc>T1</sc>.
</para>
</tableitem></tableentry></table>


</section>
<node name="inputenc-package" spaces=" "><nodename>inputenc package</nodename><nodenext automatic="on">\rule</nodenext><nodeprev automatic="on">Additional Latin letters</nodeprev><nodeup automatic="on">Special insertions</nodeup></node>
<section spaces=" "><sectiontitle><code>inputenc</code> package</sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1114" mergedindex="cp">inputenc</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage[<var>encoding-name</var>]&lbrace;inputenc&rbrace;
</pre></example>

<para>Declare the input file&textrsquo;s text encoding to be <var>encoding-name</var>. The
default, if this package is not loaded, is UTF-8.  Technically,
specifying the encoding name is optional, but in practice it is not
useful to omit it.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1025">encoding, of input files</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1026">character encoding</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1027">Unicode</indexterm></cindex>
<para>In a computer file, the characters are stored according to a scheme
called the <dfn>encoding</dfn>.  There are many different encodings.  The
simplest is ASCII, which supports 95 printable characters, not enough
for most of the world&textrsquo;s languages. For instance, to typeset the
a-umlaut character <samp><accent type="uml">a</accent></samp> in an ASCII-encoded &latex; source file, the
sequence <code>\&quot;a</code> is used. This would make source files for anything
but English hard to read; even for English, often a more extensive
encoding is more convenient.
</para>
<para>The modern encoding standard, in some ways a union of the others, is
UTF-8, one of the representations of Unicode. This is the default for
&latex; since 2018. 
</para>
<para>The <code>inputenc</code> package is how &latex; knows what encoding is
used.  For instance, the following command explicitly says that the
input file is UTF-8 (note the lack of a dash).
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage[utf8]&lbrace;inputenc&rbrace;
</pre></example>

<para>Caution: use <code>inputenc</code> only with the pdf&tex; engine
(<pxref label="TeX-engines"><xrefnodename>&tex; engines</xrefnodename></pxref>).  (The Xe&tex; and Lua&tex; engines assume
that the input file is UTF-8 encoded.)  If you invoke &latex; with
either the <command>xelatex</command> command or the <command>lualatex</command>
command, and try to declare a non-UTF-8 encoding with <code>inputenc</code>,
such as <code>latin1</code>, then you will get the error <code>inputenc is
not designed for xetex or luatex</code>.
</para>
<para>An <code>inputenc</code> package error such as <code>Invalid UTF-8 byte &quot;96</code>
means that some of the material in the input file does not follow the
encoding scheme.  Often these errors come from copying material from a
document that uses a different encoding than the input file; this one
is a left single quote from a web page using <code>latin1</code> inside a
&latex; input file that uses UTF-8.  The simplest solution is to
replace the non-UTF-8 character with its UTF-8 equivalent, or use a
&latex; equivalent command or character.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="1115" mergedindex="cp">\inputencoding</indexterm></findex>
<anchor name="_005cinputencoding">\inputencoding</anchor>
<para>In some documents, such as a collection of journal articles from a
variety of authors, changing the encoding in mid-document may be
necessary.  Use the command
<code>\inputencoding&lbrace;<var>encoding-name</var>&rbrace;</code>.  The most common values
for <var>encoding-name</var> are: <code>ascii</code>, <code>latin1</code>,
<code>latin2</code>, <code>latin3</code>, <code>latin4</code>, <code>latin5</code>,
<code>latin9</code>, <code>latin10</code>, and&nbsp;<code>utf8</code>.
</para>

</section>
<node name="_005crule" spaces=" "><nodename>\rule</nodename><nodenext automatic="on">\today</nodenext><nodeprev automatic="on">inputenc package</nodeprev><nodeup automatic="on">Special insertions</nodeup></node>
<section spaces=" "><sectiontitle><code>\rule</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1116" mergedindex="cp">\rule</indexterm></findex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\rule&lbrace;<var>width</var>&rbrace;&lbrace;<var>thickness</var>&rbrace;
\rule[<var>raise</var>]&lbrace;<var>width</var>&rbrace;&lbrace;<var>thickness</var>&rbrace;
</pre></example>

<para>Produce a <dfn>rule</dfn>, a filled-in rectangle.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1028">Halmos symbol</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1029">tombstone</indexterm></cindex>
<para>This example produces a rectangular blob, sometimes called a Halmos symbol,
or just &textldquo;qed&textrdquo;, often used to mark the end of a proof:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcommand&lbrace;\qedsymbol&rbrace;&lbrace;\rule&lbrace;0.4em&rbrace;&lbrace;2ex&rbrace;&rbrace;
</pre></example>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1030"><r>package</r>, <code>amsthm</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1031"><code>amsthm</code> <r>package</r></indexterm></cindex>

<noindent></noindent>
<para>The <code>amsthm</code> package includes this command, with a somewhat
different-looking symbol.
</para>
<para>The mandatory arguments give the horizontal <var>width</var> and vertical
<var>thickness</var> of the rectangle.  They are rigid lengths
(<pxref label="Lengths"><xrefnodename>Lengths</xrefnodename></pxref>).  The optional argument <var>raise</var> 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.
</para>
<para>This produces a line, a rectangle that is wide but not tall.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\noindent\rule&lbrace;\textwidth&rbrace;&lbrace;0.4pt&rbrace;
</pre></example>

<noindent></noindent>
<para>The line is the width of the page and 0.4&nbsp;points tall.  This line
thickness is common in &latex;.
</para>
<para>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 label="_005cstrut"><xrefnodename>\strut</xrefnodename></xref>, for examples.
</para>

</section>
<node name="_005ctoday" spaces=" "><nodename>\today</nodename><nodeprev automatic="on">\rule</nodeprev><nodeup automatic="on">Special insertions</nodeup></node>
<section spaces=" "><sectiontitle><code>\today</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1117" mergedindex="cp">\today</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1032">date, today&textrsquo;s</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1033">today&textrsquo;s date</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\today
</pre></example>

<para>Produce today&textrsquo;s date in the format <samp><var>month</var> <var>dd</var>,
<var>yyyy</var></samp>.  An example of a date in that format is <samp>July 4,
1976</samp>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1034"><r>package</r>, <code>babel</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1035"><code>babel</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1036"><r>package</r>, <code>polyglossia</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1037"><code>polyglossia</code> <r>package</r></indexterm></cindex>

<para>Multilingual packages such as <code>babel</code> or <code>polyglossia</code>, or
classes such as <file>lettre</file>, will localize <code>\today</code>. For example,
the following will output <samp>4 juillet 1976</samp>:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\year=1976 \month=7 \day=4
\documentclass&lbrace;minimal&rbrace;
\usepackage[french]&lbrace;babel&rbrace;
\begin&lbrace;document&rbrace;
\today
\end&lbrace;document&rbrace;
</pre></example>

<noindent></noindent>
<para><code>\today</code> uses the counters <code>\day</code>, <code>\month</code>, and
<code>\year</code> (<pxref label="_005cday-_0026-_005cmonth-_0026-_005cyear"><xrefnodename>\day &amp; \month &amp; \year</xrefnodename></pxref>).
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1038"><r>package</r>, <code>datetime</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1039"><code>datetime</code> <r>package</r></indexterm></cindex>

<para>A number of package on CTAN work with dates.  One is <code>datetime</code> package
which can produce a wide variety of date formats, including ISO standards.
</para>
<para>The date is not updated as the &latex; process runs, so in principle the
date could be incorrect by the time the program finishes.
</para>

</section>
</chapter>
<node name="Splitting-the-input" spaces=" "><nodename>Splitting the input</nodename><nodenext automatic="on">Front/back matter</nodenext><nodeprev automatic="on">Special insertions</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Splitting the input</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1040">splitting the input file</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1041">input file</indexterm></cindex>

<para>&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.
</para>
<para>Regardless of how many separate files you use, there is always one
<cindex index="cp" spaces=" "><indexterm index="cp" number="1042">root file</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1043">file, root</indexterm></cindex>
<dfn>root file</dfn>, on which &latex; compilation starts.  This shows such
a file with five included files.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\documentclass&lbrace;book&rbrace;
\includeonly&lbrace;  % comment out lines below to omit compiling
  pref,
  chap1,
  chap2,
  append,
  bib
  &rbrace;
\begin&lbrace;document&rbrace;
\frontmatter
\include&lbrace;pref&rbrace; 
\mainmatter
\include&lbrace;chap1&rbrace; 
\include&lbrace;chap2&rbrace;
\appendix
\include&lbrace;append&rbrace;
\backmatter
\include&lbrace;bib&rbrace; 
\end&lbrace;document&rbrace;
</pre></example>

<noindent></noindent>
<para>This will bring in material from <file>pref.tex</file>, <file>chap1.tex</file>,
<file>chap2.tex</file>, <file>append.tex</file>, and <file>bib.tex</file>.  If you compile
this file, and then comment out all of the lines inside
<code>\includeonly&lbrace;...&rbrace;</code> except for <code>chap1</code>, 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</code> 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.
</para>
<para><xref label="Larger-book-template"><xrefnodename>Larger book template</xrefnodename></xref>, for another example of <code>\includeonly</code>.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::                 ">\endinput</menunode><menudescription><pre xml:space="preserve">Stop including material from a file.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::   ">\include &amp; \includeonly</menunode><menudescription><pre xml:space="preserve">Conditionally include files.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                    ">\input</menunode><menudescription><pre xml:space="preserve">Unconditionally include a file.
</pre></menudescription></menuentry></menu>



<node name="_005cendinput" spaces=" "><nodename>\endinput</nodename><nodenext automatic="on">\include &amp; \includeonly</nodenext><nodeup automatic="on">Splitting the input</nodeup></node>
<section spaces=" "><sectiontitle><code>\endinput</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1118" mergedindex="cp">\endinput</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\endinput
</pre></example>

<para>When you <code>\include&lbrace;filename&rbrace;</code>, inside <file>filename.tex</file> the
material after <code>\endinput</code> will not be included.  This command is
optional; if <file>filename.tex</file> has no <code>\endinput</code> then &latex;
will read all of the file.
</para>
<para>For example, suppose that a document&textrsquo;s root file has
<code>\input&lbrace;chap1&rbrace;</code> and this is <file>chap1.tex</file>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\chapter&lbrace;One&rbrace;
This material will appear in the document. 
\endinput
This will not appear.
</pre></example>

<para>This can be useful for putting documentation or comments at the end of a
file, or for avoiding junk characters that can be added if the file is
transmitted in the body of an email.  It is also useful for debugging:
one strategy to localize errors is to put <code>\endinput</code> halfway
through the included file and see if the error disappears.  Now, knowing
which half contains the error, moving <code>\endinput</code> to halfway
through that area further narrows down the location. This process
rapidly finds the offending line.
</para>
<para>After reading <code>\endinput</code>, &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...</code> with a
<code>\fi</code>.
</para>

</section>
<node name="_005cinclude-_0026-_005cincludeonly" spaces=" "><nodename>\include &amp; \includeonly</nodename><nodenext automatic="on">\input</nodenext><nodeprev automatic="on">\endinput</nodeprev><nodeup automatic="on">Splitting the input</nodeup></node>
<section spaces=" "><sectiontitle><code>\include</code> &amp; <code>\includeonly</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1119" mergedindex="cp">\include</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1120" mergedindex="cp">\includeonly</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\includeonly&lbrace;  % in document preamble
  ...
  <var>filename</var>,
  ...
  &rbrace;
  ...
\include&lbrace;<var>filename</var>&rbrace;  % in document body 
</pre></example>

<para>Bring material from the external file <file><var>filename</var>.tex</file> into a
&latex; document.
</para>
<para>The <code>\include</code> command does three things: it executes
<code>\clearpage</code> (<pxref label="_005cclearpage-_0026-_005ccleardoublepage"><xrefnodename>\clearpage &amp; \cleardoublepage</xrefnodename></pxref>), then it
inputs the material from <file><var>filename</var>.tex</file> into the document,
and then it does another <code>\clearpage</code>.  This command can only
appear in the document body. 
</para>
<para>The <code>\includeonly</code> command controls which files will be read by
&latex; under subsequent <code>\include</code> commands.  Its list of
filenames is comma-separated. It must appear in the preamble or even
earlier, e.g., the command line; it can&textrsquo;t appear in the document body.
</para>
<para>This example root document, <file>constitution.tex</file>, brings in
three files, <file>preamble.tex</file>, <file>articles.tex</file>, and
<file>amendments.tex</file>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\documentclass&lbrace;book&rbrace;
\includeonly&lbrace;
  preamble,
  articles,
  amendments
  &rbrace;
\begin&lbrace;document&rbrace;
\include&lbrace;preamble&rbrace;
\include&lbrace;articles&rbrace;
\include&lbrace;amendments&rbrace;
\end&lbrace;document&rbrace;
</pre></example>

<noindent></noindent>
<para>The file <file>preamble.tex</file> contains no special code; you have just
excerpted the chapter from <file>consitution.tex</file> and put it in a
separate file just for editing convenience.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\chapter&lbrace;Preamble&rbrace;
We the People of the United States,
in Order to form a more perfect Union, ...
</pre></example>

<noindent></noindent>
<para>Running &latex; on <file>constitution.tex</file> makes the material from the
three files appear in the document but also generates the auxiliary
files <file>preamble.aux</file>, <file>articles.aux</file>, and
<file>amendments.aux</file>. These contain information such as page numbers
and cross-references (<pxref label="Cross-references"><xrefnodename>Cross references</xrefnodename></pxref>).  If you now comment out
<code>\includeonly</code>&textrsquo;s lines with <code>preamble</code> and <code>amendments</code>
and run &latex; again then the resulting document shows only the
material from <file>articles.tex</file>, not the material from
<file>preamble.tex</file> or <file>amendments.tex</file>.  Nonetheless, all of the
auxiliary information from the omitted files is still there, including
the starting page number of the chapter.
</para>
<para>If the document preamble does not have <code>\includeonly</code> then
&latex; will include all the files you call for with <code>\include</code>
commands.
</para>
<para>The <code>\include</code> command makes a new page.  To avoid that, see
<ref label="_005cinput"><xrefnodename>\input</xrefnodename></ref> (which, however, does not retain the auxiliary
information).
</para>
<para><xref label="Larger-book-template"><xrefnodename>Larger book template</xrefnodename></xref>, for another example using <code>\include</code>
and <code>\includeonly</code>.  That example also uses <code>\input</code> for some
material that will not necessarily start on a new page.
</para>
<para>File names can involve paths.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\documentclass&lbrace;book&rbrace;
\includeonly&lbrace;
  chapters/chap1,
  &rbrace;
\begin&lbrace;document&rbrace;
\include&lbrace;chapters/chap1&rbrace;
\end&lbrace;document&rbrace;
</pre></example>

<para>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</samp>,
this works under &tex; Live on GNU/Linux:
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="1121" mergedindex="cp">\space</indexterm></findex>
<example endspaces=" ">
<pre xml:space="preserve">\documentclass&lbrace;book&rbrace;
\includeonly&lbrace;
  &quot;amo\space amas\space amat&quot;
  &rbrace;
\begin&lbrace;document&rbrace;
\include&lbrace;&quot;amo\space amas\space amat&quot;&rbrace;
\end&lbrace;document&rbrace;
</pre></example>

<para>and this works under MiK&tex; on Windows:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\documentclass&lbrace;book&rbrace;
\includeonly&lbrace;
  &lbrace;&quot;amo amas amat&quot;&rbrace;
  &rbrace;
\begin&lbrace;document&rbrace;
\include&lbrace;&lbrace;&quot;amo amas amat&quot;&rbrace;&rbrace;
\end&lbrace;document&rbrace;
</pre></example>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1044">nested <code>\include</code>, not allowed</indexterm></cindex>
<para>You cannot use <code>\include</code> inside a file that is being included or
you get <samp>LaTeX Error: \include cannot be nested.</samp>  The
<code>\include</code> command cannot appear in the document preamble; you will
get <samp>LaTeX Error: Missing \begin&lbrace;document&rbrace;</samp>.
</para>
<para>If a file that you <code>\include</code> does not exist, for instance if you
<code>\include&lbrace;athiesm&rbrace;</code> but you meant <code>\include&lbrace;atheism&rbrace;</code>,
then &latex; does not give you an error but will warn you <samp>No file
athiesm.tex.</samp>  (It will also create <file>athiesm.aux</file>.)
</para>
<para>If you <code>\include</code> the root file in itself then you first get
<samp>LaTeX Error: Can be used only in preamble.</samp>  Later runs get
<samp>TeX capacity exceeded, sorry [text input levels=15]</samp>.  To fix
this, you must remove the inclusion <code>\include&lbrace;<var>root</var>&rbrace;</code> but
also delete the file <file><var>root</var>.aux</file> and rerun &latex;.
</para>

</section>
<node name="_005cinput" spaces=" "><nodename>\input</nodename><nodeprev automatic="on">\include &amp; \includeonly</nodeprev><nodeup automatic="on">Splitting the input</nodeup></node>
<section spaces=" "><sectiontitle><code>\input</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1122" mergedindex="cp">\input</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\input&lbrace;<var>filename</var>&rbrace;
</pre></example>

<para>&latex; processes the file as if its contents were inserted in the
current file.  For a more sophisticated inclusion mechanism see
<ref label="_005cinclude-_0026-_005cincludeonly"><xrefnodename>\include &amp; \includeonly</xrefnodename></ref>.
</para>
<para>If <var>filename</var> does not end in <samp>.tex</samp> then &latex; first tries
the filename with that extension; this is the usual case.  If
<var>filename</var> ends with <samp>.tex</samp> then &latex; looks for the
filename as it is.
</para>
<para>For example, this
</para>
<example endspaces=" ">
<pre xml:space="preserve">\input&lbrace;macros&rbrace;
</pre></example>

<noindent></noindent>
<para>will cause &latex; to first look for <file>macros.tex</file>. 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</file> then
&latex; tries the name <file>macros</file>, without an extension. (This may
vary by distribution.)
</para>
<para>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</samp>,
this works under &tex; Live on GNU/Linux:
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="1123" mergedindex="cp">\space</indexterm></findex>
<example endspaces=" ">
<pre xml:space="preserve">\input&lbrace;&quot;amo\space amas\space amat&quot;&rbrace;
</pre></example>

<para>and this works under MiK&tex; on Windows:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\input&lbrace;&lbrace;&quot;amo amas amat&quot;&rbrace;&rbrace;
</pre></example>


</section>
</chapter>
<node name="Front_002fback-matter" spaces=" "><nodename>Front/back matter</nodename><nodenext automatic="on">Letters</nodenext><nodeprev automatic="on">Splitting the input</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Front/back matter</sectiontitle>

<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::  ">Table of contents etc.</menunode><menudescription><pre xml:space="preserve">Table of contents, list of figures, list of tables.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                  ">Indexes</menunode><menudescription><pre xml:space="preserve">Generate an index.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::               ">Glossaries</menunode><menudescription><pre xml:space="preserve">Generate a glossary.
</pre></menudescription></menuentry></menu>

<!-- c no comma in the node name because Texinfo doesn't support that well. -->
<node name="Table-of-contents-etc_002e" spaces=" "><nodename>Table of contents etc.</nodename><nodenext automatic="on">Indexes</nodenext><nodeup automatic="on">Front/back matter</nodeup></node>
<section spaces=" "><sectiontitle>Table of contents, list of figures, list of tables</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1045">table of contents, creating</indexterm></cindex>

<findex index="fn" spaces=" "><indexterm index="fn" number="1124" mergedindex="cp">\tableofcontents</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1125" mergedindex="cp">.toc <r>file</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1126" mergedindex="cp">\listoffigures</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1127" mergedindex="cp">\listoftables</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1128" mergedindex="cp">.lof <r>file</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1129" mergedindex="cp">.lot <r>file</r></indexterm></findex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\tableofcontents
\listoffigures
\listoftables
</pre></example>

<para>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</code>, etc.
</para>
<para>This example illustrates the first command, <code>\tableofcontents</code>.
&latex; will produce a table of contents on the book&textrsquo;s first page.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\documentclass&lbrace;book&rbrace;
% \setcounter&lbrace;tocdepth&rbrace;&lbrace;1&rbrace;
\begin&lbrace;document&rbrace;
\tableofcontents\newpage
  ...
\chapter&lbrace;...&rbrace;
  ...
\section&lbrace;...&rbrace;
  ...
\subsection&lbrace;...&rbrace;
  ...
\end&lbrace;document&rbrace;
</pre></example>

<noindent></noindent>
<para>Uncommenting the second line would cause that table to contain chapter
and section listings but not subsection listings, because the
<code>\section</code> command has level&nbsp;1.  <xref label="Sectioning"><xrefnodename>Sectioning</xrefnodename></xref>, for level
numbers of the sectioning units.  For more on the <code>tocdepth</code>
<pxref label="Sectioning_002ftocdepth"><xrefnodename>Sectioning/tocdepth</xrefnodename></pxref>.
</para>
<para>Another example of the use of <code>\tableofcontents</code> is in <ref label="Larger-book-template"><xrefnodename>Larger
book template</xrefnodename></ref>.
</para>
<para>If you want a page break after the table of contents, write a
<code>\newpage</code> command after the <code>\tableofcontents</code> command, as
above.
</para>
<para>To make the table of contents, &latex; stores the information in an
auxiliary file named <file><var>root-file</var>.toc</file> (<pxref label="Splitting-the-input"><xrefnodename>Splitting the
input</xrefnodename></pxref>).  For example, this &latex; file <file>test.tex</file>
</para>
<example endspaces=" ">
<pre xml:space="preserve">\documentclass&lbrace;article&rbrace;
\begin&lbrace;document&rbrace;
\tableofcontents\newpage
\section&lbrace;First section&rbrace;
\subsection&lbrace;First subsection&rbrace;
  ...
</pre></example>

<noindent></noindent>
<para>writes these lines to <file>test.toc</file>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\contentsline &lbrace;section&rbrace;&lbrace;\numberline &lbrace;1&rbrace;First section&rbrace;&lbrace;2&rbrace;
\contentsline &lbrace;subsection&rbrace;&lbrace;\numberline &lbrace;1.1&rbrace;First subsection&rbrace;&lbrace;2&rbrace;
</pre></example>

<findex index="fn" spaces=" "><indexterm index="fn" number="1130" mergedindex="cp">\contentsline</indexterm></findex>
<noindent></noindent>
<para>Each line contains a single command, <code>\contentsline</code>
(<pxref label="_005ccontentsline"><xrefnodename>\contentsline</xrefnodename></pxref>).  The first argument, the <code>section</code> or
<code>subsection</code>, is the sectioning unit.  The second argument has two
components.  The hook <code>\numberline</code> determines how the sectioning
number, <code>1</code> or <code>1.1</code>, appears in the table of contents
(<pxref label="_005cnumberline"><xrefnodename>\numberline</xrefnodename></pxref>).  The remainder of the second argument of
<code>\contentsline</code>, <samp>First section</samp> or <samp>First subsection</samp>,
is the sectioning title text.  Finally, the third argument, <samp>2</samp>, is
the page number on which this sectioning unit starts.
</para>
<para>To typeset these lines, the document class provides
<code>\l&arobase;<var>section-unit</var></code> commands such as
<code>\l&arobase;section&lbrace;<var>text</var>&rbrace;&lbrace;<var>pagenumber</var>&rbrace;</code> and
<code>\l&arobase;subsection&lbrace;<var>text</var>&rbrace;&lbrace;<var>pagenumber</var>&rbrace;</code>.  These commands
often use the <code>\&arobase;dottedtocline</code> command
(<pxref label="_005c_0040dottedtocline"><xrefnodename>\&arobase;dottedtocline</xrefnodename></pxref>).
</para>
<para>A consequence of &latex;&textrsquo;s strategy of using auxiliary files is that to
get the correct information in the document you must run &latex; twice,
once to store the information and the second time to retrieve it.  In
the ordinary course of writing a document authors run &latex; a number
of times, but you may notice that the first time that you compile a new
document, the table of contents page will be empty except for its
<samp>Contents</samp> header.  Just run &latex; again.
</para>
<para>The commands <code>\listoffigures</code> and <code>\listoftables</code> produce a
list of figures and a list of tables.  Their information is stored in
files with extension <file>.lof</file> and <file>.lot</file>. They work the same way
as <code>\tableofcontents</code> but the latter is more common, so we use it
for most examples.
</para>
<para>You can manually add material to the table of contents, the list of
figures, and the list of tables.  For instance, add a line about a
section to the table of contents with
<code>\addcontentsline&lbrace;toc&rbrace;&lbrace;section&rbrace;&lbrace;<var>text</var>&rbrace;</code>.
(<pxref label="_005caddcontentsline"><xrefnodename>\addcontentsline</xrefnodename></pxref>).  Add arbitrary material, that is, non-line
material, with <code>\addtocontents</code>, as with the command
<code>\addtocontents&lbrace;lof&rbrace;&lbrace;\protect\vspace&lbrace;2ex&rbrace;&rbrace;</code>, which adds
vertical space to the list of figures (<pxref label="_005caddtocontents"><xrefnodename>\addtocontents</xrefnodename></pxref>).
</para>
<para>Lines in the table of contents, the list of figures, and the list of
tables, have four parts.  First is an indent.  Next is a box into which
sectioning numbers are placed, and then the third box holds the title
text, such as <samp>First section</samp>.  Finally there is a box up against
the right margin, inside of which &latex; puts the page number box.
For the indent and the width of the number box,
<pxref label="_005c_0040dottedtocline"><xrefnodename>\&arobase;dottedtocline</xrefnodename></pxref>.  The right margin box has width
<code>\&arobase;tocrmarg</code> and the page number is flush right in that space,
inside a box of width <code>\&arobase;pnumwidth</code>.  By default
<code>\&arobase;tocrmarg</code> is <code>2.55em</code> and <code>\&arobase;pnumwidth</code> is
<code>1.55em</code>.  Change these as with
<code>\renewcommand&lbrace;\&arobase;tocrmarg&rbrace;&lbrace;3.5em&rbrace;</code>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1046"><r>package</r>, <code>tocloft</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1047"><code>tocloft</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1048"><r>package</r>, <code>tocbibbind</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1049"><code>tocbibbind</code> <r>package</r></indexterm></cindex>

<para>CTAN has many packages for the table of contents and lists of figures
and tables (<pxref label="CTAN"><xrefnodename>CTAN</xrefnodename></pxref>).  The package <code>tocloft</code> is convenient for
adjusting some aspects of the default such as spacing.  And,
<code>tocbibbind</code> will automatically add the bibliography, index,
etc. to the table of contents.
</para>
<para>To change the header for the table of contents page, do something like
these commands before you call <code>\tableofcontents</code>, etc.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\renewcommand&lbrace;\contentsname&rbrace;&lbrace;Table of Contents&rbrace;
\renewcommand&lbrace;\listfigurename&rbrace;&lbrace;Plots&rbrace;
\renewcommand&lbrace;\listtablename&rbrace;&lbrace;Specifications&rbrace;
</pre></example>

<noindent></noindent>
<para><cindex index="cp" spaces=" "><indexterm index="cp" number="1050"><r>package</r>, <code>babel</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1051"><code>babel</code> <r>package</r></indexterm></cindex>
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1052"><r>package</r>, <code>polyglossia</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1053"><code>polyglossia</code> <r>package</r></indexterm></cindex>

<para>Internationalization packages such as <code>babel</code> or <code>polyglossia</code>
will change these headers depending on the chosen base language.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::    ">\&arobase;dottedtocline</menunode><menudescription><pre xml:space="preserve">Format entry line in table of contents, etc.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::    ">\addcontentsline</menunode><menudescription><pre xml:space="preserve">Add an entry to table of contents, etc.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::      ">\addtocontents</menunode><menudescription><pre xml:space="preserve">Add text directly to table of contents file, etc.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::       ">\contentsline</menunode><menudescription><pre xml:space="preserve">Set line in table of contents, etc.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::            ">\nofiles</menunode><menudescription><pre xml:space="preserve">Prevent writing to auxiliary files.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::         ">\numberline</menunode><menudescription><pre xml:space="preserve">Put its number argument flush left in a box.
</pre></menudescription></menuentry></menu>


<node name="_005c_0040dottedtocline" spaces=" "><nodename>\&arobase;dottedtocline</nodename><nodenext automatic="on">\addcontentsline</nodenext><nodeup automatic="on">Table of contents etc.</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\&arobase;dottedtocline</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1131" mergedindex="cp">\&arobase;dottedtocline</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1054">table of contents entry, create dotted line</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\&arobase;dottedtocline&lbrace;<var>section-level-num</var>&rbrace;&lbrace;<var>indent</var>&rbrace;&lbrace;<var>numwidth</var>&rbrace;&lbrace;<var>text</var>&rbrace;&lbrace;<var>pagenumber</var>&rbrace;
</pre></example>

<para>Used internally by &latex; to format an entry line in the table of
contents, list of figures, or list of tables.  Authors do not directly
enter <code>\&arobase;dottedtocline</code> commands.
</para>
<para>This command is typically used by <code>\l&arobase;section</code>, <code>\l&arobase;subsection</code>,
etc., to format the content lines.  For example, the <file>article.cls</file>
file contains these definitions:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcommand*\l&arobase;section&lbrace;\&arobase;dottedtocline&lbrace;1&rbrace;&lbrace;1.5em&rbrace;&lbrace;2.3em&rbrace;&rbrace;
\newcommand*\l&arobase;subsection&lbrace;\&arobase;dottedtocline&lbrace;2&rbrace;&lbrace;3.8em&rbrace;&lbrace;3.2em&rbrace;&rbrace;
\newcommand*\l&arobase;subsubsection&lbrace;\&arobase;dottedtocline&lbrace;3&rbrace;&lbrace;7.0em&rbrace;&lbrace;4.1em&rbrace;&rbrace;
</pre></example>

<noindent></noindent>
<para>In this example, <code>\&arobase;dottedcline</code> appears to have been given only
three arguments.  But tracing the internal code shows that it picks up
the final <var>text</var> and <var>pagenumber</var> arguments in the synopsis
from a call to <code>\contentsline</code> (<pxref label="_005ccontentsline"><xrefnodename>\contentsline</xrefnodename></pxref>).
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1055">leaders, dots in table of contents</indexterm></cindex>
<para>Between the box for the title text of a section and the right margin
box, these <code>\&arobase;dottedtocline</code> commands insert <dfn>leaders</dfn>, that
is, evenly-spaced dots.  The dot-to-dot space is given by the command
<code>\&arobase;dotsep</code>.  By default it is 4.5 (it is in math units, aka.&noeos;
<code>mu</code>, which are <code>1/18</code>&nbsp;em.  Change it using
<code>\renewcommand</code>, as in <code>\renewcommand&lbrace;\&arobase;dotsep&rbrace;&lbrace;3.5&rbrace;</code>.
</para>
<para>In the standard <file>book</file> class, &latex; does not use dotted leaders
for the Part and Chapter table entries, and in the standard
<file>article</file> class it does not use dotted leaders for Section entries.
</para>

</subsection>
<node name="_005caddcontentsline" spaces=" "><nodename>\addcontentsline</nodename><nodenext automatic="on">\addtocontents</nodenext><nodeprev automatic="on">\&arobase;dottedtocline</nodeprev><nodeup automatic="on">Table of contents etc.</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\addcontentsline</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1132" mergedindex="cp">\addcontentsline</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1056">table of contents entry, manually adding</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\addcontentsline&lbrace;<var>ext</var>&rbrace;&lbrace;<var>unit</var>&rbrace;&lbrace;<var>text</var>&rbrace;
</pre></example>

<findex index="fn" spaces=" "><indexterm index="fn" number="1133" mergedindex="cp">\contentsline</indexterm></findex>
<para>Add an entry to the auxiliary file with extension <var>ext</var>.
</para>
<para>The following will result in an <samp>Appendices</samp> line in the table of
contents.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\addcontentsline&lbrace;toc&rbrace;&lbrace;section&rbrace;&lbrace;\protect\textbf&lbrace;Appendices&rbrace;&rbrace;
</pre></example>

<noindent></noindent>
<para>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 the command appears in the input file.
</para>
<para>The <code>\addcontentsline</code> command writes information to the file
<file><var>root-name</var>.<var>ext</var></file>, where <var>root-name</var> is the file name
of the root file (<pxref label="Splitting-the-input"><xrefnodename>Splitting the input</xrefnodename></pxref>).  It writes that
information as the text of the command
<code>\contentsline&lbrace;<var>unit</var>&rbrace;&lbrace;<var>text</var>&rbrace;&lbrace;<var>num</var>&rbrace;</code>, where
<code><var>num</var></code> is the current value of counter <code><var>unit</var></code>
(<pxref label="_005ccontentsline"><xrefnodename>\contentsline</xrefnodename></pxref>).  The most common case is the table of contents
and there <var>num</var> is the page number of the first page of <var>unit</var>.
</para>
<para>This command is invoked by the sectioning commands <code>\chapter</code>,
etc. (<pxref label="Sectioning"><xrefnodename>Sectioning</xrefnodename></pxref>), and also by <code>\caption</code> inside a float
environment (<pxref label="Floats"><xrefnodename>Floats</xrefnodename></pxref>).  But it is also directly used by authors.
For example, an author writing a book whose style is to have an
unnumbered preface may use the starred <code>\chapter*</code>.  But that
command leaves out table of contents information, which can be entered
manually, as here.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\chapter*&lbrace;Preface&rbrace;
\addcontentsline&lbrace;toc&rbrace;&lbrace;chapter&rbrace;&lbrace;\protect\numberline&lbrace;&rbrace;Preface&rbrace;
</pre></example>

<noindent></noindent>
<para>In the <file><var>root-name</var>.toc</file> file &latex; will put the line
<code>\contentsline &lbrace;chapter&rbrace;&lbrace;\numberline &lbrace;&rbrace;Preface&rbrace;&lbrace;3&rbrace;</code>; note
that the page number <samp>3</samp> is automatically generated by the system,
not entered manually.
</para>
<para>All of the arguments for <code>\addcontentsline</code> are required.
</para>
<table commandarg="var" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="var">ext</itemformat></item>
</tableterm><tableitem><para>Typically one of the strings <code>toc</code> for the table of contents,
<code>lof</code> for the list of figures, or <code>lot</code> for the list of
tables. The filename extension of the information file.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">unit</itemformat></item>
</tableterm><tableitem><para>A string that depends on the value of the <var>ext</var> argument, typically
one of:
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code">toc</itemformat></item>
</tableterm><tableitem><para>For the table of contents, this is the name of a sectional unit:
<code>part</code>, <code>chapter</code>, <code>section</code>, <code>subsection</code>, etc.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">lof</itemformat></item>
</tableterm><tableitem><para>For the list of figures: <code>figure</code>.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">lot</itemformat></item>
</tableterm><tableitem><para>For the list of tables: <code>table</code>.
</para></tableitem></tableentry></table>

</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">text</itemformat></item>
</tableterm><tableitem><para>The text of the entry.  You must <code>\protect</code> any fragile commands
(<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>) used in it.
</para></tableitem></tableentry></table>

<para>The <code>\addcontentsline</code> command has an interaction with
<code>\include</code> (<pxref label="_005cinclude-_0026-_005cincludeonly"><xrefnodename>\include &amp; \includeonly</xrefnodename></pxref>). If you use them at
the same level, as with
<code>\addcontentsline&lbrace;...&rbrace;&lbrace;...&rbrace;&lbrace;...&rbrace;\include&lbrace;...&rbrace;</code> then lines
in the table of contents can come out in the wrong order.  The solution
is to move <code>\addcontentsline</code> into the file being included.
</para>
<para>If you use a <var>unit</var> that &latex; does not recognize, as with the
typo here
</para>
<example endspaces=" ">
<pre xml:space="preserve">\addcontentsline&lbrace;toc&rbrace;&lbrace;setcion&rbrace;&lbrace;\protect\textbf&lbrace;Appendices&rbrace;&rbrace;
</pre></example>

<noindent></noindent>
<para>then you don&textrsquo;t get an error but the formatting in the table of contents
will not make sense.
</para>

</subsection>
<node name="_005caddtocontents" spaces=" "><nodename>\addtocontents</nodename><nodenext automatic="on">\contentsline</nodenext><nodeprev automatic="on">\addcontentsline</nodeprev><nodeup automatic="on">Table of contents etc.</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\addtocontents</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1134" mergedindex="cp">\addtocontents&lbrace;<var>ext</var>&rbrace;&lbrace;<var>text</var>&rbrace;</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\addtocontents&lbrace;<var>ext</var>&rbrace;&lbrace;<var>text</var>&rbrace;
</pre></example>

<para>Add <var>text</var>, which may be text or formatting commands, directly to
the auxiliary file with extension <var>ext</var>.  This is most commonly used
for the table of contents so that is the discussion here, but it also
applies to the list of figures and list of tables.
</para>
<para>This will put some vertical space in the table of contents after the
<samp>Contents</samp> header.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\tableofcontents\newpage
\addtocontents&lbrace;toc&rbrace;&lbrace;\protect\vspace*&lbrace;3ex&rbrace;&rbrace;
</pre></example>

<noindent></noindent>
<para>This puts the word <samp>Page</samp>, in boldface, above the column of page
numbers and after the header.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\tableofcontents
\addtocontents&lbrace;toc&rbrace;&lbrace;~\hfill\textbf&lbrace;Page&rbrace;\par&rbrace;
\chapter&lbrace;...&rbrace;
</pre></example>

<noindent></noindent>
<para>This adds a line announcing work by a new author.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\addtocontents&lbrace;toc&rbrace;&lbrace;%
  \protect\vspace&lbrace;2ex&rbrace;
  \textbf&lbrace;Chapters by N. Other Author&rbrace;\par&rbrace;
</pre></example>

<para>The difference between <code>\addtocontents</code> and <code>\addcontentsline</code>
is that the latter is strictly for lines, such as with a line giving the
page number for the start of a new subset of the chapters.  As the above
examples show, <code>\addtocontents</code> is for material such as spacing.
</para>
<para>The <code>\addtocontents</code> command has two arguments.  Both are
required.
</para>
<table commandarg="var" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="var">ext</itemformat></item>
</tableterm><tableitem><para>Typically one of: <file>toc</file> for the table of contents, <file>lof</file> for
the list of figures, or <file>lot</file> for the list of tables.  The
extension of the file holding the information.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="var">text</itemformat></item>
</tableterm><tableitem><para>The text, and possibly commands, to be written.
</para></tableitem></tableentry></table>

<para>The sectioning commands such as <code>\chapter</code> use the
<code>\addcontentsline</code> command to store information.  This command
creates lines in the <file>.toc</file> auxiliary file containing the
<code>\contentsline</code> command (<pxref label="_005caddcontentsline"><xrefnodename>\addcontentsline</xrefnodename></pxref>).  In contrast,
the command <code>\addtocontents</code> puts material directly in that file.
</para>
<para>The <code>\addtocontents</code> command has an interaction with
<code>\include</code> (<pxref label="_005cinclude-_0026-_005cincludeonly"><xrefnodename>\include &amp; \includeonly</xrefnodename></pxref>). If you use them at
the same level, as with
<code>\addtocontents&lbrace;...&rbrace;&lbrace;...&rbrace;\include&lbrace;...&rbrace;</code> then lines in the
table of contents can come out in the wrong order.  The solution is to
move <code>\addtocontents</code> into the file being included.
</para>

</subsection>
<node name="_005ccontentsline" spaces=" "><nodename>\contentsline</nodename><nodenext automatic="on">\nofiles</nodenext><nodeprev automatic="on">\addtocontents</nodeprev><nodeup automatic="on">Table of contents etc.</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\contentsline</code></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1057">table of contents</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1135" mergedindex="cp">\contentsline</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1136" mergedindex="cp">\tableofcontents</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1137" mergedindex="cp">.toc <r>file</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1138" mergedindex="cp">\listoffigures</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1139" mergedindex="cp">\listoftables</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1140" mergedindex="cp">.lof <r>file</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1141" mergedindex="cp">.lot <r>file</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1142" mergedindex="cp">\l&arobase;chapter</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1143" mergedindex="cp">\l&arobase;section</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1144" mergedindex="cp">\l&arobase;subsection</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\contentsline&lbrace;<var>unit</var>&rbrace;&lbrace;<var>text</var>&rbrace;&lbrace;<var>pagenumber</var>&rbrace;
</pre></example>

<para>Used internally by &latex; to typeset an entry of the table of
contents, list of figures, or list of tables (<pxref label="Table-of-contents-etc_002e"><xrefnodename>Table of contents
etc.</xrefnodename></pxref>). Authors do not directly enter <code>\contentsline</code> commands.
</para>
<para>Usually adding material to these lists is done automatically by the
commands <code>\chapter</code>, <code>\section</code>, etc. for the table of
contents, or by the <code>\caption</code> command inside of a <code>\figure</code>
or <code>\table</code> environment (<pxref label="figure"><xrefnodename>figure</xrefnodename></pxref> and <pxref label="table"><xrefnodename>table</xrefnodename></pxref>).  Thus,
where the root file is <file>thesis.tex</file>, and contains the declaration
<code>\tableofcontents</code>, the command <code>\chapter&lbrace;Chapter One&rbrace;</code>
produces something like this in the file <file>thesis.toc</file>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\contentsline &lbrace;chapter&rbrace;&lbrace;\numberline &lbrace;1&rbrace;Chapter One&rbrace;&lbrace;3&rbrace;
</pre></example>

<para>If the file contains the declaration <code>\listoffigures</code> then a figure
environment involving <code>\caption&lbrace;Test&rbrace;</code> will produce
something like this in <file>thesis.lof</file>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\contentsline &lbrace;figure&rbrace;&lbrace;\numberline &lbrace;1.1&rbrace;&lbrace;\ignorespaces Test&rbrace;&rbrace;&lbrace;6&rbrace;
</pre></example>

<para>To manually add material, use
<code>\addcontentsline&lbrace;<var>filetype</var>&rbrace;&lbrace;<var>unit</var>&rbrace;&lbrace;<var>text</var>&rbrace;</code>,
where <var>filetype</var> is <code>toc</code>, <code>lof</code>, or <code>lot</code>
(<pxref label="_005caddcontentsline"><xrefnodename>\addcontentsline</xrefnodename></pxref>).  
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1058"><r>package</r>, <code>tocloft</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1059"><code>tocloft</code> <r>package</r></indexterm></cindex>

<para>For manipulating how the <code>\contentline</code> material is typeset, see
the <code>tocloft</code> package.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1060"><r>package</r>, <code>hyperref</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1061"><code>hyperref</code> <r>package</r></indexterm></cindex>

<para>Note that the <code>hyperref</code> package changes the definition of
<code>\contentsline</code> (and <code>\addcontentsline</code>) to add more
arguments, to make hyperlinks.  This is the source of the error
<code>Argument of \contentsline has an extra &rbrace;</code> when one adds/remove
the use of package <code>hyperref</code> and a compilation was already run.
Fix this error by deleting the <file>.toc</file> or <file>.lof</file> or <file>.lot</file>
file, and running &latex; again.
</para>

</subsection>
<node name="_005cnofiles" spaces=" "><nodename>\nofiles</nodename><nodenext automatic="on">\numberline</nodenext><nodeprev automatic="on">\contentsline</nodeprev><nodeup automatic="on">Table of contents etc.</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\nofiles</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1145" mergedindex="cp">\nofiles</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\nofiles
</pre></example>

<para>Prevent &latex; from writing any auxiliary files.  The only output will
be the <file>.log</file> and <file>.pdf</file> (or <file>.dvi</file>) files.  This command
must go in the preamble.
</para>
<para>Because of the <code>\nofiles</code> command this example will not produce a
<file>.toc</file> file.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\documentclass&lbrace;book&rbrace;
\nofiles
\begin&lbrace;document&rbrace;
\tableofcontents\newpage
\chapter&lbrace;...&rbrace;
  ...
</pre></example>

<noindent></noindent>
<para>&latex; will not erase any existing auxiliary files, so if you insert
the <code>\nofiles</code> command after you have run the file and gotten
a <file>.toc</file> then the table of contents page will continue to show
the old information.
</para>

</subsection>
<node name="_005cnumberline" spaces=" "><nodename>\numberline</nodename><nodeprev automatic="on">\nofiles</nodeprev><nodeup automatic="on">Table of contents etc.</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\numberline</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1146" mergedindex="cp">\numberline</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\numberline&lbrace;<var>number</var>&rbrace;
</pre></example>

<para>Typeset its argument flush left in a box.  This is used in a
<code>\contentsline</code> command to typeset the section number
(<pxref label="_005ccontentsline"><xrefnodename>\contentsline</xrefnodename></pxref>).
</para>
<para>For example, this line in a <file>.toc</file> file causes the <code>1.1</code> to be
typeset flush left.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\contentsline &lbrace;subsection&rbrace;&lbrace;\numberline &lbrace;1.1&rbrace;Motivation&rbrace;&lbrace;2&rbrace;
</pre></example>

<para>By default, &latex; typesets the section numbers in a box of length
<code>\&arobase;tempdima</code>.  That length is set by the commands
<code>\l&arobase;section</code>, <code>\l&arobase;subsection</code>, etc.  Put section numbers
inside a natural-width box with
<code>\renewcommand&lbrace;\numberline&rbrace;[1]&lbrace;#1~&rbrace;</code> before
<code>\tableofcontents</code>.
</para>
<para>This command is fragile so you may need to precede it with
<code>\protect</code> (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).  An example is the use of
<code>\protect</code> in this command,
</para>
<example endspaces=" ">
<pre xml:space="preserve"><code>\addcontentsline&lbrace;toc&rbrace;&lbrace;section&rbrace;&lbrace;\protect\numberline&lbrace;&rbrace;Summary&rbrace;</code>
</pre></example>

<noindent></noindent>
<para>to get the <code>\numberline</code> into the <code>\contentsline</code>
command in the <file>.toc</file> file: <code>\contentsline
&lbrace;section&rbrace;&lbrace;\numberline &lbrace;&rbrace;Summary&rbrace;&lbrace;6&rbrace;</code> (the page number <samp>6</samp>
is automatically added by &latex;; <pxref label="_005caddcontentsline"><xrefnodename>\addcontentsline</xrefnodename></pxref>).
</para>

</subsection>
</section>
<node name="Indexes" spaces=" "><nodename>Indexes</nodename><nodenext automatic="on">Glossaries</nodenext><nodeprev automatic="on">Table of contents etc.</nodeprev><nodeup automatic="on">Front/back matter</nodeup></node>
<section spaces=" "><sectiontitle>Indexes</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1062">indexes</indexterm></cindex>

<findex index="fn" spaces=" "><indexterm index="fn" number="1147" mergedindex="cp">\makeindex</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1148" mergedindex="cp">\index</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1063"><file>.idx</file> file</indexterm></cindex>

<para>If you tell &latex; what terms you want to appear in an index then it
can produce that index, alphabetized and with the page numbers
automatically maintained.  This illustrates the basics.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\documentclass&lbrace;article&rbrace;
\usepackage&lbrace;makeidx&rbrace;  % Provide indexing commands
  \makeindex
% \usepackage&lbrace;showidx&rbrace;  % Show marginal notes of index entries
  ...
\begin&lbrace;document&rbrace;
  ...
Wilson's Theorem\index&lbrace;Wilson's Theorem&rbrace;
says that a number $n&gt;1$ is prime if and only if the factorial
of $n-1$ is congruent to $-1$
modulo~$n$.\index&lbrace;congruence!and Wilson's Theorem&rbrace;
  ...
\printindex
\end&lbrace;document&rbrace;
</pre></example>

<noindent></noindent>
<para>As that shows, declare index entries with the <code>\index</code> command
(<pxref label="_005cindex"><xrefnodename>\index</xrefnodename></pxref>).  When you run &latex;, the <code>\index</code> writes its
information, such as <samp>Wilson's Theorem</samp> and the page number, to an
auxiliary file whose name ends in <file>.idx</file>.  Next, to alphabetize and
do other manipulations, run an external command, typically
<command>makeindex</command> (<pxref label="makeindex"><xrefnodename>makeindex</xrefnodename></pxref>), which writes a file whose name
ends in <file>.ind</file>.  Finally, <code>\printindex</code> brings this
manipulated information into the output (<pxref label="_005cprintindex"><xrefnodename>\printindex</xrefnodename></pxref>).
</para>
<para>Thus, if the above example is in the file <file>numth.tex</file> then running
<samp>pdflatex numth</samp> will save index entry and page number information
to <file>numth.idx</file>.  Then running <samp>makeindex numth</samp> will
alphabetize and save the results to <file>numth.ind</file>. Finally, again
running <samp>pdflatex numth</samp> will show the desired index, at the place
where the <code>\printindex</code> command is in the source file.
</para>
<para>There are many options for the output.  An example is that the
exclamation point in <code>\index&lbrace;congruence!and Wilson's Theorem&rbrace;</code>
produces a main entry of <samp>congruence</samp> with a subentry of <samp>and
Wilson's Theorem</samp>.  For more, <pxref label="makeindex"><xrefnodename>makeindex</xrefnodename></pxref>.
</para>
<para>The <code>\makeindex</code> and <code>\printindex</code> commands are independent.
Leaving out the <code>\makeindex</code> will stop &latex; from saving the
index entries to the auxiliary file.  Leaving out the <code>\printindex</code>
will cause &latex; to not show the index in the document output.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1064"><r>package</r>, <code>showidx</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1065"><code>showidx</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1066"><r>package</r>, <code>multind</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1067"><code>multind</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1068">index, multiple</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1069">multiple indexes</indexterm></cindex>
<para>There are many packages in the area of indexing.  The <code>showidx</code>
package causes each index entries to be shown in the margin on the
page where the <code>\index</code> appears.  This can help in preparing the index.
The <code>multind</code> package, among others, supports multiple indexes.
See also the &tex; FAQ entry on this topic,
<url><urefurl>https://www.texfaq.org/FAQ-multind</urefurl></url>, and the CTAN topic,
<url><urefurl>https://ctan.org/topic/index-multi</urefurl></url>.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::   ">Produce the index manually</menunode><menudescription><pre xml:space="preserve">Alphabetize entries yourself.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::        ">\index</menunode><menudescription><pre xml:space="preserve">Declare an index entry.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::     ">makeindex</menunode><menudescription><pre xml:space="preserve">Alphabetize index entries automatically.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::   ">\printindex</menunode><menudescription><pre xml:space="preserve">Put the index here.
</pre></menudescription></menuentry></menu>


<node name="Produce-the-index-manually" spaces=" "><nodename>Produce the index manually</nodename><nodenext automatic="on">\index</nodenext><nodeup automatic="on">Indexes</nodeup></node>
<subsection spaces=" "><sectiontitle>Produce the index manually</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1070">index, producing manually</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1149" mergedindex="cp">theindex</indexterm></findex>

<para>Documents that are small and static can have a manually produced index.
This will make a separate page labeled <samp>Index</samp>, in twocolumn
format.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="1150" mergedindex="cp"><r>environment</r>, <code>theindex</code></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1151" mergedindex="cp"><code>theindex</code> <r>environment</r></indexterm></findex>
        
<example endspaces=" ">
<pre xml:space="preserve">\begin&lbrace;theindex&rbrace;
\item acorn squash, 1
\subitem maple baked, 2
\indexspace
\item bacon, 3
\subitem maple baked, 4
\end&lbrace;theindex&rbrace;
</pre></example>

<para>Note that the author must enter the page numbers, which is tedious and
which will result in wrong numbers if the document changes.  This is why
in most cases automated methods such as <command>makeindex</command> are best.
<xref label="Indexes"><xrefnodename>Indexes</xrefnodename></xref>.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="1152" mergedindex="cp">\item</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1153" mergedindex="cp">\subitem</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1154" mergedindex="cp">\subsubitem</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1155" mergedindex="cp">\indexspace</indexterm></findex>
<para>However we cover the commands for completeness, and because the
automated methods are based on these commands.  There are three levels
of entries.  As the example shows, a main entry uses <code>\item</code>,
subentries use <code>\subitem</code>, and the lowest level uses
<code>\subsubitem</code>.  Blank lines between entries have no effect.  The
example above includes <code>\indexspace</code> to produce vertical space in
the output that some index styles use before the first entry starting
with a new letter.
</para>

</subsection>
<node name="_005cindex" spaces=" "><nodename>\index</nodename><nodenext automatic="on">makeindex</nodenext><nodeprev automatic="on">Produce the index manually</nodeprev><nodeup automatic="on">Indexes</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\index</code></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1071">index entry</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1156" mergedindex="cp">\index</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\index&lbrace;<var>index-entry-string</var>&rbrace;
</pre></example>

<para>Declare an entry in the index.  This command is fragile
(<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).
</para>
<para>For example, as described in <ref label="Indexes"><xrefnodename>Indexes</xrefnodename></ref>, one way to get an index from
what&textrsquo;s below is to compile the document with <code>pdflatex test</code>, then
process the index entries with <code>makeindex test</code>, and then compile
again with <code>pdflatex test</code>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">% file test.tex
  ...
W~Ackermann (1896--1962).\index&lbrace;Ackermann&rbrace;
  ...
Ackermann function\index&lbrace;Ackermann!function&rbrace;
  ...
rate of growth\index&lbrace;Ackermann!function!growth rate&rbrace;
</pre></example>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1072">index entries, subentries</indexterm></cindex>
<noindent></noindent>
<para>All three index entries will get a page number, such as <samp>Ackermann,
22</samp>.  &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&lbrace;Ackermann!function!growth rate!comparison&rbrace;</code> then
<command>makeindex</command> says <samp>Scanning input file test.idx....done (4
entries accepted, 1 rejected)</samp> and the fourth level is silently missing
from the index.)
</para>
<para>If you enter a second <code>\index</code> with the same
<var>index-entry-string</var> 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&lbrace;Ackermann&rbrace;</code> later in the same
document as above will give an index entry like <samp>Ackermann, 22,
151</samp>.  Also, you can enter the index entries in any order, so for
instance <code>\index&lbrace;Ackermann!function&rbrace;</code> could come before
<code>\index&lbrace;Ackermann&rbrace;</code>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1073">index, page range</indexterm></cindex>
<para>Get a page range in the output, like <samp>Hilbert, 23--27</samp>, as here.
</para>
<example endspaces=" ">
<pre xml:space="preserve">W~Ackermann (1896--1962).\index&lbrace;Ackermann&rbrace;
  ...
D~Hilbert (1862--1943)\index&lbrace;Ackermann!Hilbert|(&rbrace;
  ...
disapproved of his marriage.\index&lbrace;Ackermann!Hilbert|)&rbrace;
</pre></example>

<noindent></noindent>
<para>If the beginning and ending of the page range are equal then the system
just gives a single page number, not a range.
</para>
<para>If you index subentries but not a main entry, as with
<code>\index&lbrace;Jones!program&rbrace;</code> and <code>\index&lbrace;Jones!results&rbrace;</code>, then
the output is the item <samp>Jones</samp> with no comma or page number,
followed by two subitems, like <samp>program, 50</samp> and <samp>results,
51</samp>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1074">see and see also index entries</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1075">index entries, &textlsquo;see&textrsquo; and &textlsquo;see also&textrsquo;</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1157" mergedindex="cp">\seename</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1158" mergedindex="cp">\alsoname</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1076"><r>package</r>, <code>babel</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1077"><code>babel</code> <r>package</r></indexterm></cindex>
 <cindex index="cp" spaces=" "><indexterm index="cp" number="1078"><r>package</r>, <code>polyglossia</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1079"><code>polyglossia</code> <r>package</r></indexterm></cindex>


<para>Generate a index entry that says <samp>see</samp> by using a vertical bar
character: <code>\index&lbrace;Ackermann!function|see&lbrace;P\'eter's
function&rbrace;&rbrace;</code>.  You can instead get <samp>see also</samp> with <code>seealso</code>.
(The text <samp>see</samp> is defined by <code>\seename</code>, and <samp>see also</samp>
by <code>\alsoname</code>.  You can redefine these either by using an
internationalization package such as <code>babel</code> or <code>polyglossia</code>,
or directly as with <code>\renewcommand&lbrace;\alsoname&rbrace;&lbrace;Also see&rbrace;</code>.)
</para>
<para>The <samp>see</samp> 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&lbrace;group|textit&rbrace;</code> (note the missing backslash on the
<code>\textit</code> command) and the system will apply that command to the
page number, here giving something like <code>\textit&lbrace;7&rbrace;</code>.  You can
define your own one-input commands, such as
<code>\newcommand&lbrace;\definedpage&rbrace;[1]&lbrace;&lbrace;\color&lbrace;blue&rbrace;#1&rbrace;&rbrace;</code> and then
<code>\index&lbrace;Ackermann!function|definedpage&rbrace;</code> will give a blue page
number (<pxref label="Color"><xrefnodename>Color</xrefnodename></pxref>).  Another, less practical, example is this,
</para>
<!-- c credit Ian Thompson https://tex.stackexchange.com/a/272572/121234 -->
<example endspaces=" ">
<pre xml:space="preserve">\newcommand\indexownpage[1]&lbrace;#1, \thepage&rbrace;
  ... Epimenides.\index&lbrace;self-reference|indexownpage&rbrace;
</pre></example>

<noindent></noindent>
<para>which creates an entry citing the page number of its own index listing.
</para>
<para>The two functions just described combine, as here
</para>
<example endspaces=" ">
<pre xml:space="preserve">\index&lbrace;Ackermann!function|(definedpage&rbrace;
  ...
\index&lbrace;Ackermann!function|)&rbrace;
</pre></example>

<noindent></noindent>
<para>which outputs an index entry like <samp>function, 23--27</samp> where the page
number range is in blue.
</para>
<para>Consider an index entry such as <samp><U>03B1</U>-ring</samp>.  Entering
it as <code>$\alpha$-ring</code> will cause it to be alphabetized according to
the dollar sign. You can instead enter it using an at-sign, as
<code>\index&lbrace;alpha-ring&arobase;$\alpha$-ring&rbrace;</code>.  If you specify an entry
with an at-sign separating two strings, <code><var>pos</var>&arobase;<var>text</var></code>,
then <var>pos</var> gives the alphabetical position of the entry while
<var>text</var> produces the text of the entry.  Another example is that
<code>\index&lbrace;Saint Michael's College&arobase;SMC&rbrace;</code> produces an index entry
<samp>SMC</samp> alphabetized into a different location than its spelling
would naturally give it.
</para>
<para>To put a <code>!</code>, or <code>&arobase;</code>, or <code>|</code>, or <code>&quot;</code> character in
an index entry, escape it by preceding it with a double quote, <code>&quot;</code>.
(The double quote gets deleted before alphabetization.)
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1080"><r>package</r>, <code>index</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1081"><code>index</code> <r>package</r></indexterm></cindex>

<para>A number of packages on CTAN have additional functionality beyond that
provided by <code>makeidx</code>.  One is <code>index</code>, which allows for
multiple indices and contains a command
<code>\index*&lbrace;<var>index-entry-string</var>&rbrace;</code> that prints the
<var>index-entry-string</var> as well as indexing it.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="1159" mergedindex="cp">\indexentry</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1082">idx file</indexterm></cindex>
<para>The <code>\index</code> command writes the indexing information to the file
<file><var>root-name</var>.idx</file> file.  Specifically, it writes text of the
command
<code>\indexentry&lbrace;<var>index-entry-string</var>&rbrace;&lbrace;<var>page-num</var>&rbrace;</code>,
where <var>page-num</var> is the value of the <code>\thepage</code> counter.  On
occasion, when the <code>\printindex</code> command is confused, you have to
delete this file to start with a fresh slate.
</para>
<para>If you omit the closing brace of an <code>\index</code> command then you get a
message like this.
</para>
<example endspaces=" ">
<pre xml:space="preserve">Runaway argument?  &lbrace;Ackermann!function
!  Paragraph ended before \&arobase;wrindex was complete.
</pre></example>


</subsection>
<node name="makeindex" spaces=" "><nodename>makeindex</nodename><nodenext automatic="on">\printindex</nodenext><nodeprev automatic="on">\index</nodeprev><nodeup automatic="on">Indexes</nodeup></node>
<subsection spaces=" "><sectiontitle><command>makeindex</command></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1083">index, processing</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1160" mergedindex="cp">makeindex, <r>program</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1084"><command>makeindex</command> program</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1085"><file>.ind</file> file</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1086"><file>.idx</file> file</indexterm></cindex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">makeindex <var>filename</var>
makeindex -s <var>style-file</var> <var>filename</var>
makeindex <var>options</var> <var>filename0</var> ...
</pre></example>

<para>Sort, and otherwise process, the index information in the auxiliary file
<var>filename</var>.  This is a command line program.  It takes one or more
raw index files, <file><var>filename</var>.idx</file> files, and produces the
actual index file, the <file><var>filename</var>.ind</file> file that is input by
<code>\printindex</code> (<pxref label="_005cprintindex"><xrefnodename>\printindex</xrefnodename></pxref>).
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1087"><file>.isty</file> file</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1161" mergedindex="cp">index, style file</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1162" mergedindex="cp">makeindex, style file</indexterm></findex>
<para>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</dfn>, a
<file>.isty</file> file.  The third form is the most general; see the full
documentation on CTAN.
</para>
<para>This is a simple <file>.isty</file> file.
</para>
<example endspaces=" ">
<pre xml:space="preserve">% book.isty 
%   $ makeindex -s book.isty -p odd book.idx
% creates the index as book.ind, starting on an odd page. 
preamble
&quot;\\pagestyle&lbrace;empty&rbrace;
\\small
\\begin&lbrace;theindex&rbrace;
\\thispagestyle&lbrace;empty&rbrace;&quot;

postamble
&quot;\n
\\end&lbrace;theindex&rbrace;&quot;
</pre></example>

<para>The description here covers only some of the index formatting
possibilities in <var>style-file</var>. For a full list see the documentation
on CTAN.
</para>
<para>A style file consists of a list of pairs: <var>specifier</var> and
<var>attribute</var>.  These can appear in the file in any order.  All of the
<var>attribute</var>s are strings, except where noted.  Strings are
surrounded with double quotes, <code>&quot;</code>, and the maximum length of a
string is 144 characters.  The <code>\n</code> is for a newline and <code>\t</code>
is for a tab.  Backslashes are escaped with another backslash,
<code>\\</code>.  If a line begins with a percent sign, <code>%</code>, then it is a
comment.
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<beforefirstitem><anchor name="makeindex-preamble">makeindex preamble</anchor>
</beforefirstitem><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1163" mergedindex="cp">preamble</indexterm>preamble</itemformat></item>
</tableterm><tableitem><para>Preamble of the output index file. Defines the context in which the index is
formatted.  Default: <code>&quot;\\begin&lbrace;theindex&rbrace;\n&quot;</code>.
</para>
<anchor name="makeindex-postamble">makeindex postamble</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1164" mergedindex="cp">postamble</indexterm>postamble</itemformat></item>
</tableterm><tableitem><para>Postamble of the output index file.  Default: <code>&quot;\n\n\\end&lbrace;theindex&rbrace;\n&quot;</code>.
</para>
<anchor name="makeindex-group-skip">makeindex group skip</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1165" mergedindex="cp">group_skip</indexterm>group_skip</itemformat></item>
</tableterm><tableitem><findex index="fn" spaces=" "><indexterm index="fn" number="1166" mergedindex="cp">\indexspace</indexterm></findex>
<para>Traditionally index items are broken into groups, typically a group for
entries starting with letter <samp>a</samp>, etc.  This specifier gives what
is inserted when a new group begins.  Default: <code>&quot;\n\n
\\indexspace\n&quot;</code> (<code>\indexspace</code> is a command inserting a rubber
length, by default <code>10pt plus5pt minus3pt</code>).
</para>
<anchor name="makeindex-letheadflag">makeindex letheadflag</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1167" mergedindex="cp">lethead_flag</indexterm>lethead_flag</itemformat></item>
</tableterm><tableitem><para>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</code> nothing
will be inserted before the group. If it is positive then at a new
letter the <code>lethead_prefix</code> and <code>lethead_suffix</code> 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&nbsp;0.
</para>
<anchor name="makeindex-lethead-prefix">makeindex lethead prefix</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1168" mergedindex="cp">lethead_prefix</indexterm>lethead_prefix</itemformat></item>
</tableterm><tableitem><para>If a new group begins with a different letter then this is the prefix
inserted before the new letter header.  Default: <code>&quot;&quot;</code>
</para>
<anchor name="makeindex-lethead-suffix">makeindex lethead suffix</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1169" mergedindex="cp">lethead_suffix</indexterm>lethead_suffix</itemformat></item>
</tableterm><tableitem><para>If a group begins with a different letter then this is the suffix
inserted after the new letter header.  Default: <code>&quot;&quot;</code>.
</para>
<anchor name="makeindex-item-0">makeindex item 0</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1170" mergedindex="cp">item_0</indexterm>item_0 </itemformat></item>
</tableterm><tableitem><para>What is put between two level&nbsp;0 items.  Default: <code>&quot;\n \\item
&quot;</code>.
</para>
<anchor name="makeindex-item-1">makeindex item 1</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1171" mergedindex="cp">item_1</indexterm>item_1</itemformat></item>
</tableterm><tableitem><para>Put between two level&nbsp;1 items.  Default: <code>&quot;\n \\subitem &quot;</code>.
</para>
<anchor name="makeindex-item-2">makeindex item 2</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1172" mergedindex="cp">item_2</indexterm>item_2</itemformat></item>
</tableterm><tableitem><para>put between two level&nbsp;2 items.  Default: <code>&quot;\n \\subsubitem &quot;</code>.
</para>
<anchor name="makeindex-item-01">makeindex item 01</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1173" mergedindex="cp">item_01</indexterm>item_01</itemformat></item>
</tableterm><tableitem><para>What is put between a level&nbsp;0 item and a level&nbsp;1 item.
Default: <code>&quot;\n \\subitem &quot;</code>.
</para>
<anchor name="makeindex-item-x1">makeindex item x1</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1174" mergedindex="cp">item_x1</indexterm>item_x1</itemformat></item>
</tableterm><tableitem><para>What is put between a level&nbsp;0 item and a level&nbsp;1 item in the
case that the level&nbsp;0 item doesn&textrsquo;t have any page numbers (as in
<code>\index&lbrace;aaa|see&lbrace;bbb&rbrace;&rbrace;</code>).  Default: <code>&quot;\n \\subitem &quot;</code>.
</para>
<anchor name="makeindex-item-12">makeindex item 12</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1175" mergedindex="cp">item_12</indexterm>item_12</itemformat></item>
</tableterm><tableitem><para>What is put between a level&nbsp;1 item and a level&nbsp;2 item.
Default: <code>&quot;\n \\subsubitem &quot;</code>.
</para>
<anchor name="makeindex-item-x2">makeindex item x2</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1176" mergedindex="cp">item_x2</indexterm>item_x2</itemformat></item>
</tableterm><tableitem><para>What is put between a level&nbsp;1 item and a level&nbsp;2 item, if the
level&nbsp;1 item doesn&textrsquo;t have page numbers.  Default: <code>&quot;\n
\\subsubitem &quot;</code>.
</para>
<anchor name="makeindex-delim-0">makeindex delim 0</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1177" mergedindex="cp">delim_0</indexterm>delim_0</itemformat></item>
</tableterm><tableitem><para>Delimiter put between a level&nbsp;0 key and its first page
number. Default: a comma followed by a blank, <code>&quot;, &quot;</code>.
</para>
<anchor name="makeindex-delim-1">makeindex delim 1</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1178" mergedindex="cp">delim_1</indexterm>delim_1</itemformat></item>
</tableterm><tableitem><para>Delimiter put between a level&nbsp;1 key and its first page
number. Default: a comma followed by a blank, <code>&quot;, &quot;</code>.
</para>
<anchor name="makeindex-delim-2">makeindex delim 2</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1179" mergedindex="cp">delim_2</indexterm>delim_2</itemformat></item>
</tableterm><tableitem><para>Delimiter between a level&nbsp;2 key and its first page number. Default:
a comma followed by a blank, <code>&quot;, &quot;</code>.
</para>
<anchor name="makeindex-delim-n">makeindex delim n</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1180" mergedindex="cp">delim_n</indexterm>delim_n</itemformat></item>
</tableterm><tableitem><para>Delimiter between two page numbers for the same key (at any
level). Default: a comma followed by a blank, <code>&quot;, &quot;</code>.
</para>
<anchor name="makeindex-delim-r">makeindex delim r</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1181" mergedindex="cp">delim_r</indexterm>delim_r</itemformat></item>
</tableterm><tableitem><para>What is put between the starting and ending page numbers of a range.
Default: <code>&quot;--&quot;</code>.
</para>
<anchor name="makeindex-line-max">makeindex line max</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1182" mergedindex="cp">line_max</indexterm>line_max</itemformat></item>
</tableterm><tableitem><para>An integer.  Maximum length of an index entry&textrsquo;s line in the output,
beyond which the line wraps.  Default: <code>72</code>.
</para>
<anchor name="makeindex-indent-space">makeindex indent space</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1183" mergedindex="cp">indent_space</indexterm>indent_space</itemformat></item>
</tableterm><tableitem><para>What is inserted at the start of a wrapped line.  Default:
<code>&quot;\t\t&quot;</code>.
</para>
<anchor name="makeindex-indent-length">makeindex indent length</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1184" mergedindex="cp">indent_length</indexterm>indent_length</itemformat></item>
</tableterm><tableitem><para>A number.  The length of the wrapped line indentation.  The default
<code>indent_space</code> is two tabs and each tab is eight spaces so the
default here is <code>16</code>.
</para>
<anchor name="makeindex-page-precedence">makeindex page precedence</anchor>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1185" mergedindex="cp">page_precedence</indexterm>page_precedence</itemformat></item>
</tableterm><tableitem><para>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> command supports
five different types of numerals: lowercase roman <code>r</code>, and numeric
or arabic <code>n</code>, and lowercase alphabetic <code>a</code>, and uppercase
roman <code>R</code>, and uppercase alphabetic <code>A</code>.  Default:
<code>&quot;rnaRA&quot;</code>.
</para>
</tableitem></tableentry></ftable>

<findex index="fn" spaces=" "><indexterm index="fn" number="1186" mergedindex="cp">xindy <r>program</r></indexterm></findex>
<para>There are a number of other programs that do the job
<command>makeindex</command> does. One is <command>xindy</command>
(<uref><urefurl>https://ctan.org/pkg/xindy</urefurl></uref>), which does internationalization and can
process indexes for documents marked up using &latex; and a number of
other languages. It is written in Lisp, highly configurable, both in
markup terms and in terms of the collating order of the text, as
described in its documentation.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="1187" mergedindex="cp">xindex <r>program</r></indexterm></findex>
<para>A more recent indexing program supporting Unicode is <code>xindex</code>,
written in Lua (<url><urefurl>https://ctan.org/pkg/xindex</urefurl></url>).
</para>

</subsection>
<node name="_005cprintindex" spaces=" "><nodename>\printindex</nodename><nodeprev automatic="on">makeindex</nodeprev><nodeup automatic="on">Indexes</nodeup></node>
<subsection spaces=" "><sectiontitle><command>\printindex</command></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1088">index, printing</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1188" mergedindex="cp">\printindex</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\printindex
</pre></example>

<para>Place the index into the output.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1089"><r>package</r>, <code>makeidx</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1090"><code>makeidx</code> <r>package</r></indexterm></cindex>

<para>To get an index you must first include
<code>\usepackage&lbrace;makeidx&rbrace;\makeindex</code> in the document preamble and
compile the document, then run the system command <command>makeindex</command>,
and then compile the document again.  <xref label="Indexes"><xrefnodename>Indexes</xrefnodename></xref>, for further
discussion and an example of the use of <code>\printindex</code>.
</para>

</subsection>
</section>
<node name="Glossaries" spaces=" "><nodename>Glossaries</nodename><nodeprev automatic="on">Indexes</nodeprev><nodeup automatic="on">Front/back matter</nodeup></node>
<section spaces=" "><sectiontitle>Glossaries</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1091">glossary</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1092">glossaries</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1093">acronyms, list of</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1189" mergedindex="cp">\makeglossary</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1190" mergedindex="cp">\printglossaries</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;glossaries&rbrace; \makeglossaries
  ...
\newglossaryentry&lbrace;<var>label</var>&rbrace;&lbrace;<var>settings</var>&rbrace;  
  ...
\gls&lbrace;<var>label</var>&rbrace;.  
  ...
\printglossaries
</pre></example>

<para>The <file>glossaries</file> package allows you to make glossaries, including
multiple glossaries, as well as lists of acronyms.
</para>
<para>To get the output from this example, compile the document (for instance
with <code>pdflatex filename</code>), then run the command line command
<code>makeglossaries filename</code>, and then compile the document again.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\documentclass&lbrace;...&rbrace;  
\usepackage&lbrace;glossaries&rbrace; \makeglossaries
\newglossaryentry&lbrace;tm&rbrace;&lbrace;%
  name=&lbrace;Turing machine&rbrace;,
  description=&lbrace;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.&rbrace;,
  &rbrace;  
\begin&lbrace;document&rbrace;  
Everything begins with the definition of a \gls&lbrace;tm&rbrace;.  
  ...
\printglossaries
\end&lbrace;document&rbrace;
</pre></example>

<noindent></noindent>
<para>That gives two things.  In the main text it outputs <samp>... definition
of a Turing machine</samp>.  In addition, in a separate sectional unit headed
<samp>Glossary</samp> there appears a description list.  In boldface it says
<samp>Turing machine</samp> and the rest of the item says in normal type
<samp>A model of a machine &dots; Computer Science</samp>.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="1191" mergedindex="cp">\makeglossary</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1192" mergedindex="cp">\printglossaries</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1094"><file>.glo</file> file</indexterm></cindex>
<para>The command <code>\makeglossary</code> opens the file that will contain the
entry information, <file><var>root-file</var>.glo</file>.  Put the
<code>\printglossaries</code> command where you want the glossaries to appear
in your document.
</para>
<para>The <file>glossaries</file> package is very powerful.  For instance, besides
the commands <code>\newglossaryentry</code> and <code>\gls</code>, there are similar
commands for a list of acronyms.  See the package documentations on
CTAN.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::  ">\newglossaryentry</menunode><menudescription><pre xml:space="preserve">Declare the content of a glossary entry.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::               ">\gls</menunode><menudescription><pre xml:space="preserve">Give a page reference for a glossary entry.
</pre></menudescription></menuentry></menu>


<node name="_005cnewglossaryentry" spaces=" "><nodename>\newglossaryentry</nodename><nodenext automatic="on">\gls</nodenext><nodeup automatic="on">Glossaries</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\newglossaryentry</code></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1095">glossary, entries</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1193" mergedindex="cp">\newglossaryentry</indexterm></findex>

<para>Synopsis, one of: 
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newglossaryentry&lbrace;<var>label</var>&rbrace; 
&lbrace; 
  name=&lbrace;<var>name</var>&rbrace;, 
  description=&lbrace;<var>description</var>&rbrace;, 
  <var>other options</var>, ... 
&rbrace;
</pre></example>

<para>or
</para>
<example endspaces=" ">
<pre xml:space="preserve">\longnewglossaryentry&lbrace;<var>label</var>&rbrace; 
&lbrace; 
  name=&lbrace;<var>name</var>&rbrace;, 
  <var>other options</var> ..., 
&rbrace; 
&lbrace;<var>description</var>&rbrace;
</pre></example>

<para>Declare a new entry for a glossary.  The <var>label</var> must be unique for
the document.  The settings associated with the label are pairs:
<code><var>key</var>=<var>value</var></code>.
</para>
<para>This puts the blackboard bold symbol for the real numbers <U>211D</U>, in the
glossary.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newglossaryentry&lbrace;R&rbrace;  
&lbrace;  
  name=&lbrace;\ensuremath&lbrace;\mathbb&lbrace;R&rbrace;&rbrace;&rbrace;,  
  description=&lbrace;the real numbers&rbrace;,  
&rbrace;
</pre></example>

<para>Use the second command form if the <var>description</var> spans more than one
paragraph.
</para>
<para>For a full list of <var>key</var>s see the package documentation on CTAN but
here are a few.
</para>
<ftable commandarg="code" spaces=" " endspaces=" ">
<tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1194" mergedindex="cp">name</indexterm>name</itemformat></item>
</tableterm><tableitem><para>(Required.) The word, phrase, or symbol that you are defining.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1195" mergedindex="cp">description</indexterm>description</itemformat></item>
</tableterm><tableitem><para>(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.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1196" mergedindex="cp">plural</indexterm>plural</itemformat></item>
</tableterm><tableitem><para>The plural form of <var>name</var>.  Refer to the plural form using
<code>\glspl</code> or <code>\Glspl</code> (<pxref label="_005cgls"><xrefnodename>\gls</xrefnodename></pxref>).
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1197" mergedindex="cp">sort</indexterm>sort</itemformat></item>
</tableterm><tableitem><para>How to place this entry in the list of entries that the glossary holds.
</para>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code"><indexterm index="fn" number="1198" mergedindex="cp">symbol</indexterm>symbol</itemformat></item>
</tableterm><tableitem><para>A symbol, such as a mathematical symbol, besides the name.
</para>
</tableitem></tableentry></ftable>


</subsection>
<node name="_005cgls" spaces=" "><nodename>\gls</nodename><nodeprev automatic="on">\newglossaryentry</nodeprev><nodeup automatic="on">Glossaries</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\gls</code></sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1096">glossary, entry reference</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1199" mergedindex="cp">\gls</indexterm></findex>

<para>Synopsis, one of: 
</para>
<example endspaces=" ">
<pre xml:space="preserve">\gls&lbrace;<var>label</var>&rbrace;
\glspl&lbrace;<var>label</var>&rbrace;
\Gls&lbrace;<var>label</var>&rbrace;
\Glspl&lbrace;<var>label</var>&rbrace;
</pre></example>

<para>Refer to a glossary entry.  The entries are declared with
<code>\newglossaryentry</code> (<pxref label="_005cnewglossaryentry"><xrefnodename>\newglossaryentry</xrefnodename></pxref>).
</para>
<para>This
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newglossaryentry&lbrace;N&rbrace;&lbrace;%
  name=&lbrace;the natural numbers&rbrace;,
  description=&lbrace;The numbers $0$, $1$, $2$, $\ldots$\&arobase;&rbrace;,
  symbol=&lbrace;\ensuremath&lbrace;\mathbb&lbrace;N&rbrace;&rbrace;&rbrace;,
  &rbrace;  
  ...
Consider \gls&lbrace;N&rbrace;.
</pre></example>

<noindent></noindent>
<para>gives the output <samp>Consider the natural numbers</samp>.
</para>
<para>The second command form <code>\glspl&lbrace;<var>label</var>&rbrace;</code> produces the plural
of <var>name</var> (by default it tries adding an <samp>s</samp>).  The third form
capitalizes the first letter of <var>name</var>, as does the fourth form,
which also takes the plural.
</para>

</subsection>
</section>
</chapter>
<node name="Letters" spaces=" "><nodename>Letters</nodename><nodenext automatic="on">Input/output</nodenext><nodeprev automatic="on">Front/back matter</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Letters</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1097">letters, writing</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1098">writing letters</indexterm></cindex>

<para>Synopsis: 
</para>
<example endspaces=" ">
<pre xml:space="preserve">\documentclass&lbrace;letter&rbrace;
\address&lbrace;<var>senders address</var>&rbrace;   % return address
\signature&lbrace;<var>sender name</var>&rbrace;
\begin&lbrace;document&rbrace;
\begin&lbrace;letter&rbrace;&lbrace;<var>recipient address</var>&rbrace;
\opening&lbrace;<var>salutation</var>&rbrace;
  <var>letter body</var>
\closing&lbrace;<var>closing text</var>&rbrace;
\end&lbrace;letter&rbrace;
   ...
\end&lbrace;document&rbrace;
</pre></example>

<para>Produce one or more letters.  
</para>
<para>Each letter is in a separate <code>letter</code> environment, whose argument
<var>recipient address</var> often contains multiple lines separated with a
double backslash,&nbsp;(<code>\\</code>).  For example, you might have:
</para>
<example endspaces=" ">
<pre xml:space="preserve"> \begin&lbrace;letter&rbrace;&lbrace;Ninon de l'Enclos \\
                l'h\^otel Sagonne&rbrace;
   ...
 \end&lbrace;letter&rbrace;
</pre></example>

<para>The start of the <code>letter</code> environment resets the page number to 1,
and the footnote number to 1 also.
</para>
<para>The <var>sender address</var> and <var>sender name</var> are common to all of the
letters, whether there is one or more, so these are best put in the
preamble.  As with the recipient address, often <var>sender address</var>
contains multiple lines separated by a double
backslash&nbsp;(<code>\\</code>).  &latex; will put the <var>sender name</var>
under the closing, after a vertical space for the traditional
hand-written signature.
</para>
<para>Each <code>letter</code> environment body begins with a required
<code>\opening</code> command such as <code>\opening&lbrace;Dear Madam or Sir:&rbrace;</code>.
The <var>letter body</var> text is ordinary &latex; so it can contain
everything from enumerated lists to displayed math, except that commands
such as <code>\chapter</code> that make no sense in a letter are turned off.
Each <code>letter</code> environment body typically ends with a
<code>\closing</code> command such as <code>\closing&lbrace;Yours,&rbrace;</code>.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="1200" mergedindex="cp">\\ <r>for letters</r></indexterm></findex>
<para>Additional material may come after the <code>\closing</code>.  You can say who
is receiving a copy of the letter with a command like <code>\cc&lbrace;the
Boss \\ the Boss's Boss&rbrace;</code>.  There&textrsquo;s a similar <code>\encl</code> command for
a list of enclosures.  And, you can add a postscript with <code>\ps</code>.
</para>
<para>&latex;&textrsquo;s default is to indent the sender name and the closing above it
by a length of <code>\longindentation</code>.  By default this is
<code>0.5\textwidth</code>. To make them flush left, put
<code>\setlength&lbrace;\longindentation&rbrace;&lbrace;0em&rbrace;</code> in your preamble.
</para>
<para>To set a fixed date use something like
<code>\renewcommand&lbrace;\today&rbrace;&lbrace;1958-Oct-12&rbrace;</code>.  If put in your preamble
then it will apply to all the letters.
</para>
<para>This example shows only one <code>letter</code> environment.  The three lines
marked as optional are typically omitted.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\documentclass&lbrace;letter&rbrace;
\address&lbrace;Sender's street \\ Sender's town&rbrace;
\signature&lbrace;Sender's name \\ Sender's title&rbrace;
% optional: \location&lbrace;Mailbox 13&rbrace;
% optional: \telephone&lbrace;(102) 555-0101&rbrace;
\begin&lbrace;document&rbrace;
\begin&lbrace;letter&rbrace;&lbrace;Recipient's name \\ Recipient's address&rbrace;
\opening&lbrace;Sir:&rbrace;
% optional: \thispagestyle&lbrace;firstpage&rbrace;
I am not interested in entering a business arrangement with you.
\closing&lbrace;Your most humble, etc.,&rbrace;
\end&lbrace;letter&rbrace;
\end&lbrace;document&rbrace;
</pre></example>

<para>These commands are used with the <code>letter</code> class.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::                       ">\address</menunode><menudescription><pre xml:space="preserve">Sender&textrsquo;s return address.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                            ">\cc</menunode><menudescription><pre xml:space="preserve">Carbon copy list.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                       ">\closing</menunode><menudescription><pre xml:space="preserve">Saying goodbye.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                          ">\encl</menunode><menudescription><pre xml:space="preserve">List of enclosed material.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                      ">\location</menunode><menudescription><pre xml:space="preserve">Sender&textrsquo;s organizational location.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                    ">\makelabels</menunode><menudescription><pre xml:space="preserve">Make address labels.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                          ">\name</menunode><menudescription><pre xml:space="preserve">Sender&textrsquo;s name, for the return address.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                       ">\opening</menunode><menudescription><pre xml:space="preserve">Saying hello.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                            ">\ps</menunode><menudescription><pre xml:space="preserve">Adding a postscript.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                     ">\signature</menunode><menudescription><pre xml:space="preserve">Sender&textrsquo;s signature.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                     ">\telephone</menunode><menudescription><pre xml:space="preserve">Sender&textrsquo;s phone number.
</pre></menudescription></menuentry></menu>


<node name="_005caddress" spaces=" "><nodename>\address</nodename><nodenext automatic="on">\cc</nodenext><nodeup automatic="on">Letters</nodeup></node>
<section spaces=" "><sectiontitle><code>\address</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1201" mergedindex="cp">\address</indexterm></findex>

<para>Synopsis: 
</para>
<example endspaces=" ">
<pre xml:space="preserve">\address&lbrace;<var>senders address</var>&rbrace;
</pre></example>

<para>Specify the return address, as it appears on the letter and on the
envelope.  Separate multiple lines in <var>senders address</var> with a
double backslash,&nbsp;<code>\\</code>.
</para>
<para>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</code> environment.
</para>
<para>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</code> declaration then it
is formatted as a personal letter.
</para>
<para>Here is an example.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\address&lbrace;Stephen Maturin \\
         The Grapes of the Savoy&rbrace;
</pre></example>


</section>
<node name="_005ccc" spaces=" "><nodename>\cc</nodename><nodenext automatic="on">\closing</nodenext><nodeprev automatic="on">\address</nodeprev><nodeup automatic="on">Letters</nodeup></node>
<section spaces=" "><sectiontitle><code>\cc</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1202" mergedindex="cp">\cc</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1099">cc list, in letters</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\cc&lbrace;<var>name0</var> \\ 
     ... &rbrace;
</pre></example>

<para>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</code>.  Put the names on different lines by separating them
with a double backslash, <code>\\</code>, as in:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\cc&lbrace;President \\
    Vice President&rbrace;
</pre></example>


</section>
<node name="_005cclosing" spaces=" "><nodename>\closing</nodename><nodenext automatic="on">\encl</nodenext><nodeprev automatic="on">\cc</nodeprev><nodeup automatic="on">Letters</nodeup></node>
<section spaces=" "><sectiontitle><code>\closing</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1203" mergedindex="cp">\closing</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1100">letters, ending</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1101">closing letters</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\closing&lbrace;<var>text</var>&rbrace;
</pre></example>

<para>Produce the letter&textrsquo;s closing.  This is optional, but usual.  It appears
at the end of a letter, above a handwritten signature.  For example:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\closing&lbrace;Regards,&rbrace;
</pre></example>


</section>
<node name="_005cencl" spaces=" "><nodename>\encl</nodename><nodenext automatic="on">\location</nodenext><nodeprev automatic="on">\closing</nodeprev><nodeup automatic="on">Letters</nodeup></node>
<section spaces=" "><sectiontitle><code>\encl</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1204" mergedindex="cp">\encl</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1102">enclosure list</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\encl&lbrace;<var>first enclosed object</var> \\ 
       ... &rbrace;
</pre></example>

<para>Produce a list of things included with the letter. This command is
optional; when it is used, it typically is put after <code>\closing</code>.
Separate multiple lines with a double backslash, <code>\\</code>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\encl&lbrace;License \\
      Passport&rbrace;
</pre></example>


</section>
<node name="_005clocation" spaces=" "><nodename>\location</nodename><nodenext automatic="on">\makelabels</nodenext><nodeprev automatic="on">\encl</nodeprev><nodeup automatic="on">Letters</nodeup></node>
<section spaces=" "><sectiontitle><code>\location</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1205" mergedindex="cp">\location</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\location&lbrace;<var>text</var>&rbrace;
</pre></example>

<para>The <var>text</var> appears centered at the bottom of the page.  It only
appears if the page style is <code>firstpage</code>.
</para>

</section>
<node name="_005cmakelabels" spaces=" "><nodename>\makelabels</nodename><nodenext automatic="on">\name</nodenext><nodeprev automatic="on">\location</nodeprev><nodeup automatic="on">Letters</nodeup></node>
<section spaces=" "><sectiontitle><code>\makelabels</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1206" mergedindex="cp">\makelabels</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\makelabels   % in preamble
</pre></example>

<para>Optional, for a document that contains <code>letter</code> environments.  If
you just put <code>\makelabels</code> 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.
</para>
<para>Customize the labels by redefining the commands <code>\startlabels</code>,
<code>\mlabel</code>, and <code>\returnaddress</code> (and perhaps <code>\name</code>) in
the preamble.  The command <code>\startlabels</code> sets the width, height,
number of columns, etc., of the page onto which the labels are printed.
The command <code>\mlabel&lbrace;<var>return address</var>&rbrace;&lbrace;<var>recipient
address</var>&rbrace;</code> produces the two labels (or one, if you choose to ignore the
<var>return address</var>) for each letter environment. The first argument,
<var>return address</var>, is the value returned by the macro
<code>\returnaddress</code>.  The second argument, <var>recipient address</var>, is
the value passed in the argument to the <code>letter</code> environment.  By
default <code>\mlabel</code> ignores the first argument, the <var>return
address</var>, causing the default behavior described in the prior paragraph.
</para>
<para>This illustrates customization.  Its output includes a page with two
columns having two labels each.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\documentclass&lbrace;letter&rbrace;
\renewcommand*&lbrace;\returnaddress&rbrace;&lbrace;Fred McGuilicuddy \\
                               Oshkosh, Mineola 12305&rbrace;
\newcommand*\originalMlabel&lbrace;&rbrace;
\let\originalMlabel\mlabel
\def\mlabel#1#2&lbrace;\originalMlabel&lbrace;&rbrace;&lbrace;#1&rbrace;\originalMlabel&lbrace;&rbrace;&lbrace;#2&rbrace;&rbrace;
\makelabels
  ...
\begin&lbrace;document&rbrace;
\begin&lbrace;letter&rbrace;&lbrace;A Einstein \\
               112 Mercer Street \\
               Princeton, New Jersey, USA 08540&rbrace;
  ...
\end&lbrace;letter&rbrace;
\begin&lbrace;letter&rbrace;&lbrace;K G\&quot;odel \\
               145 Linden Lane \\
               Princeton, New Jersey, USA 08540&rbrace;
  ...
\end&lbrace;letter&rbrace;
\end&lbrace;document&rbrace;
</pre></example>

<noindent></noindent>
<para>The first column contains the return address twice.  The second column
contains the address for each recipient.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1103"><r>package</r>, <code>envlab</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1104"><code>envlab</code> <r>package</r></indexterm></cindex>

<para>The package <code>envlab</code> makes formatting the labels easier, with
standard sizes already provided.  The preamble lines
<code>\usepackage[personalenvelope]&lbrace;envlab&rbrace;</code> and <code>\makelabels</code>
are all that you need to print envelopes.
</para>

</section>
<node name="_005cname" spaces=" "><nodename>\name</nodename><nodenext automatic="on">\opening</nodenext><nodeprev automatic="on">\makelabels</nodeprev><nodeup automatic="on">Letters</nodeup></node>
<section spaces=" "><sectiontitle><code>\name</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1207" mergedindex="cp">\name</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\name&lbrace;<var>name</var>&rbrace;
</pre></example>

<para>Optional.  Sender&textrsquo;s name, used for printing on the envelope together
with the return address.
</para>

</section>
<node name="_005copening" spaces=" "><nodename>\opening</nodename><nodenext automatic="on">\ps</nodenext><nodeprev automatic="on">\name</nodeprev><nodeup automatic="on">Letters</nodeup></node>
<section spaces=" "><sectiontitle><code>\opening</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1208" mergedindex="cp">\opening</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1105">letters, starting</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\opening&lbrace;<var>salutation</var>&rbrace;
</pre></example>

<para>Required.  Follows the <code>\begin&lbrace;letter&rbrace;&lbrace;...&rbrace;</code>. The argument
<var>salutation</var> is mandatory.  For instance:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\opening&lbrace;Dear John:&rbrace;
</pre></example>


</section>
<node name="_005cps" spaces=" "><nodename>\ps</nodename><nodenext automatic="on">\signature</nodenext><nodeprev automatic="on">\opening</nodeprev><nodeup automatic="on">Letters</nodeup></node>
<section spaces=" "><sectiontitle><code>\ps</code></sectiontitle>
<findex index="fn" spaces=" "><indexterm index="fn" number="1209" mergedindex="cp">\ps</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1106">postscript, in letters</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" "> 
<pre xml:space="preserve">\ps&lbrace;<var>text</var>&rbrace;
</pre></example>

<para>Add a postscript.  This command is optional and usually is used after
<code>\closing</code>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\ps&lbrace;P.S. After you have read this letter, burn it. Or eat it.&rbrace;
</pre></example>


</section>
<node name="_005csignature" spaces=" "><nodename>\signature</nodename><nodenext automatic="on">\telephone</nodenext><nodeprev automatic="on">\ps</nodeprev><nodeup automatic="on">Letters</nodeup></node>
<section spaces=" "><sectiontitle><code>\signature</code></sectiontitle>

<para>Synopsis:
</para>
<example endspaces=" "> 
<pre xml:space="preserve">\signature&lbrace;<var>first line</var> \\
            ... &rbrace;
</pre></example>

<findex index="fn" spaces=" "><indexterm index="fn" number="1210" mergedindex="cp">\signature</indexterm></findex>

<para>The sender&textrsquo;s name.  This command is optional, although its inclusion is
usual.
</para>
<para>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,&nbsp;<code>\\</code>.  For example:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\signature&lbrace;J Fred Muggs \\
           White House&rbrace;
</pre></example>

<para>&latex;&textrsquo;s default for the vertical space from the <code>\closing</code> text
down to the <code>\signature</code> text is <code>6\medskipamount</code>, which is
six times <code>\medskipamount</code> (where <code>\medskipamount</code> is equal to
a <code>\parskip</code>, which in turn is defined by default here to
0.7<dmn>em</dmn>).
</para>
<para>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</code> environment and before the <code>\closing</code>.
</para>
<para>You can include a graphic in the signature as here.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\signature&lbrace;\vspace&lbrace;-6\medskipamount&rbrace;\includegraphics&lbrace;sig.png&rbrace;\\
             My name&rbrace;
</pre></example>

<noindent></noindent>
<para>For this you must put <code>\usepackage&lbrace;graphicx&rbrace;</code> in the preamble
(<pxref label="Graphics"><xrefnodename>Graphics</xrefnodename></pxref>).
</para>

</section>
<node name="_005ctelephone" spaces=" "><nodename>\telephone</nodename><nodeprev automatic="on">\signature</nodeprev><nodeup automatic="on">Letters</nodeup></node>
<section spaces=" "><sectiontitle><code>\telephone</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1211" mergedindex="cp">\telephone</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\telephone&lbrace;<var>number</var>&rbrace;
</pre></example>

<para>The sender&textrsquo;s telephone number.  This is typically in the preamble, where
it applies to all letters.  This only appears if the <code>firstpage</code>
pagestyle is selected.  If so, it appears on the lower right of the
page.
</para>

</section>
</chapter>
<node name="Input_002foutput" spaces=" "><nodename>Input/output</nodename><nodenext automatic="on">Command line interface</nodenext><nodeprev automatic="on">Letters</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Input/output</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1107">input/output, to terminal</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1108">terminal input/output</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1109">input/output</indexterm></cindex>

<para>&latex; uses the ability to write to a file and later read it back in
to build document components such as a table of contents or index.  You
can also read a file that other programs written, or write a file for
others to read.  You can communicate with users through the terminal.
And, you can issue instructions for the operating system.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::  ">\openin &amp; \openout</menunode><menudescription><pre xml:space="preserve">Open a file.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::               ">\read</menunode><menudescription><pre xml:space="preserve">Read text from a file.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::             ">\typein</menunode><menudescription><pre xml:space="preserve">Read text from the terminal.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::            ">\typeout</menunode><menudescription><pre xml:space="preserve">Write text to the terminal.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::              ">\write</menunode><menudescription><pre xml:space="preserve">Write text to a file or terminal.
</pre></menudescription></menuentry></menu>


<node name="_005copenin-_0026-_005copenout" spaces=" "><nodename>\openin &amp; \openout</nodename><nodenext automatic="on">\read</nodenext><nodeup automatic="on">Input/output</nodeup></node>
<section spaces=" "><sectiontitle><code>\openin</code> &amp; <code>\openout</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1212" mergedindex="cp">\openin</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1213" mergedindex="cp">\openout</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1214" mergedindex="cp">\closein</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1215" mergedindex="cp">\closeout</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1110">file, opening</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1111">file, closing</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1112">open a file</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\openin <var>number</var>=<var>filename</var>
</pre></example>

<para>or:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\openout <var>number</var>=<var>filename</var>
</pre></example>

<para>Open a file for reading material, or for writing it.  In most engines,
the <var>number</var> must be between 0 and 15, as in <code>\openin3</code>; in
Lua&latex;, <var>number</var> can be between 0 and 127.
</para>
<para>Here &tex; opens the file <file>presidents.tex</file> for reading.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newread\presidentsfile
\openin\presidentsfile=presidents
\typeout&lbrace;presidentsfile is \the\presidentsfile&rbrace;
\read\presidentsfile to\presidentline
\typeout&lbrace;\presidentline&rbrace;
</pre></example>
 
<noindent></noindent>
<para>The <code>\newread</code> command allocates input stream numbers from 0
to&nbsp;15 (there is also a <code>\newwrite</code>).  The
<code>\presidentsfile</code> is more memorable but under the hood it is still
a number; the first <code>\typeout</code> gives something like
<samp>presidentsfile is 1</samp>.  In addition, <code>\newread</code> keeps track of
the allocation so that if you use too many then you get an error like
<samp>! No room for a new \read</samp>.  The second <code>\typeout</code> gives the
first line of the file, something like <samp>1 Washington, George</samp>.
</para>
<para>Ordinarily &tex; will not try to open the file until the next page
shipout. To change this, use
<code>\immediate\openin <var>number</var>=<var>filename</var></code> or
<code>\immediate\openout <var>number</var>=<var>filename</var></code>.
</para>
<para>Close files with <code>\closein <var>number</var></code> and
<code>\closeout <var>number</var></code>.
</para>
<para>How &latex; handles filenames varies among distributions, and even can
vary among versions of a distribution.  If the file does not have an
extension then &tex; will add a <file>.tex</file>.  This creates
<file>presidents.tex</file>, writes one line to it, and closes it.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newwrite\presidentsfile
\openout\presidentsfile=presidents
\write\presidentsfile&lbrace;1 Washington, George&rbrace;
\closeout\presidentsfile
</pre></example>

<noindent></noindent>
<para>But filenames with a period can cause trouble: if &tex; finds a
<var>filename</var> of <file>presidents.dat</file> it could look first for
<file>presidents.dat.tex</file> and later for <file>presidents.dat</file>, or it
could do the opposite.  Your distribution&textrsquo;s documentation should say
more, and if you find something that works for you then you are good,
but to ensure complete portability the best thing is to use file names
containing only the twenty six ASCII letters (not case-sensitive) and
the ten digits, along with underscore and dash, and in particular with
no dot or space.
</para>
<para>For <code>\openin</code>, if &tex; cannot find the file then it does not give
an error.  It just considers that the stream is not open (test for this
with <code>\ifeof</code>; one recourse is the command
<code>\InputIfFileExists</code>, <pxref label="Class-and-package-commands"><xrefnodename>Class and package commands</xrefnodename></pxref>).  If you
try to use the same number twice, &latex; won&textrsquo;t give you an error.  If
you try to use a bad number then you get an error message like <samp>!
Bad number (16).  &lt;to be read again&gt; = l.30 \openin16=test.jh</samp>.
</para>

</section>
<node name="_005cread" spaces=" "><nodename>\read</nodename><nodenext automatic="on">\typein</nodenext><nodeprev automatic="on">\openin &amp; \openout</nodeprev><nodeup automatic="on">Input/output</nodeup></node>
<section spaces=" "><sectiontitle><code>\read</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1216" mergedindex="cp">\read</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1113">file, reading</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1114">read a file</indexterm></cindex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\read <var>number</var> to<var>macro</var>
</pre></example>

<para>Make the command <var>macro</var> contain the next line of input from text
stream <var>number</var>, as in <code>\read5 to\data</code>.
</para>
<para>This opens the file <file>email.tex</file> for reading, puts the contents of
the first line into the command <code>\email</code>, and then closes the file.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newread\recipientfile
\openin\recipientfile=email
\read\recipientfile to\email
\typeout&lbrace;Email address: \email&rbrace;
\closein\recipientfile
</pre></example>

<para>If <var>number</var> is outside the range from 0 to&nbsp;15 or if no file
of that number is open, or if the file has ended, then <code>\read</code>
will take input from the terminal (or exit if interaction is not
allowed, e.g., <code>\nonstopmode</code>; <pxref label="interaction-modes"><xrefnodename>interaction modes</xrefnodename></pxref>).
(However, the natural way in &latex; to take input from the terminal
is <code>\typein</code> (<pxref label="_005ctypein"><xrefnodename>\typein</xrefnodename></pxref>.)
</para>
<para>To read an entire file as additional &latex; source, use
<code>\input</code> (<pxref label="_005cinput"><xrefnodename>\input</xrefnodename></pxref>) or <code>\include</code> (<pxref label="_005cinclude-_0026-_005cincludeonly"><xrefnodename>\include &amp;
\includeonly</xrefnodename></pxref>).
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1115"><r>package</r>, <code>datatool</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1116"><code>datatool</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1117">mail merges</indexterm></cindex>
<para>A common reason to want to read from a data file is to do mail merges.
CTAN has a number of packages for that; one is <code>datatool</code>.
</para>

</section>
<node name="_005ctypein" spaces=" "><nodename>\typein</nodename><nodenext automatic="on">\typeout</nodenext><nodeprev automatic="on">\read</nodeprev><nodeup automatic="on">Input/output</nodeup></node>
<section spaces=" "><sectiontitle><code>\typein</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1217" mergedindex="cp">\typein</indexterm></findex>

<para>Synopsis, one of:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\typein&lbrace;<var>prompt-msg</var>&rbrace;
\typein[<var>cmd</var>]&lbrace;<var>prompt-msg</var>&rbrace;
</pre></example>

<para>Print <var>prompt-msg</var> 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.
</para>
<para>For example, this
</para>
<example endspaces=" ">
<pre xml:space="preserve">As long as I live I shall never forget \typein&lbrace;Enter student name:&rbrace;
</pre></example>

<noindent></noindent>
<para>coupled with this command line interaction
</para>
<example endspaces=" ">
<pre xml:space="preserve">Enter student name:

\&arobase;typein=Aphra Behn
</pre></example>

<noindent></noindent>
<para>gives the output <samp>... never forget Aphra Behn</samp>.
</para>
<para>The first command version, <code>\typein&lbrace;<var>prompt-msg</var>&rbrace;</code>, causes
the input you typed to be processed as if it had been included in the
input file in place of the <code>\typein</code> command.
</para>
<para>In the second command version the optional argument <code><var>cmd</var></code>
argument must be a command name, that is, it must begin with a
backslash, \.  This command name is then defined or redefined to be
the input that you typed.  For example, this
</para>
<example endspaces=" ">
<pre xml:space="preserve">\typein[\student]&lbrace;Enter student name:&rbrace;
\typeout&lbrace;Recommendation for \student .&rbrace;
</pre></example>

<noindent></noindent>
<para>gives this output on the command line,
</para>
<example endspaces=" ">
<pre xml:space="preserve">Enter student name:

\student=John Dee
Recommendation for John Dee.
</pre></example>

<noindent></noindent>
<para>where the user has entered <samp>John Dee.</samp>
</para>

</section>
<node name="_005ctypeout" spaces=" "><nodename>\typeout</nodename><nodenext automatic="on">\write</nodenext><nodeprev automatic="on">\typein</nodeprev><nodeup automatic="on">Input/output</nodeup></node>
<section spaces=" "><sectiontitle><code>\typeout</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1218" mergedindex="cp">\typeout</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\typeout&lbrace;<var>msg</var>&rbrace;
</pre></example>

<para>Print <code>msg</code> on the terminal and in the <code>log</code> file.
</para>
<para>This
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcommand&lbrace;\student&rbrace;&lbrace;John Dee&rbrace;
\typeout&lbrace;Recommendation for \student .&rbrace;
</pre></example>

<noindent></noindent>
<para>outputs <samp>Recommendation for John Dee</samp>.  Like what happens here with
<code>\student</code>, commands that are defined with <code>\newcommand</code> or
<code>\renewcommand</code> (among others) are replaced by their definitions
before being printed.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="1219" mergedindex="cp">\space</indexterm></findex>
<para>&latex;&textrsquo;s usual rules for treating multiple spaces as a single space
and ignoring spaces after a command name apply to <code>msg</code>.  Use the
command <code>\space</code> to get a single space, independent of surrounding
spaces.  Use <code>^^J</code> to get a newline.  Get a percent character with
<code>\csname &arobase;percentchar\endcsname</code>.
</para>
<para>This command can be useful for simple debugging, as here:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newlength&lbrace;\jhlength&rbrace;
\setlength&lbrace;\jhlength&rbrace;&lbrace;5pt&rbrace;
\typeout&lbrace;The length is \the\jhlength.&rbrace;
</pre></example>

<noindent></noindent>
<para>produces on the command line <samp>The length is 5.0pt</samp>.
</para>

</section>
<node name="_005cwrite" spaces=" "><nodename>\write</nodename><nodeprev automatic="on">\typeout</nodeprev><nodeup automatic="on">Input/output</nodeup></node>
<section spaces=" "><sectiontitle><code>\write</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1220" mergedindex="cp">\write</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\write <var>number</var>&lbrace;<var>string</var>&rbrace;
</pre></example>

<para>Write <var>string</var> to the log file, to the terminal, or to a file
opened by <code>\openout</code>.  For instance, <code>\write6</code> writes to text
stream number&nbsp;6.
</para>
<para>If the following appears in <file><var>basefile</var>.tex</file> then it opens
<file><var>basefile</var>.jh</file>, writes <samp>Hello World!</samp> and a newline to
it, and closes that file.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newwrite\myfile
\immediate\openout\myfile=\jobname.jh  % \jobname is root file basename
...
\immediate\write\myfile&lbrace;Hello world!&rbrace;
...
\immediate\closeout\myfile
</pre></example>

<findex index="fn" spaces=" "><indexterm index="fn" number="1221" mergedindex="cp">\newwrite</indexterm></findex>
<noindent></noindent>
<para>The <code>\newwrite</code> allocates a stream number, giving it a symbolic
name to make life easier, so that <code>stream
\newwrite\myfile\the\myfile</code> produces something like <samp>stream 3</samp>.
Then <code>\openout</code> associates the stream number with the given file
name.  &tex; ultimately executed <code>\write3</code> which puts the string
in the file.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1118">log file, writing to</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1119">terminal, writing to</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1120"><math>-1</math>, write stream number</indexterm></cindex>
<para>Typically <var>number</var> is between 0 and&nbsp;15, because typically
&latex; authors follow the prior example and the number is allocated
by the system.  If <var>number</var> is outside the range from 0 to 15 or
if it is not associated with an open file then &latex; writes
<var>string</var> to the log file.  If <var>number</var> is positive then in
addition &latex; writes <var>string</var> to the terminal.
</para>
<para>Thus, <code>test \write-1&lbrace;Hello World!&rbrace;</code> puts <samp>Hello World!</samp>
followed by a newline in the log file.  (This is what the <code>\wlog</code>
command does; <pxref label="_005cwlog"><xrefnodename>\wlog</xrefnodename></pxref>).  And <code>\write100&lbrace;Hello World!&rbrace;</code>
puts the same in the log file but also puts <samp>Hello World!</samp>
followed by a newline in the terminal output.  (But 16, 17, and 18 are
special as <var>number</var>; see below.)
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1121">Lua&tex;, 256 output streams in</indexterm></cindex>
<para>In Lua&tex;, instead of 16 output streams there are 256
(<pxref label="TeX-engines"><xrefnodename>&tex; engines</xrefnodename></pxref>).
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="1222" mergedindex="cp">\&arobase;auxout</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1223" mergedindex="cp">\&arobase;mainaux</indexterm></findex>
<para>Use <code>\write\&arobase;auxout&lbrace;<var>string</var>&rbrace;</code> to write to the current
<file>.aux</file> file, which is associated with either the root file or
with the current include file; and use
<code>\write\&arobase;mainaux&lbrace;<var>string</var>&rbrace;</code> to write to the main
<file>.aux</file>.  These symbolic names are defined by &latex;.
</para>
<!-- c credit: David Carlisle https://tex.stackexchange.com/a/115933/121234 -->
<para>By default &latex; does not write <var>string</var> to the file right
away.  This is because, for example, you may need <code>\write</code> to
save the current page number, but when &tex; comes across a
<code>\write</code> it typically does not know what the page number is,
since it has not yet done the page breaking.  So, you use <code>\write</code>
in one of three contexts:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\immediate\write\&arobase;auxout&lbrace;<var>string</var>&rbrace;      %1
\write\&arobase;auxout&lbrace;<var>string</var>&rbrace;                %2
\protected&arobase;write\&arobase;auxout&lbrace;&rbrace;&lbrace;<var>string</var>&rbrace;    %3
</pre></example>

<enumerate first="1" endspaces=" ">
<listitem> 
<cindex index="cp" spaces=" "><indexterm index="cp" number="1122">immediate <code>\write</code></indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1224" mergedindex="cp">\immediate\write</indexterm></findex>
<para>With the first, &latex; writes <var>string</var> to the file immediately.
Any macros in <var>string</var> are fully expanded (just as in
<code>\edef</code>) so to prevent expansion you must use <code>\noexpand</code>,
<code>toks</code>, etc., except that you should use <code>#</code> instead of
<code>##</code>).
</para>
</listitem><listitem>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1123">delayed <code>\write</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1124">whatsit item</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1225" mergedindex="cp">\shipout <r>and expansion</r></indexterm></findex>
<para>With the second, <var>string</var> is stored on the current list of things
(as a &tex; &textldquo;whatsit&textrdquo; item) and kept until the page is shipped out
and likewise the macros are unexpanded until <code>\shipout</code>. At
<code>\shipout</code>, <var>string</var> is fully expanded.
</para>
</listitem><listitem>
<findex index="fn" spaces=" "><indexterm index="fn" number="1226" mergedindex="cp">\protected&arobase;write</indexterm></findex>
<para>The third, <code>\protected&arobase;write</code>, is like the second except that
you can use <code>\protect</code> to avoid expansion. The extra first
argument allows you to locally insert extra definitions to make more
macros protected or to have some other special definition for the
write.
</para></listitem></enumerate>

<para>As a simple example of expansion with <code>\write</code>, <var>string</var> here
contains a control sequence <code>\triplex</code> which we&textrsquo;ve defined to be
the text <samp>XYZ</samp>:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newwrite\jhfile
\openout\jhfile=test.jh
\newcommand&lbrace;\triplex&rbrace;&lbrace;XYZ&rbrace;
\write\jhfile&lbrace;test \triplex test&rbrace;
</pre></example>

<noindent></noindent>
<para>This results in the file <file>test.jh</file> containing the text
<samp>test XYZtest</samp> followed by a newline.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1125"><code>\write</code> streams 16, 17, 18</indexterm></cindex>
<para>The cases where <var>number</var> is 16, 17, or 18 are special.  Because of
<code>\write</code>&textrsquo;s behavior when <var>number</var> is outside the range from 0
to 15 described above, in Plain&nbsp;&tex; <code>\write16</code> and
<code>\write17</code> were sometimes used to write to the log file and the
terminal; however, in &latex;, the natural way to do that is with
<code>\typeout</code> (<pxref label="_005ctypeout"><xrefnodename>\typeout</xrefnodename></pxref>).  The <code>\write18</code> command is
even more special; modern &tex; systems use it for giving commands to
the operating system (<pxref label="_005cwrite18"><xrefnodename>\write18</xrefnodename></pxref>).
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1126">newline, in <code>\write</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1127"><code>^^J</code>, in <code>\write</code></indexterm></cindex>
<para>Ordinarily <code>\write</code> outputs a single line.  You can include a
newline with <code>^^J</code>.  Thus, this produces two lines in the log
file:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\wlog&lbrace;Parallel lines have a lot in common.^^JBut they never meet.&rbrace;
</pre></example>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1128"><r>package</r>, <code>answers</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1129"><code>answers</code> <r>package</r></indexterm></cindex>

<para>A common case where authors need to write their own file is for
answers to exercises, or another situation where you want to write
out verbatim, without expanding the macros.  CTAN has a number of
packages for this; one is <code>answers</code>.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator=":: ">\write and security</menunode><menudescription><pre xml:space="preserve">Security.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::          ">\message</menunode><menudescription><pre xml:space="preserve">Write text to the log file and terminal.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::             ">\wlog</menunode><menudescription><pre xml:space="preserve">Write text to the log file.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::          ">\write18</menunode><menudescription><pre xml:space="preserve">Run an operating system command.
</pre></menudescription></menuentry></menu>


<node name="_005cwrite-and-security" spaces=" "><nodename>\write and security</nodename><nodenext automatic="on">\message</nodenext><nodeup automatic="on">\write</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\write</code> and security</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1130">security and <code>\write</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1131"><code>\write</code> and security</indexterm></cindex>

<para>The ability to write files raises security issues. If you compiled a
downloaded &latex; file and it overwrote your password file then you
would be justifiably troubled.
</para>
<para>Thus, by default &tex; systems only allow you to open files for
writing that are in the current directory or output directory, if
specified (<pxref label="output-directory"><xrefnodename>output directory</xrefnodename></pxref>), or in a subdirectory of
those. So, this code
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newwrite\jhfile
\openout\jhfile=../test.jh
</pre></example>

<noindent></noindent>
<para>gives an error like:
</para><example endspaces=" ">
<pre xml:space="preserve">Not writing to ../test.jh (openout_any = p).
! I can't write on file `../test.jh'
</pre></example>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1132">parent directories, cannot write to</indexterm></cindex>
<para>You can get just such an error when using commands such as
<code>\include&lbrace;../filename&rbrace;</code> because &latex; will try to open
<file>../filename.aux</file>.  The simplest solution is to put the included
files in the same directory as the root file, or in subdirectories.
</para>

</subsection>
<node name="_005cmessage" spaces=" "><nodename>\message</nodename><nodenext automatic="on">\wlog</nodenext><nodeprev automatic="on">\write and security</nodeprev><nodeup automatic="on">\write</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\message</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1227" mergedindex="cp">\message</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\message&lbrace;<var>string</var>&rbrace;
</pre></example>

<para>Write <var>string</var> to the log file and the terminal.
</para>
<para>Typically, &latex; authors use <code>\typeout</code> (<pxref label="_005ctypeout"><xrefnodename>\typeout</xrefnodename></pxref>). It
allows you to use <code>\protect</code> on any fragile commands in
<var>string</var> (<pxref label="_005cprotect"><xrefnodename>\protect</xrefnodename></pxref>).  But <code>\typeout</code> always inserts a
newline at the end of <var>string</var> while <code>\message</code> does not, so
the latter can be useful.
</para>
<para>With this example document body.
</para>
<example endspaces=" ">
<pre xml:space="preserve">before\message&lbrace;One Two&rbrace;\message&lbrace;Three&rbrace;\message&lbrace;Four^^JI&rbrace;
\message&lbrace;declare a thumb war.&rbrace;After
</pre></example>

<noindent></noindent>
<para>under some circumstances (see below) &latex; writes the following to
both the terminal and the log file.
</para>
<example endspaces=" ">
<pre xml:space="preserve">One Two Three Four
I declare a thumb war.
</pre></example>

<noindent></noindent>
<para>The <code>^^J</code> produces a newline.  Also, in the output document,
between <samp>before</samp> and <samp>After</samp> will be a single space (from
the end of line following <samp>I&rbrace;</samp>).
</para>
<para>While <code>\message</code> allows you more control over formatting, a
gotcha is that &latex; may mess up that formatting because it inserts
line breaks depending on what it has already written. Contrast this
document body, where the <samp>Two</samp> has moved, to the one given above.
</para>
<example endspaces=" ">
<pre xml:space="preserve">before\message&lbrace;One&rbrace;\message&lbrace;Two Three&rbrace;\message&lbrace;Four^^JI&rbrace;
\message&lbrace;declare a thumb war.&rbrace;After
</pre></example>

<para>This can happen: when &latex; is outputting the messages to the
terminal, now the message with <samp>One</samp> is shorter and it fits at the
end of the output terminal line, and so &latex; breaks the line between
it and the <samp>Two Three</samp>.  That line break appears also in the log
file.  This line break insertion can depend on, for instance, the length
of the full path names of included files.  So producing finely-formatted
lines in a way that is portable is hard, likely requiring 
starting your message at the beginning of a line.
</para>

</subsection>
<node name="_005cwlog" spaces=" "><nodename>\wlog</nodename><nodenext automatic="on">\write18</nodenext><nodeprev automatic="on">\message</nodeprev><nodeup automatic="on">\write</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\wlog</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1228" mergedindex="cp">\wlog</indexterm></findex>

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\wlog&lbrace;<var>string</var>&rbrace;
</pre></example>

<para>Write <var>string</var> to the log file.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\wlog&lbrace;Did you hear about the mathematician who hates negatives?&rbrace;
\wlog&lbrace;He'll stop at nothing to avoid them.&rbrace;
</pre></example>

<para>Ordinarily <var>string</var> appears in a single separate line.  Use
<code>^^J</code> to insert a newline.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\wlog&lbrace;Helvetica and Times Roman walk into a bar.&rbrace;
\wlog&lbrace;The barman says,^^JWe don't serve your type.&rbrace;
</pre></example>


</subsection>
<node name="_005cwrite18" spaces=" "><nodename>\write18</nodename><nodeprev automatic="on">\wlog</nodeprev><nodeup automatic="on">\write</nodeup></node>
<subsection spaces=" "><sectiontitle><code>\write18</code></sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1229" mergedindex="cp">\write18</indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1133">external commands</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1134">commands, run from &latex;</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1135">system commands, run from &latex;</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1136">shell access</indexterm></cindex>
<!-- c Derived from: Joseph Wright: https://tex.stackexchange.com/a/20446/121234 -->

<para>Synopsis:
</para>
<example endspaces=" ">
<pre xml:space="preserve">\write18&lbrace;<var>shell_command</var>&rbrace;
</pre></example>

<para>Issue a command to the operating system shell.  The operating system
runs the command and &latex;&textrsquo;s execution is blocked until that
finishes.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1137"><r>package</r>, <code>Asymptote</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1138"><code>Asymptote</code> <r>package</r></indexterm></cindex>

<para>This sequence (on Unix)
</para>
<example endspaces=" ">
<pre xml:space="preserve">\usepackage&lbrace;graphicx&rbrace;  % in preamble
  ...
\newcommand&lbrace;\fignum&rbrace;&lbrace;1&rbrace;
\immediate\write18&lbrace;cd pix &amp;&amp; asy figure\fignum&rbrace;
\includegraphics&lbrace;pix\figure\fignum.pdf&rbrace;
</pre></example>

<noindent></noindent>
<para>will run Asymptote (the <code>asy</code> program) on <file>pix/figure1.asy</file>,
so that the document can later read in the resulting graphic
(<pxref label="_005cincludegraphics"><xrefnodename>\includegraphics</xrefnodename></pxref>).  Like any <code>\write</code>, here &latex;
expands macros in <var>shell_command</var> so that <code>\fignum</code> is
replaced by <samp>1</samp>.
</para>
<para>Another example is that you can automatically run Bib&tex; at the start
of each &latex; run (<pxref label="Using-BibTeX"><xrefnodename>Using BibTeX</xrefnodename></pxref>) by including
<code>\immediate\write18&lbrace;bibtex8 \jobname&rbrace;</code> as the first line of the
file.  Note that <code>\jobname</code> expands to the basename of the root
file unless the <code>--jobname</code> option is passed on the command line,
in which case this is the option argument.
</para>
<para>You sometimes need to do a multi-step process to get the information
that you want.  This will insert into the input a list of all PDF files
in the current directory (but see <code>texosquery</code> below):
</para>
<example endspaces=" ">
<pre xml:space="preserve">\immediate\write18&lbrace;ls *.pdf &gt; tmp.dat&rbrace;
\input&lbrace;tmp.dat&rbrace;
</pre></example>

<para>The standard behavior of any <code>\write</code> is to wait until a page is
being shipped out before expanding the macros or writing to the stream
(<pxref label="_005cwrite"><xrefnodename>\write</xrefnodename></pxref>). But sometimes you want it done now.  For this, use
<code>\immediate\write18&lbrace;<var>shell_command</var>&rbrace;</code>.
</para>
<para>There are obvious security issues with allowing system commands inside
a &latex; file.  If you download a file off the net and it contains
commands to delete all your files then you would be unhappy. The
standard settings in modern distributions turn off full shell
access. You can turn it on, if you are sure the shell commands are
safe, by compiling with <code>latex --enable-write18 <var>filename</var></code>
(<pxref label="Command-line-options"><xrefnodename>Command line options</xrefnodename></pxref>).  (The <code>--shell-escape</code> option is
a synonym, in &tex; Live.)
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1139">restricted shell access</indexterm></cindex>
<para>In the place of full shell access, modern distributions by default use
a restricted version that allows some commands to work, such as those
that run Metafont to generate missing fonts, even if you do not use
the <code>enable-write18</code> option. By default this list of allowed
commands is short and features only commands that are under the
control of the distribution maintainers (<pxref label="Command-line-options"><xrefnodename>Command line
options</xrefnodename></pxref>).
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="1230" mergedindex="cp">/bin/sh<r>, used by <code>\write18</code></r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1231" mergedindex="cp">sh<r>, used by <code>\write18</code></r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1232" mergedindex="cp">cmd.exe<r>, used by <code>\write18</code></r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1233" mergedindex="cp">SHELL<r>, environment variables</r></indexterm></findex>
<para>The <var>shell_command</var> text is always passed to <file>/bin/sh</file> on
Unix-like operating systems, and the DOS command interpreter
<file>cmd.exe</file> on Windows. Any different shell set by the user, and
the <code>SHELL</code> environment variable, is ignored.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1140"><r>package</r>, <code>texosquery</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1141"><code>texosquery</code> <r>package</r></indexterm></cindex>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1142">system information</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1143">operating system information</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1144">locale information, from system</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1145">directory listings, from system</indexterm></cindex>
<para>If what you need is system information, such as the operating system
name, locale information, or directory contents, take a look at the
<code>texosquery</code> package, which provides a convenient and secure
interface for this, unlike the above examples using the raw
<code>\write18</code>: <url><urefurl>https://ctan.org/pkg/texosquery</urefurl></url>.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1146"><r>package</r>, <code>shellesc</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1147"><code>shellesc</code> <r>package</r></indexterm></cindex>

<findex index="fn" spaces=" "><indexterm index="fn" number="1234" mergedindex="cp">\ShellEscape</indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1235" mergedindex="cp">\DelayedShellEscape</indexterm></findex>
<para>&latex; provides a package <code>shellesc</code> on top of the primitive
<code>\write18</code> command. Its primary purpose is to provide a command
<code>\ShellEscape</code> which works identically on all &tex; engines;
Lua&tex; intentionally did not retain <code>\write18</code> as a way to
invoke a shell command, so some engine-specific code is needed. The
<code>shellesc</code> package also provides a command
<code>\DelayedShellEscape</code>, executed at <code>\output</code> time, for the
same reason.
</para>

</subsection>
</section>
</chapter>
<node name="Command-line-interface" spaces=" "><nodename>Command line interface</nodename><nodenext automatic="on">Document templates</nodenext><nodeprev automatic="on">Input/output</nodeprev><nodeup automatic="on">Top</nodeup></node>
<chapter spaces=" "><sectiontitle>Command line interface</sectiontitle>

<anchor name="Command-line">Command line</anchor><!-- c old name -->
<cindex index="cp" spaces=" "><indexterm index="cp" number="1148">command line interface</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1149">interface, command line</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1150">CLI</indexterm></cindex>

<para>Synopsis (from a terminal command line):
</para>
<example endspaces=" ">
<pre xml:space="preserve">pdflatex <var>options</var> <var>argument</var>
</pre></example>

<para>Run &latex; on <var>argument</var>.  In place of <command>pdflatex</command> you
can also use (for PDF output) <command>xelatex</command> or <code>lualatex</code>, or
(for DVI output) <code>latex</code> or <code>dvilualatex</code>, among others
(<pxref label="TeX-engines"><xrefnodename>&tex; engines</xrefnodename></pxref>).
</para>
<para>For example, this will run &latex; on the file <file>thesis.tex</file>,
creating the output <file>thesis.pdf</file>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">pdflatex thesis
</pre></example>

<noindent></noindent>
<para><findex index="fn" spaces=" "><indexterm index="fn" number="1236" mergedindex="cp">.tex, <r>default extension</r></indexterm></findex>
Note that <file>.tex</file> is the default file name extension.
</para>
<para>pdf&tex; is an extension of the original &tex; program, as are
Xe&tex; and Lua&tex; (<pxref label="TeX-engines"><xrefnodename>&tex; engines</xrefnodename></pxref>).  The first two are
completely backward compatible and the latter, almost so.  Perhaps the
most fundamental new feature for all three is that the original &tex;
output its own DVI format, 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</command> or <command>xelatex</command> or <command>lualatex</command> then you
will by default get PDF and have access to all its modern features.
If you run <command>latex</command>, or <code>dvilualatex</code>, then you will get
DVI.  The description here assumes pdf&latex;.
</para>
<para><xref label="Command-line-options"><xrefnodename>Command line options</xrefnodename></xref>, for a selection of the most useful
command line options. As to <var>argument</var>, 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</var> begins with a
backslash then the system will interpret it as a line of &latex;
input, which can be used for special effects (<pxref label="Command-line-input"><xrefnodename>Command line
input</xrefnodename></pxref>).
</para>
<para>If you gave no arguments or options then <command>pdflatex</command> prompts for
input from the terminal. You can escape from this by entering
<kbd>CTRL-D</kbd>.
</para>
<para>If &latex; finds an error in your document then by default it stops and
asks you about it.  <xref label="Recovering-from-errors"><xrefnodename>Recovering from errors</xrefnodename></xref>, for an outline of what
to do.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::     ">Command line options</menunode><menudescription><pre xml:space="preserve">Commonly used command line options.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::       ">Command line input</menunode><menudescription><pre xml:space="preserve">Specify LaTeX code on the command line.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::                  ">Jobname</menunode><menudescription><pre xml:space="preserve">How &tex; sets the current job name.
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::   ">Recovering from errors</menunode><menudescription><pre xml:space="preserve">When something goes wrong.
</pre></menudescription></menuentry></menu>


<node name="Command-line-options" spaces=" "><nodename>Command line options</nodename><nodenext automatic="on">Command line input</nodenext><nodeup automatic="on">Command line interface</nodeup></node>
<section spaces=" "><sectiontitle>Command line options</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1151">options, command line</indexterm></cindex>

<para>These are the command-line options relevant to ordinary document
authoring. For a full list, try running <samp>latex --help</samp> from the
command line.
</para>
<para>With many implementations you can specify command line options by
prefixing them with <samp>-</samp> or <samp>--</samp>.  This is the case for both
&tex; Live (including Mac&tex;) and MiK&tex;.  We will use both
conventions interchangeably.  If an option takes a value, it can be
specified either as a separate argument (<samp>--foo val</samp>), or as one
argument with an <samp>=</samp> sign (<samp>--foo=val</samp>), but there can be no
spaces around the <samp>=</samp>. We will generally use the <samp>=</samp> syntax.
</para>
<table commandarg="code" spaces=" " endspaces=" ">
<beforefirstitem><findex index="fn" spaces=" "><indexterm index="fn" number="1237" mergedindex="cp">--version <r>command-line option</r></indexterm></findex>
</beforefirstitem><tableentry><tableterm><item spaces=" "><itemformat command="code">-version</itemformat></item>
</tableterm><tableitem><para>Show the current version, like <samp>pdfTeX 3.14159265-2.6-1.40.16 (TeX
Live 2015/Debian)</samp> along with a small amount of additional information,
and exit.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="1238" mergedindex="cp">--help <r>command-line option</r></indexterm></findex>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">-help</itemformat></item>
</tableterm><tableitem><para>Give a brief usage message that is useful as a prompt and exit.
</para>
<anchor name="interaction-modes">interaction modes</anchor>
<findex index="fn" spaces=" "><indexterm index="fn" number="1239" mergedindex="cp">--interaction <r>command-line option</r></indexterm></findex>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">-interaction=<var>mode</var></itemformat></item>
</tableterm><tableitem><cindex index="cp" spaces=" "><indexterm index="cp" number="1152">batchmode</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1153">scrollmode</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1154">errorstopmode</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1155">nonstopmode</indexterm></cindex>
<para>&tex; compiles a document in one of four interaction modes:
<code>batchmode</code>, <code>nonstopmode</code>, <code>scrollmode</code>,
<code>errorstopmode</code>. In <dfn>errorstopmode</dfn> (the default), &tex;
stops at each error and asks for user intervention. In <dfn>batchmode</dfn>
it prints nothing on the terminal, errors are scrolled as if the user
hit <kbd>RETURN</kbd> at every error, and missing files cause the job to
abort. In <dfn>nonstopmode</dfn>, diagnostic message appear on the terminal
but as in batch mode there is no user interaction. In
<dfn>scrollmode</dfn>, &tex; stops for missing files or keyboard
input, but nothing else.
</para>
<para>For instance, starting &latex; with this command line
</para>
<example endspaces=" ">
<pre xml:space="preserve">pdflatex -interaction=batchmode <var>filename</var>
</pre></example>

<noindent></noindent>
<para>eliminates most terminal output.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1156">jobname</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1157">filename for current job</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1240" mergedindex="cp">--jobname <r>command-line option</r></indexterm></findex>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">-jobname=<var>string</var></itemformat></item>
</tableterm><tableitem><para>Set the value of &tex;&textrsquo;s <dfn>jobname</dfn> to the string.  The log file
and output file will then be named <file><var>string</var>.log</file> and
<file><var>string</var>.pdf</file>.  <pxref label="Jobname"><xrefnodename>Jobname</xrefnodename></pxref>.
</para>
<anchor name="output-directory">output directory</anchor>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1158">output directory for all external files</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1241" mergedindex="cp">--output-directory <r>command-line option</r></indexterm></findex>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">-output-directory=<var>directory</var></itemformat></item>
</tableterm><tableitem><para>Write files in the directory <var>directory</var>.  It must already exist.
This applies to all external files created by &tex; or &latex;, such
as the <file>.log</file> file for the run, the <file>.aux</file>, <file>.toc</file>,
etc., files created by &latex;, as well as the main <file>.pdf</file> or
<file>.dvi</file> output file itself.
</para>
<para>When specified, the output directory <var>directory</var> is also
automatically checked first for any file that it is input, so that the
external files can be read back in, if desired. The true current
directory (in which &latex; was run) remains unchanged, and is also
checked for input files.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1159">shell escape</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1160"><code>\write18</code>, enabling</indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1242" mergedindex="cp">--enable-write18 <r>command-line option</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1243" mergedindex="cp">--disable-write18 <r>command-line option</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1244" mergedindex="cp">--shell-escape <r>command-line option</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1245" mergedindex="cp">--no-shell-escape <r>command-line option</r></indexterm></findex>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">--enable-write18</itemformat></item>
<itemx spaces=" "><itemformat command="code">--disable-write18</itemformat></itemx>
<itemx spaces=" "><itemformat command="code">--shell-escape</itemformat></itemx>
<itemx spaces=" "><itemformat command="code">--no-shell-escape</itemformat></itemx>
</tableterm><tableitem><para>Enable or disable <code>\write18&lbrace;<var>shell_command</var>&rbrace;</code>
(<pxref label="_005cwrite18"><xrefnodename>\write18</xrefnodename></pxref>).  The first two options are supported by both
&tex; Live and MiK&tex;, while the second two are synonyms supported
by &tex; Live.
</para>
<para>Enabling this functionality has major security implications, since it
allows a &latex; file to run any command whatsoever.  Thus, by
default, unrestricted <code>\write18</code> is not allowed.  (The default
for &tex; Live, Mac&tex;, and MiK&tex; is to allow the execution of
a limited number of &tex;-related programs, which they distribute.)
</para>
<para>For example, if you invoke &latex; with the option
<code>no-shell-escape</code>, and in your document you call
<code>\write18&lbrace;ls -l&rbrace;</code>, then you do not get an error but the log
file says <samp>runsystem(ls -l)...disabled</samp>.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="1246" mergedindex="cp">--halt-on-error <r>command-line option</r></indexterm></findex>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">-halt-on-error</itemformat></item>
</tableterm><tableitem><para>Stop processing at the first error.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="1247" mergedindex="cp">--file-line-error <r>command-line option</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1248" mergedindex="cp">--no-file-line-error <r>command-line option</r></indexterm></findex>
</tableitem></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">-file-line-error</itemformat></item>
</tableterm></tableentry><tableentry><tableterm><item spaces=" "><itemformat command="code">-no-file-line-error</itemformat></item>
</tableterm><tableitem><para>Enable or disable <code><var>filename</var>:<var>lineno</var>:<var>error</var></code>-style
error messages.  These are only available with &tex; Live or Mac&tex;.
</para></tableitem></tableentry></table>


</section>
<node name="Command-line-input" spaces=" "><nodename>Command line input</nodename><nodenext automatic="on">Jobname</nodenext><nodeprev automatic="on">Command line options</nodeprev><nodeup automatic="on">Command line interface</nodeup></node>
<section spaces=" "><sectiontitle>Command line input</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1161">input, on command line</indexterm></cindex>

<para>As part of the command line invocation
</para>
<example endspaces=" ">
<pre xml:space="preserve"><var>latex-engine</var> <var>options</var> <var>argument</var>
</pre></example>

<noindent></noindent><para>you can specify arbitrary &latex; input by starting
<var>argument</var> with a backslash. (All the engines support this.) This
allows you to do some special effects.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1162"><r>package</r>, <code>hyperref</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1163"><code>hyperref</code> <r>package</r></indexterm></cindex>
 <para>For example, this file (which uses the
<code>hyperref</code> package for hyperlinks) can produce two kinds of
output, one to be read on physical paper and one to be read online.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\ifdefined\paperversion        % in preamble
\newcommand&lbrace;\urlcolor&rbrace;&lbrace;black&rbrace;
\else
\newcommand&lbrace;\urlcolor&rbrace;&lbrace;blue&rbrace;
\fi
\usepackage[colorlinks=true,urlcolor=\urlcolor]&lbrace;hyperref&rbrace;
  ...
\href&lbrace;https://www.ctan.org&rbrace;&lbrace;CTAN&rbrace;  % in body
  ...
</pre></example> 

<noindent></noindent>
<para>Compiling this document <file>book.tex</file> with the command line
<code>pdflatex book</code> will give the <samp>CTAN</samp> link in blue.  But
compiling it with
</para>
<example endspaces=" ">
<pre xml:space="preserve">pdflatex &quot;\def\paperversion&lbrace;&rbrace;\input book.tex&quot;
</pre></example>

<noindent></noindent><para>has the link in black.  We use double quotes to prevent
interpretation of the symbols by the command line shell. (This
usually works on both Unix and Windows systems, but there are many
peculiarities to shell quoting, so read your system documentation if
need be.)
</para>
<para>In a similar way, from the single file <file>main.tex</file> you can compile
two different versions.
</para>
<!-- c credit Paul Gaborit: https://tex.stackexchange.com/a/220101/121234 -->
<example endspaces=" ">
<pre xml:space="preserve">pdflatex -jobname=students &quot;\def\student&lbrace;&rbrace;\input&lbrace;main&rbrace;&quot;
pdflatex -jobname=teachers &quot;\def\teachers&lbrace;&rbrace;\input&lbrace;main&rbrace;&quot;
</pre></example>

<noindent></noindent>
<para>The <code>jobname</code> option is there because otherwise both files would be
called <file>main.pdf</file> and the second would overwrite the
first. (<pxref label="Jobname"><xrefnodename>Jobname</xrefnodename></pxref>.)
</para>
<para>In this example we use the command line to select which parts of a
document to include.  For a book named <file>mybook.tex</file> and structured
like this.
</para>
<example endspaces=" ">
<pre xml:space="preserve">\documentclass&lbrace;book&rbrace;
\begin&lbrace;document&rbrace;
   ...
\include&lbrace;chap1&rbrace; 
\include&lbrace;chap2&rbrace;
  ...
\end&lbrace;document&rbrace;
</pre></example>

<noindent></noindent>
<para>the command line
</para>
<example endspaces=" ">
<pre xml:space="preserve">pdflatex &quot;\includeonly&lbrace;chap1&rbrace;\input&lbrace;mybook&rbrace;&quot;
</pre></example>

<noindent></noindent>
<para>will give output that has the first chapter but no other
chapter. <xref label="Splitting-the-input"><xrefnodename>Splitting the input</xrefnodename></xref>.
</para>

</section>
<node name="Jobname" spaces=" "><nodename>Jobname</nodename><nodenext automatic="on">Recovering from errors</nodenext><nodeprev automatic="on">Command line input</nodeprev><nodeup automatic="on">Command line interface</nodeup></node>
<section spaces=" "><sectiontitle>Jobname</sectiontitle>

<findex index="fn" spaces=" "><indexterm index="fn" number="1249" mergedindex="cp"><code>\jobname</code></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1164">jobname</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1165">document root name</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1166">name of document root</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1167">root file</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1168">file, root</indexterm></cindex>

<para>Running &latex; creates a number of files, including the main PDF (or
DVI) output but also including others.  These files are named with the
so-called <dfn>jobname</dfn>.  The most common case is also the simplest,
where for instance the command <code>pdflatex thesis</code> creates
<code>thesis.pdf</code> and also <code>thesis.log</code> and <code>thesis.aux</code>.
Here the job name is <code>thesis</code>.
</para>
<para>In general, &latex; is invoked as <code><var>latex-engine</var>
<var>options</var> <var>argument</var></code>, where <var>latex-engine</var> is
<command>pdflatex</command>, <command>lualatex</command>, etc.&noeos; (<pxref label="TeX-engines"><xrefnodename>&tex; engines</xrefnodename></pxref>).
If <var>argument</var> does not start with a backslash, as is the case above
with <code>thesis</code>, then &tex; considers it to be the name of the file
to input as the main document. This file is referred to as the <dfn>root
file</dfn> (<pxref label="Splitting-the-input"><xrefnodename>Splitting the input</xrefnodename></pxref>, and&nbsp;<ref label="_005cinput"><xrefnodename>\input</xrefnodename></ref>). The name of
that root file, without the <file>.tex</file> extension if any, is the
jobname.  If <var>argument</var> does start with a backslash, or if &tex; is
in interactive mode, then it waits for the first <code>\input</code> command,
and the jobname is the argument to <code>\input</code>.
</para>
<para>There are two more possibilities for the jobname.  It can be directly
specified with the <code>-jobname</code> option, as in <code>pdflatex
-jobname=myname</code> (<pxref label="Command-line-input"><xrefnodename>Command line input</xrefnodename></pxref> for a real example).
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="1250" mergedindex="cp">texput<r>, jobname default</r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1169">fallback jobname</indexterm></cindex>
<para>The final possibility is <file>texput</file>, which is the final fallback
default if no other name is available to &tex;.  That is, if no
<code>-jobname</code> option was specified, and the compilation stops before
any input file is met, then the log file will be named
<file>texput.log</file>.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="1251" mergedindex="cp">\documentclass<r>, and <code>texput</code> jobname</r></indexterm></findex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1252" mergedindex="cp">\RequirePackage<r>, and <code>texput</code> jobname</r></indexterm></findex>
<para>A special case of this is that in &latex; versions of (approximately)
2020 or later, the jobname is also <file>texput</file> if the first
<code>\input</code> occurs as a result of being called by either
<code>\documentclass</code> or <code>\RequirePackage</code>.  So this will produce
a file named <file>texput.pdf</file>:
</para>
<example endspaces=" ">
<pre xml:space="preserve">pdflatex &quot;\documentclass&lbrace;minimal&rbrace;\begin&lbrace;document&rbrace;Hello!\end&lbrace;document&rbrace;&quot;
</pre></example>

<para>However, this special case only applies to those two commands.  Thus, with
</para>
<!-- c credit Herbert Voss: https://tex.stackexchange.com/a/17236/121234 -->
<example endspaces=" ">
<pre xml:space="preserve">pdflatex &quot;\documentclass&lbrace;article&rbrace;\usepackage&lbrace;lipsum&rbrace;\input&lbrace;thesis&rbrace;&quot;
</pre></example>

<noindent></noindent>
<para>the output file is <file>lipsum.pdf</file>, as <code>\usepackage</code> calls
<code>\input</code>.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="1253" mergedindex="cp">\jobname</indexterm></findex>
<para>Within the document, the macro <code>\jobname</code> expands to the jobname.
(When you run &latex; on a file whose name contains spaces, the string
returned by <code>\jobname</code> contains matching start and end quotes.)
In the expansion of that macro, all characters are of
catcode&nbsp;12 (other) except that spaces are category&nbsp;10,
including letters that are normally catcode&nbsp;11.
</para>
<findex index="fn" spaces=" "><indexterm index="fn" number="1254" mergedindex="cp">\IfBeginWith*<r> macro from <file>xstring</file></r></indexterm></findex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1170"><r>package</r>, <code>xstring</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1171"><code>xstring</code> <r>package</r></indexterm></cindex>

<para>Because of this catcode situation, using the jobname in a conditional
can become complicated. One solution is to use the macro
<code>\IfBeginWith</code> from the <file>xstring</file> package in its star
variant, which is insensitive to catcode. For example, in the
following text the footnote &textldquo;Including Respublica Bananensis
Francorum.&textrdquo;&noeos; is only present if the task name starts with
<file>my-doc</file>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">If a democracy is just a regime where citizens vote then
all banana republics \IfBeginWith*&lbrace;\jobname&rbrace;&lbrace;my-doc&rbrace;%
&lbrace;\footnote&lbrace;Including Respublica Bananensis Francorum.&rbrace;&rbrace;&lbrace;&rbrace; are
democracies.
</pre></example>

<para>Manipulating the value of <code>\jobname</code> inside of a document does not
change the name of the output file or the log file.
</para>

</section>
<node name="Recovering-from-errors" spaces=" "><nodename>Recovering from errors</nodename><nodeprev automatic="on">Jobname</nodeprev><nodeup automatic="on">Command line interface</nodeup></node>
<section spaces=" "><sectiontitle>Recovering from errors</sectiontitle>

<para>If &latex; finds an error in your document then it gives you an error
message and prompts you with a question mark, <code>?</code>.  For instance,
running &latex; on this file
</para>
<example endspaces=" ">
<pre xml:space="preserve">\newcommand&lbrace;\NP&rbrace;&lbrace;\ensuremath&lbrace;\textbf&lbrace;NP&rbrace;&rbrace;&rbrace;
The \PN&lbrace;&rbrace; problem is a million dollar one.
</pre></example>

<noindent></noindent>
<para>causes it show this, and wait for input.
</para>
<example endspaces=" ">
<pre xml:space="preserve">! Undefined control sequence.
l.5 The \PN
           &lbrace;&rbrace; problem is a million dollar one.
? 
</pre></example>

<noindent></noindent>
<para>The simplest thing is to enter <kbd>x</kbd> and <kbd>RETURN</kbd> and fix the
typo.  You could instead enter <kbd>?</kbd> and <kbd>RETURN</kbd> to see other
options.
</para>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1172"><samp>*</samp> prompt</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1173">prompt, <samp>*</samp></indexterm></cindex>
<findex index="fn" spaces=" "><indexterm index="fn" number="1255" mergedindex="cp">\stop</indexterm></findex>
<para>There are two other error scenarios.  The first is that you forgot to
include the <code>\end&lbrace;document&rbrace;</code> or misspelled it.  In this case
&latex; gives you a <samp>*</samp> prompt.  You can get back to the command
line by typing <kbd>\stop</kbd> and <kbd>RETURN</kbd>; this command does its
best to exit &latex; immediately, whatever state it may be in.
</para>
<para>The last scenario is that you mistyped the filename.  For instance,
instead of <code>pdflatex test</code> you might type <code>pdflatex tste</code>.
</para>
<example endspaces=" ">
<pre xml:space="preserve">! I can't find file `tste'.
&lt;*&gt; tste
        
(Press Enter to retry, or Control-D to exit)
Please type another input file name:
</pre></example>

<noindent></noindent>
<para>The simplest thing is to enter <kbd>CTRL d</kbd> (holding the Control and d
keys down at the same time), and then retype the correct command line.
</para>

</section>
</chapter>
<node name="Document-templates" spaces=" "><nodename>Document templates</nodename><nodenext automatic="on">Index</nodenext><nodeprev automatic="on">Command line interface</nodeprev><nodeup automatic="on">Top</nodeup></node>
<appendix spaces=" "><sectiontitle>Document templates</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1174">document templates</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1175">templates, document</indexterm></cindex>

<para>Although illustrative material, perhaps these document templates will
be useful.  Additional template resources are listed at
<url><urefurl>https://tug.org/interest.html#latextemplates</urefurl></url>.
</para>
<menu endspaces=" ">
<menuentry leadingtext="* "><menunode separator="::">beamer template</menunode><menudescription><pre xml:space="preserve">
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::">article template</menunode><menudescription><pre xml:space="preserve">
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::">book template</menunode><menudescription><pre xml:space="preserve">
</pre></menudescription></menuentry><menuentry leadingtext="* "><menunode separator="::">Larger book template</menunode><menudescription><pre xml:space="preserve">
</pre></menudescription></menuentry></menu>


<node name="beamer-template" spaces=" "><nodename>beamer template</nodename><nodenext automatic="on">article template</nodenext><nodeup automatic="on">Document templates</nodeup></node>
<section spaces=" "><sectiontitle><code>beamer</code> template</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1176"><code>beamer</code> template and class</indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1177">template, <code>beamer</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1178"><r>package</r>, <code>beamer</code></indexterm></cindex>
<cindex index="cp" spaces=" "><indexterm index="cp" number="1179"><code>beamer</code> <r>package</r></indexterm></cindex>


<para>The <code>beamer</code> class creates presentation slides.  It has a vast
array of features, but here is a basic template:
</para>
<verbatim xml:space="preserve">
\documentclass{beamer}

\title{Beamer Class template}
\author{Alex Author}
\date{July 31, 2020}

\begin{document}

\maketitle

% without [fragile], any {verbatim} code gets mysterious errors.
\begin{frame}[fragile]
 \frametitle{First Slide}

\begin{verbatim}
  This is \verbatim!
\end{verbatim}

\end{frame}

\end{document}
</verbatim>

<para>The Beamer package on CTAN: <url><urefurl>https://ctan.org/pkg/beamer</urefurl></url>.
</para>

</section>
<node name="article-template" spaces=" "><nodename>article template</nodename><nodenext automatic="on">book template</nodenext><nodeprev automatic="on">beamer template</nodeprev><nodeup automatic="on">Document templates</nodeup></node>
<section spaces=" "><sectiontitle><code>article</code> template</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1180">template (simple), <code>article</code></indexterm></cindex>

<para>A simple template for an article.
</para>
<verbatim xml:space="preserve">
\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}
</verbatim>


</section>
<node name="book-template" spaces=" "><nodename>book template</nodename><nodenext automatic="on">Larger book template</nodenext><nodeprev automatic="on">article template</nodeprev><nodeup automatic="on">Document templates</nodeup></node>
<section spaces=" "><sectiontitle><code>book</code> template</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1181">template, <code>book</code></indexterm></cindex>

<para>This is a straightforward template for a book.  <xref label="Larger-book-template"><xrefnodename>Larger book
template</xrefnodename></xref>, for a more elaborate one.
</para>
<verbatim xml:space="preserve">
\documentclass{book}
\title{Book Class Template}
\author{Alex Author}

\begin{document}
\maketitle

\chapter{First}
Some text.

\chapter{Second}
Some other text.

\section{A subtopic}
The end.

\end{document}
</verbatim>


</section>
<node name="Larger-book-template" spaces=" "><nodename>Larger book template</nodename><nodeprev automatic="on">book template</nodeprev><nodeup automatic="on">Document templates</nodeup></node>
<section spaces=" "><sectiontitle>Larger <code>book</code> template</sectiontitle>

<cindex index="cp" spaces=" "><indexterm index="cp" number="1182">template, <code>book</code></indexterm></cindex>

<para>This is a somewhat elaborate template for a book.  <xref label="book-template"><xrefnodename>book template</xrefnodename></xref>,
for a simpler one.
</para>
<para>This template uses <code>\frontmatter</code>, <code>\mainmatter</code>, and
<code>\backmatter</code> to control the typography of the three main areas
of a book (<pxref label="_005cfrontmatter-_0026-_005cmainmatter-_0026-_005cbackmatter"><xrefnodename>\frontmatter &amp; \mainmatter &amp; \backmatter</xrefnodename></pxref>).  The
book has a bibliography and an index.
</para>
<para>Also notable is that it uses <code>\include</code> and <code>\includeonly</code>
(<pxref label="Splitting-the-input"><xrefnodename>Splitting the input</xrefnodename></pxref>).  While you are working on a chapter you
can comment out all the other chapter entries from the argument to
<code>\includeonly</code>.  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</code> instead of
<code>\include</code>.  You don&textrsquo;t get the cross-reference benefit with
<code>\input</code>.)
</para>
<verbatim xml:space="preserve">
\documentclass[titlepage]{book}
\usepackage{makeidx}\makeindex

\title{Book Class Template}
\author{Alex Author}

\includeonly{%
% frontcover,
  preface,
  chap1,
% appenA,
  }

\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}
</verbatim>


</section>
</appendix>
<node name="Index" spaces=" "><nodename>Index</nodename><nodeprev automatic="on">Document templates</nodeprev><nodeup automatic="on">Top</nodeup></node>
<unnumbered spaces=" "><sectiontitle>Index</sectiontitle>

<!-- c Keep `Command Index' working for ltx-help.el. -->
<anchor name="Command-Index">Command Index</anchor>

<printindex value="cp" line="cp"></printindex>

</unnumbered>
<bye></bye>
</texinfo>
