1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This document is an unofficial reference manual for LaTeX, a
document preparation system, version of October 2018.
This manual was originally translated from LATEX.HLP v1.0a in the
VMS Help Library. The pre-translation version was written by
George D. Greenwade of Sam Houston State University. The
LaTeX 2.09 version was written by Stephen Gilmore. The
LaTeX2e version was adapted from this by Torsten Martinsen. Karl
Berry made further updates and additions, and gratefully acknowledges
using Hypertext Help with LaTeX, by Sheldon Green, and
LaTeX Command Summary (for LaTeX 2.09) by
L. Botway and C. Biemesderfer (published by the TeX Users
Group as TeXniques 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.)
Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2013,
2014, 2015, 2016, 2017, 2018 Karl Berry.
Copyright 1988, 1994, 2007 Stephen Gilmore.
Copyright 1994, 1995, 1996 Torsten Martinsen.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.
Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions. -->
<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Overview (LaTeX2e unofficial reference manual (October 2018))</title>
<meta name="description" content="Overview (LaTeX2e unofficial reference manual (October 2018))">
<meta name="keywords" content="Overview (LaTeX2e unofficial reference manual (October 2018))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="latex2e_0.html#Top" rel="start" title="Top">
<link href="latex2e_30.html#Index" rel="index" title="Index">
<link href="latex2e_0.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="latex2e_0.html#Top" rel="up" title="Top">
<link href="latex2e_3.html#Document-classes" rel="next" title="Document classes">
<link href="latex2e_1.html#About-this-document" rel="prev" title="About this document">
<style type="text/css">
<!--
body {margin: 1em; margin-top: 0px; padding-top: 1px}
a.anchor {float: right}
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body id="top" lang="en">
<a name="Overview" class="anchor"></a>
<a name="Overview-of-LaTeX" class="anchor"></a>
<h2 class="chapter">Overview of LaTeX</h2>
<a name="index-overview-of-LaTeX" class="anchor"></a>
<a name="index-basics-of-LaTeX" class="anchor"></a>
<a name="index-Knuth_002c-Donald-E_002e" class="anchor"></a>
<a name="index-Lamport_002c-Leslie" class="anchor"></a>
<a name="index-LaTeX-overview" class="anchor"></a>
<p>LaTeX is a system for typesetting documents. It was originally
created by Leslie Lamport and is now maintained by a group of volunteers
(<a class="external" href="http://latex-project.org">http://latex-project.org</a>). It is widely used, particularly for
complex and technical documents, such as those involving mathematics.
</p>
<a name="index-macro-package_002c-LaTeX-as" class="anchor"></a>
<p>A LaTeX user writes an input file containing text along with
interspersed commands, for instance commands describing how the text
should be formatted. It is implemented as a set of related commands
that interface with Donald E. Knuth’s TeX typesetting program
(the technical term is that LaTeX is a <em>macro package</em> for the
TeX engine). The user produces the output document by giving that
input file to the TeX engine.
</p>
<p>The term LaTeX is also sometimes used to mean the language in which
the document is marked up, that is, to mean the set of commands
available to a LaTeX user.
</p>
<a name="index-Lamport-TeX" class="anchor"></a>
<a name="index-pronunciation" class="anchor"></a>
<p>The name LaTeX is short for “Lamport TeX”. 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>’.
</p>
<hr>
<a name="Starting-and-ending" class="anchor"></a>
<a name="Starting-and-ending-1" class="anchor"></a>
<h3 class="section">Starting and ending</h3>
<a name="Starting-_0026-ending" class="anchor"></a><a name="index-starting-and-ending" class="anchor"></a>
<a name="index-ending-and-starting" class="anchor"></a>
<a name="index-hello_002c-world" class="anchor"></a>
<p>LaTeX files have a simple global structure, with a standard beginning
and ending. This is a small example.
</p>
<div class="example">
<pre class="example">\documentclass{article}
\begin{document}
Hello, \LaTeX\ world.
\end{document}
</pre></div>
<p>Every LaTeX document has a <code>\begin{document}</code> line and an
<code>\end{document}</code> line.
</p>
<a name="index-document-class_002c-defined" class="anchor"></a>
<p>Here, the ‘<samp>article</samp>’ is the <em>document class</em>. It is implemented
in a file <samp>article.cls</samp>. 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. See <a href="latex2e_3.html#Document-classes">Document classes</a>.
</p>
<a name="index-preamble_002c-defined" class="anchor"></a>
<p>You can include other LaTeX commands between the
<code>\documentclass</code> and the <code>\begin{document}</code> commands.
This area is called the <em>preamble</em>.
</p>
<p>The <code>\begin{document}</code>, <code>\end{document}</code> pair defines an
<a name="index-environment" class="anchor"></a>
<em>environment</em>; the ‘<samp>document</samp>’ environment (and no others) is
required in all LaTeX documents (see <a href="latex2e_8.html#document">document</a>). LaTeX make
available to you many environments that are documented here
(see <a href="latex2e_8.html#Environments">Environments</a>). Many more are available to you from external
packages, most importantly those available at CTAN (see <a href="#CTAN">CTAN</a>).
</p>
<p>The following sections discuss how to produce PDF or other output from
a LaTeX input file.
</p>
<hr>
<a name="Output-files" class="anchor"></a>
<a name="Output-files-1" class="anchor"></a>
<h3 class="section">Output files</h3>
<p>LaTeX produces a main output file and at least two auxiliary files.
The main output file’s name ends in either <samp>.dvi</samp> or <samp>.pdf</samp>.
</p>
<dl compact="compact">
<dt><code>.dvi</code></dt>
<dd><a name="index-_002edvi-file" class="anchor"></a>
<a name="index-latex-command" class="anchor"></a>
<a name="index-xdvi-command" class="anchor"></a>
<a name="index-dvips-command" class="anchor"></a>
<a name="index-dvipdfmx-command" class="anchor"></a>
<a name="index-dvitype-command" class="anchor"></a>
<a name="output-files-dvi" class="anchor"></a><p>If LaTeX is invoked with the system command <code>latex</code> then it
produces a DeVice Independent file, with extension <samp>.dvi</samp>. You
can view this file with a command such as <code>xdvi</code>, or convert
it to a PostScript <code>.ps</code> file with <code>dvips</code> or to a
Portable Document Format <code>.pdf</code> file with <code>dvipdfmx</code>.
The contents of the file can be dumped in human-readable form with
<code>dvitype</code>. A vast array of other DVI utility programs are
available (<a class="external" href="http://mirror.ctan.org/dviware">http://mirror.ctan.org/dviware</a>).
</p>
</dd>
<dt><code>.pdf</code></dt>
<dd><a name="index-_002epdf-file" class="anchor"></a>
<a name="index-pdfTeX" class="anchor"></a>
<a name="index-pdflatex-command" class="anchor"></a>
<a name="output-files-pdf" class="anchor"></a><p>If LaTeX is invoked via the system command <code>pdflatex</code>,
among other commands (see <a href="#TeX-engines">TeX engines</a>), then the main output is
a Portable Document Format (PDF) file. Typically this is a
self-contained file, with all fonts and images included.
</p>
</dd>
</dl>
<p>LaTeX also produces at least two additional files.
</p>
<dl compact="compact">
<dt><code>.log</code></dt>
<dd><a name="index-transcript-file" class="anchor"></a>
<a name="index-log-file" class="anchor"></a>
<a name="index-_002elog-file" class="anchor"></a>
<a name="output-files-log" class="anchor"></a><p>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.
</p>
</dd>
<dt><code>.aux</code></dt>
<dd><a name="index-auxiliary-file" class="anchor"></a>
<a name="index-_002eaux-file" class="anchor"></a>
<a name="index-cross-references_002c-resolving" class="anchor"></a>
<a name="index-forward-references_002c-resolving" class="anchor"></a>
<a name="index-references_002c-resolving-forward" class="anchor"></a>
<a name="output-files-aux" class="anchor"></a><p>Auxiliary information is used by LaTeX for things such as
cross references. For example, the first time that LaTeX finds a
forward reference—a cross reference to something that has not yet
appeared in the source—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.
</p>
</dd>
</dl>
<a name="index-_002elof-file" class="anchor"></a>
<a name="index-list-of-figures-file" class="anchor"></a>
<a name="index-_002elot-file" class="anchor"></a>
<a name="index-list-of-tables-file" class="anchor"></a>
<a name="index-_002etoc-file" class="anchor"></a>
<a name="index-table-of-contents-file" class="anchor"></a>
<a name="index-contents-file" class="anchor"></a>
<p>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 (see <a href="latex2e_25.html#Table-of-contents-etc_002e">Table of contents etc.</a>). A particular class may create others; the list is
open-ended.
</p>
<hr>
<a name="TeX-engines" class="anchor"></a>
<a name="TeX-engines-1" class="anchor"></a>
<h3 class="section">TeX engines</h3>
<a name="index-engines_002c-TeX" class="anchor"></a>
<a name="index-implementations-of-TeX" class="anchor"></a>
<a name="index-UTF_002d8" class="anchor"></a>
<a name="index-Unicode-input_002c-native" class="anchor"></a>
<a name="index-TrueType-fonts" class="anchor"></a>
<a name="index-OpenType-fonts" class="anchor"></a>
<p>LaTeX is defined to be a set of commands that are run by a TeX
implementation (see <a href="#Overview">Overview</a>). This section gives a terse
overview of the main programs (see also <a href="latex2e_28.html#Command-line">Command line</a>).
</p>
<dl compact="compact">
<dt><code>latex</code></dt>
<dt><code>pdflatex</code></dt>
<dd><a name="index-pdfTeX-engine" class="anchor"></a>
<a name="index-etex-command" class="anchor"></a>
<a name="index-e_002dTeX" class="anchor"></a>
<a name="tex-engines-latex" class="anchor"></a><p>In TeX Live (<a class="external" href="http://tug.org/texlive">http://tug.org/texlive</a>), if LaTeX is invoked
via either the system command <code>latex</code> or <code>pdflatex</code>,
then the pdfTeX engine is run (<a class="external" href="http://ctan.org/pkg/pdftex">http://ctan.org/pkg/pdftex</a>).
When invoked as <code>latex</code>, the main output is a <samp>.dvi</samp>
file; as <code>pdflatex</code>, the main output is a <samp>.pdf</samp> file.
</p>
<p>pdfTeX incorporates the e-TeX extensions to Knuth’s original
program (<a class="external" href="http://ctan.org/pkg/etex">http://ctan.org/pkg/etex</a>), 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 <code>etex</code>, but this is plain TeX (and produces
<samp>.dvi</samp>).
</p>
<p>In other TeX distributions, <code>latex</code> may invoke e-TeX
rather than pdfTeX. In any case, the e-TeX extensions can be
assumed to be available in LaTeX.
</p>
</dd>
<dt><code>lualatex</code></dt>
<dd><a name="index-lualatex-command" class="anchor"></a>
<a name="index-LuaTeX" class="anchor"></a>
<a name="tex-engines-lualatex" class="anchor"></a><p>If LaTeX is invoked via the system command <code>lualatex</code>, the
LuaTeX engine is run (<a class="external" href="http://ctan.org/pkg/luatex">http://ctan.org/pkg/luatex</a>). This
program allows code written in the scripting language Lua
(<a class="external" href="http://luatex.org">http://luatex.org</a>) to interact with TeX’s typesetting.
LuaTeX handles UTF-8 Unicode input natively, can handle OpenType
and TrueType fonts, and produces a <samp>.pdf</samp> file by default.
There is also <code>dvilualatex</code> to produce a <samp>.dvi</samp> file,
but this is rarely used.
</p>
</dd>
<dt><code>xelatex</code></dt>
<dd><a name="index-xelatex-command" class="anchor"></a>
<a name="index-XeTeX" class="anchor"></a>
<a name="index-_002exdv-file" class="anchor"></a>
<a name="index-xdvipdfmx" class="anchor"></a>
<a name="tex-engines-xelatex" class="anchor"></a><p>If LaTeX is invoked with the system command <code>xelatex</code>, the
XeTeX engine is run (<a class="external" href="http://tug.org/xetex">http://tug.org/xetex</a>). Like LuaTeX,
XeTeX natively supports UTF-8 Unicode and TrueType and OpenType
fonts, though the implementation is completely different, mainly using
external libraries instead of internal code. XeTeX produces a
<samp>.pdf</samp> file as output; it does not support DVI output.
</p>
<p>Internally, XeTeX 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.
</p>
</dd>
</dl>
<p>Other variants of LaTeX and TeX exist, e.g., to provide
additional support for Japanese and other languages ([u]pTeX,
<a class="external" href="http://ctan.org/pkg/ptex">http://ctan.org/pkg/ptex</a>, <a class="external" href="http://ctan.org/pkg/uptex">http://ctan.org/pkg/uptex</a>).
</p>
<hr>
<a name="LaTeX-command-syntax" class="anchor"></a>
<a name="LaTeX-command-syntax-1" class="anchor"></a>
<h3 class="section">LaTeX command syntax</h3>
<a name="index-command-syntax" class="anchor"></a>
<a name="index-_005c-character-starting-commands" class="anchor"></a>
<a name="index-_005b_002e_002e_002e_005d-for-optional-arguments" class="anchor"></a>
<a name="index-_007b_002e_002e_002e_007d-for-required-arguments" class="anchor"></a>
<p>In the LaTeX input file, a command name starts with a backslash
character, <code>\</code>. The name itself then consists of either
(a) a string of letters or (b) a single non-letter.
</p>
<p>LaTeX commands names are case sensitive so that <code>\pagebreak</code>
differs from <code>\Pagebreak</code> (the latter is not a standard command).
Most commands are lowercase, but in any event you must enter all
commands in the same case as they are defined.
</p>
<p>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>{...}</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.
</p>
<p>Inside of an optional argument, to use the character close square
bracket (<code>]</code>) hide it inside curly braces, as
in <code>\item[closing bracket {]}]</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.
</p>
<p>Some of LaTeX’s commands are a <em>declaration</em>. Such a command
changes the value the meaning of some other command or parameter. For
instance, the <code>\mainmatter</code> declaration changes the typesetting of
page numbers from roman numerals to arabic (see <a href="latex2e_6.html#g_t_005cfrontmatter-_0026-_005cmainmatter-_0026-_005cbackmatter">\frontmatter & \mainmatter & \backmatter</a>).
</p>
<p>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.
</p>
<p>This manual describes all accepted options and <code>*</code>-forms for the
commands it covers (barring unintentional omissions, a.k.a. bugs).
</p>
<hr>
<a name="Environment" class="anchor"></a>
<a name="Environment-1" class="anchor"></a>
<h3 class="section">Environment</h3>
<p>Synopsis:
</p>
<div class="example">
<pre class="example">\begin{<var>environment name</var>}
...
\end{<var>environment name</var>}
</pre></div>
<p>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{verse}</code> and <code>\end{verse}</code>.
</p>
<div class="example">
<pre class="example">\begin{verse}
There once was a man from Nantucket \\
...
\end{verse}
</pre></div>
<p>See <a href="latex2e_8.html#Environments">Environments</a> for a list of environments. Particularly notable is
that every LaTeX document must have a <code>document</code> environment,
a <code>\begin{document} ... \end{document}</code> pair.
</p>
<p>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 (<code>*</code>); both the <code>\begin</code> and <code>\end</code> texts must
include the star.
</p>
<p>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).
</p>
<div class="example">
<pre class="example">\begin{tabular}[t]{r|l}
... rows of table ...
\end{tabular}
</pre></div>
<hr>
<a name="CTAN" class="anchor"></a>
<a name="CTAN_003a-the-Comprehensive-TeX-Archive-Network" class="anchor"></a>
<h3 class="section">CTAN: the Comprehensive TeX Archive Network</h3>
<a name="index-CTAN" class="anchor"></a>
<p>The Comprehensive TeX Archive Network, CTAN, is the TeX and
LaTeX community’s repository of free material. It is a set of
Internet sites around the world that offer material related to LaTeX
for download. Visit CTAN on the web at <a class="external" href="https://ctan.org">https://ctan.org</a>.
</p>
<p>This material is organized into packages, discrete bundles that
typically offer some coherent functionality and are maintained by one
person or a small number of people. For instance, many publishers have
a package that allows authors to format papers to that publisher’s
specifications.
</p>
<p>In addition to the massive holdings, the web site offers features such
as search by name or by functionality.
</p>
<a name="index-DANTE-e_002eV_002e" class="anchor"></a>
<a name="index-mirrors-of-CTAN" class="anchor"></a>
<p>CTAN is not a single site, but instead is a set of sites. One of the
sites is the core. This site actively manages the material, for
instance, by accepting uploads of new or updated packages. It is
hosted by the German TeX group DANTE e.V. Other sites around the
world help out by mirroring, that is, automatically syncing their
collections with the core site and then in turn making their copies
publicly available. This gives users close to their location better
access and relieves the load on the core site. The list of mirrors is
at <a class="external" href="https://ctan.org/mirrors">https://ctan.org/mirrors</a>.
</p>
</body>
</html>
|