Unofficial LaTeX reference manual.
\
,
followed by either (a) a string of letters or (b) a single
non-letter. Arguments contained in square brackets, []
, are
optional while arguments contained in braces, {}
, are
required.
\documentclass{class} \begin{document} your text \end{document}
\documentclass
and the \begin{document}
commands (this area is called the
preamble).
\documentclass[options]{class}
\documentclass
command must be the first command in a
&latex; source file.
article report book letter slides
\documentclass
command by enclosing them in square
brackets as usual. To specify more than one option, separate
them with a comma:
\documentclass[option1,option2,...]{class}
slides
accept the following
options for selecting the typeface size (default is 10pt
):
10pt 11pt 12pt
letterpaper
):
a4paper a5paper b5paper executivepaper legalpaper letterpaper
slides
class offers the option clock
for printing
the time at the bottom of each note.
\usepackage[options]{pkg}
\usepackage
commands.
\documentclass
command that are unknown
by the selected document class are passed on to the packages loaded with
\usepackage
.
\textit{italic text}
. The corresponding command in
parenthesis is the &textldquo;declaration form&textrdquo;, which takes no arguments. The
scope of the declaration form lasts until the next type style command
or the end of the current group.
\sffamily\bfseries
or \bfseries\sffamily
to get bold
sans serif.
\begin{ttfamily}...\end{ttfamily}
.
\mathversion{bold}
\mathversion{normal}
restores the default.
{\cmd ...}
instead of \cmd{...}
. These are two very different
things.
\normalsize
(default)10pt
11pt
12pt
\tiny
\scriptsize
\footnotesize
\small
\normalsize
(default)
\large
\Large
\LARGE
\huge
\Huge
\begin{tiny}...\end{tiny}
.
\onecolumn
\onecolumn
declaration starts a new page and produces
single-column output. This is the default.
\twocolumn
\twocolumn[text1col]
\twocolumn
declaration starts a new page and produces
two-column output. If the optional text1col argument is present,
it is typeset in one-column mode before the two-column typesetting
starts.
\textwidth
in
single-column text.
\flushbottom
\flushbottom
declaration makes all text pages the same
height, adding extra vertical space where necessary to fill out the
page.
twocolumn
mode is selected
(\raggedbottom
\raggedbottom
declaration makes all pages the natural
height of the material on that page. No rubber lengths will be
stretched.
book
class, where it varies with the
type size.
book
class, where it varies with the type size.
book
class, where it varies with the type size.
list
(\textwidth
by
the sum of \leftmargin
and \rightmargin
(article
document in
10pt, it&textrsquo;s set to 345pt; in two-column mode, that
becomes 229.5pt.
article
or
report
document in 10pt, it&textrsquo;s set to
43\baselineskip; for book
, it&textrsquo;s 41\baselineskip.
For 11pt, it&textrsquo;s 38\baselineskip and for 12pt,
36\baselineskip.
article
or report
document, it&textrsquo;s
345pt at 10pt, 360pt at 11pt, and
390pt at 12pt. For a book
document, it&textrsquo;s
4.5in at 10pt, and 5in at 11pt or
12pt.
\textwidth
remains the width of the
entire page body, while \columnwidth
is the width of one column
(\textwidth
remains the width of the
entire page body (and \columnwidth
the width of the entire
column), while \linewidth
may decrease for nested lists.
\parbox
(minipage
or \parbox
.
\hsize
is the &tex; primitive parameter used
when text is broken into lines. It should not be used in normal
&latex; documents.
\paperheight − 2in −
\headheight − \headsep − \textheight − \footskip
, and
then divided by two.
\chapter[toctitle]{title}
*
-forms that print
title as usual, but do not include a number and do not make an
entry in the table of contents. For instance:
\section*{Preamble}
\appendix
command changes the way following sectional units
are numbered. The \appendix
command itself generates no text
and does not affect the numbering of parts. The normal use of this
command is something like
\chapter{A Chapter} &dots; \appendix \chapter{The First Appendix}
secnumdepth
counter controls printing of section numbers.
The setting
\setcounter{secnumdepth}{level}
chapter
is level zero. (\label
\label{key}
\label
command appearing in ordinary text assigns to
key the number of the current sectional unit; one appearing
inside a numbered environment assigns that number to key.
fig:snark
or
fig.snark
.
\pageref{key}
\pageref{key}
\pageref
{key} command produces the page number of
the place in the text where the corresponding
\label
{key} command appears.
\ref{key}
\ref{key}
\ref
command produces the number of the sectional unit,
equation, footnote, figure, &dots;, of the corresponding
\label
command (\begin{envname} ... \end{envname}
abstract
\begin{abstract} ... \end{abstract}
array
\begin{array}{template} col1 text&col1 text&coln}\\ ... \end{array}
array
environment, normally
within an equation
environment (array
)&
. Column entries may include
other &latex; commands. Each row of the array is terminated with
\\
.
&arobase;{text}
puts text
between columns in each row.
\begin{equation} \begin{array}{lrc} left1 & right1 & centered1 \\ left2 & right2 & centered2 \\ \end{array} \end{equation}
\arraycolsep
parameter defines half the width of the space
separating columns; the default is 5pt. array
environments,
namely \arrayrulewidth
and \arraystretch
.
array
environment can only be used in math mode.
center
\begin{center} line1 \\ line2 \\ \end{center}
center
)center
environment allows you to create a paragraph
consisting of lines that are centered within the left and right
margins on the current page. Each line is terminated with the
string \\
.
\centering
\centering
declaration corresponds to the center
environment. This declaration can be used inside an environment such
as quote
or in a parbox
. Thus, the text of a figure or
table can be centered on the page by putting a \centering
command at the beginning of the figure or table environment.
center
environment, the \centering
command
does not start a new paragraph; it simply 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 \end
command (of
an environment such as quote) that ends the paragraph unit.
\begin{quote} \centering first line \\ second line \\ \end{quote}
description
\begin{description} \item [label1] item1 \item [label2] item2 ... \end{description}
description
environment is used to make labelled lists. Each
label is typeset in bold, flush right. The item text may
contain multiple paragraphs.
\texttt
, you&textrsquo;ll get
bold typewriter: \item[\texttt{bold and typewriter}]
. This
may be too bold, among other issues. To get just typewriter, use
\tt
, which resets all other style variations: \item[{\tt
plain typewriter}]
.
displaymath
\begin{displaymath} math \end{displaymath}
\[math\]
displaymath
environment (\[...\]
is a synonym)
typesets the math text on its own line, centered by default.
The global fleqn
option makes equations flush left; see
displaymath
text; to get an
equation number, use the equation
environment (document
document
environment encloses the body of a document.
It is required in every &latex; document. enumerate
\begin{enumerate} \item item1 \item item2 ... \end{enumerate}
enumerate
environment produces a numbered list. Enumerations
can be nested within one another, up to four levels deep. They can also
be nested within other paragraph-making environments, such as
itemize
(description
(\item
command.
There must be at least one \item
command within the environment.
enumerate
environment uses the counters \enumi
through \enumiv
counters (\item
is given, the counter is not incremented for
that item.
enumerate
environment uses the commands \labelenumi
through \labelenumiv
to produce the default label. So, you can
use \renewcommand
to change the labels (\renewcommand{\labelenumi}{\Alph{enumi}}
eqnarray
amsmath
eqnarray
eqnarray
environment has some infelicities
which cannot be overcome; the article &textldquo;Avoid eqnarray!&textrdquo;&noeos; by Lars
Madsen describes them in detail
(align
environment (and
others) from the amsmath
package.
eqnarray
:
\begin{eqnarray}(or formula1 \\ formula2 \\ ... \end{eqnarray}eqnarray*
)
eqnarray
)eqnarray
environment is used to display a sequence of
equations or inequalities. It is very much like a three-column
array
environment, with consecutive rows separated by \\
and consecutive items within a row separated by an &
.
eqnarray
)\\*
can also be used to separate equations, with its normal
meaning of not allowing a page break at that line.
\nonumber
command. Alternatively, The *
-form of the
environment (\begin{eqnarray*} ... \end{eqnarray*}
) will
omit equation numbering entirely, while otherwise being the same as
eqnarray
.
\lefteqn
is used for splitting long formulas across
lines. It typesets its argument in display style flush left in a box of
zero width.
equation
\begin{equation} math \end{equation}
equation
environment starts a displaymath
environment (figure
\begin{figure[*]}[placement] figbody \label{label} \caption[loftitle]{text} \end{figure}
[placement]
determines where &latex; will try
to place your figure. There are four places where &latex; can possibly
put a float:
tbp
.
\caption
command specifies caption text for the
figure. The caption is numbered by default. If loftitle is
present, it is used in the list of figures instead of text
(flushleft
\begin{flushleft} line1 \\ line2 \\ ... \end{flushleft}
flushleft
flushleft
environment allows you to create a paragraph
consisting of lines that are flush to the left-hand margin and ragged
right Each line must be terminated with the string \\
.
\raggedright
\raggedright
declaration corresponds to the
flushleft
environment. This declaration can be used inside an
environment such as quote
or in a parbox
.
flushleft
environment, the \raggedright
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 \end
command that ends the paragraph unit.
flushright
\begin{flushright} line1 \\ line2 \\ ... \end{flushright}
flushright
)flushright
environment allows you to create a paragraph
consisting of lines that are flush to the right-hand margin and ragged
left. Each line must be terminated with the string \\
.
\raggedleft
\raggedleft
declaration corresponds to the
flushright
environment. This declaration can be used inside an
environment such as quote
or in a parbox
.
flushright
environment, the \raggedleft
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 \end
command that ends the paragraph unit.
itemize
\begin{itemize} \item item1 \item item2 ... \end{itemize}
itemize
environment produces an &textldquo;unordered&textrdquo;, &textldquo;bulleted&textrdquo;
list. Itemizations can be nested within one another, up to four
levels deep. They can also be nested within other paragraph-making
environments, such as enumerate
(itemize
list begins with an \item
command.
There must be at least one \item
command within the environment.
itemize
environment uses the commands \labelitemi
through \labelitemiv
to produce the default label. So, you can
use \renewcommand
to change the labels. For instance, to have
the first level use diamonds:
\renewcommand{\labelitemi}{$\diamond$}
\leftmargini
through \leftmarginvi
parameters define
the distance between the left margin of the enclosing environment and
the left margin of the list. By convention, \leftmargin
is set
to the appropriate \leftmarginN
when a new level of
nesting is entered.
\setlength{\leftmargini}{1.25em} % default 2.5em
quote
,
quotation
, and verse
environments, where it is set equal
to \leftmargin
.
2pt plus1pt
minus1pt
for 10pt
documents, 3pt plus2pt minus1pt
for
11pt
, and 4.5pt plus2pt minus1pt
for 12pt
.
\itemsep
.
8pt plus2pt minus4pt
for
10pt
documents, 9pt plus3pt minus5pt
for 11pt
,
and 10pt plus4pt minus6pt
for 12pt
. These are reduced
for nested lists.
\topsep
when the list environment starts a
paragraph. The default is 2pt plus1pt minus1pt
for 10pt
documents, 3pt plus1pt minus1pt
for 11pt
, and 3pt
plus2pt minus2pt
for 12pt
.
itemize*
environment with no extra spacing between items, or between paragraphs
within a single item (\parskip
is not list-specific,
\newenvironment{itemize*}% {\begin{itemize}% \setlength{\itemsep}{0pt}% \setlength{\parsep}{0pt}}% \setlength{\parskip}{0pt}}% {\end{itemize}}
letter
environment: writing letterslist
list
environment is a generic environment which is used for
defining many of the more specific environments. It is seldom used in
documents, but often in macros.
\begin{list}{labeling}{spacing} \item item1 \item item2 ... \end{list}
\item
).
This argument is a piece of text that is inserted in a box to form the
label. It can and usually does contain other &latex; commands.
{}
, which leaves the default spacing.
\linewidth
(math
\begin{math} math \end{math}
math
environment inserts the given math within the
running text. \(...\))
and $...$
are synonyms.
minipage
\begin{minipage}[position][height][inner-pos]{width} text \end{minipage}
minipage
environment typesets its body text in a
block that will not be broken across pages. This is similar to the
\parbox
command (\parbox
,
other paragraph-making environments can be used inside a minipage.
\parbox
(minipage
environment. You can restore indentation with a command such as
\setlength{\parindent}{1pc}
command.
minipage
environment are handled in a way that is
particularly useful for putting footnotes in figures or tables. A
\footnote
or \footnotetext
command puts the footnote at
the bottom of the minipage instead of at the bottom of the page, and it
uses the \mpfootnote
counter instead of the ordinary
footnote
counter (picture
\begin{picture}(width,height)(x offset,y offset) &dots; picture commands &dots; \end{picture}
picture
environment allows you to create just about any
kind of picture you want containing text, lines, arrows and circles.
You tell &latex; where to put things in the picture by specifying
their coordinates. A coordinate is a number that may have a decimal
point and a minus sign&textmdash;a number like 5
, 0.3
or
-3.1416
. A coordinate specifies a length in multiples of the
unit length \unitlength
, so if \unitlength
has been set
to 1cm
, then the coordinate 2.54 specifies a length of 2.54
centimeters. You should only change the value of \unitlength
,
using the \setlength
command, outside of a picture
environment.
(2.4,-5)
, specifying
the point with x-coordinate 2.4
and y-coordinate -5
.
Coordinates are specified in the usual way with respect to an origin,
which is normally at the lower-left corner of the picture. Note that
when a position appears as an argument, it is not enclosed in braces;
the parentheses serve to delimit the argument.
picture
environment has one mandatory argument, which is a
position
. It specifies the size of the picture. The environment
produces a rectangular box with width and height determined by this
argument&textrsquo;s x- and y-coordinates.
picture
environment also has an optional position
argument, following the size
argument, that can change the
origin. (Unlike ordinary optional arguments, this argument is not
contained in square brackets.) The optional argument gives the
coordinates of the point at the lower-left corner of the picture
(thereby determining the origin). For example, if \unitlength
has been set to 1mm
, the command
\begin{picture}(100,200)(10,20)
\put
command. The command
\put (11.3,-.3){...}
...
in the
picture, with its reference point at coordinates .
The reference points for various objects will be described below.
\put
command creates an LR box. You can put anything
that can go in an \mbox
(\put
command. When you do this, the reference point will
be the lower left corner of the box.
picture
commands are described in the following sections.
\circle
\circle[*]{diameter}
\circle
command produces a circle with a diameter as close
to the specified one as possible. The *
-form of the command
draws a solid circle.
\makebox
\makebox(width,height)[position]{...}
\makebox
command for the picture environment is similar to
the normal \makebox
command except that you must specify a
width
and height
in multiples of \unitlength
.
[position]
, specifies the quadrant that
your text appears in. You may select up to two of the following:
\framebox
\framebox(width,height)[pos]{...}
\framebox
command is like \makebox
(see previous
section), except that it puts a frame around the outside of the box
that it creates.
\framebox
command produces a rule of thickness
\fboxrule
, and leaves a space \fboxsep
between the rule
and the contents of the box.
\dashbox
\dashbox{dlen}(rwidth,rheight)[pos]{text}
\dashbox
creates a dashed rectangle around text in a
picture
environment. Dashes are dlen units long, and the
rectangle has overall width rwidth and height rheight.
The text is positioned at optional pos.
rwidth
and rheight
are
multiples of the dlen
.
\frame
\frame{text}
\frame
command puts a rectangular frame around text.
The reference point is the bottom left corner of the frame. No extra
space is put between the frame and the object.
\line
\line(xslope,yslope){length}
\line
command draws a line with the given length and
slope xslope/yslope.
curve2e
and many many other packages on CTAN.
\linethickness
\linethickness{dim}
command declares the thickness
of horizontal and vertical lines in a picture environment to be
dim, which must be a positive length.
\linethickness
does not affect the thickness of slanted lines,
circles, or the quarter circles drawn by \oval
.
\thicklines
\thicklines
command is an alternate line thickness for
horizontal and vertical lines in a picture environment;
cf. \thinlines
\thinlines
command is the default line thickness for
horizontal and vertical lines in a picture environment;
cf. \multiput
\multiput(x,y)(delta_x,delta_y){n}{obj}
\multiput
command copies the object obj in a regular
pattern across a picture. obj is first placed at position
, then at , and so on,
n times.
\oval
\oval(width,height)[portion]
\oval
command produces a rectangle with rounded corners.
The optional argument portion allows you to select part of the
oval via the following:
\put
\put(x coord,y coord){ ... }
\put
command places the item specified by the mandatory
argument at the given coordinates.
\shortstack
\shortstack[position]{...\\...\\...}
\shortstack
command produces a stack of objects. The valid
positions are:
\shortstack
objects)\\
.
\vector
\vector(x-slope,y-slope){length}
\vector
command draws a line with an arrow of the specified
length and slope. The and values must lie between
−4 and +4, inclusive.
quotation
\begin{quotation} text \end{quotation}
quotation
environment are indented on both
the left and the right. The text is justified at both margins.
Leaving a blank line between text produces a new paragraph.
quote
environment, each paragraph is indented
normally.
quote
\begin{quote} text \end{quote}
quote
environment are indented on both the
left and the right. The text is justified at both margins. Leaving a
blank line between text produces a new paragraph.
quotation
environment, paragraphs are not indented.
tabbing
\begin{tabbing} row1col1 \= row1col2 \= row1col3 \= row1col4 \\ row2col1 \> \> row2col3 \\ ... \end{tabbing}
tabbing
environment provides a way to align text in
columns. It works by setting tab stops and tabbing to them much as
was done on an ordinary typewriter. It is best suited for cases where
the width of each column is constant and known in advance.
tabular
environment.
tabbing
enviroment:
\>
,
\<
, \'
, \\
, or \kill
command, to the right
of the previous column, flush against the current column&textrsquo;s tab stop.
\`
command moves all the
text that follows it, up to the \\
or \end{tabbing}
command that ends the line, to the right margin of the tabbing
environment. There must be no \>
or \'
command between
the \`
and the command that ends the line.
tabbing
environment, the commands \=
, \'
and
\`
do not produce accents as usual (\a=
, \a'
and \a`
are used.
\\
except that it throws away the current line instead of producing
output for it. The effect of any \=
, \+
or \-
commands in that line remain in effect.
\pushtabs
.
tabbing
environment.
\'
.
\begin{tabbing} function \= fact(n : integer) : integer;\\ \> begin \= \+ \\ \> if \= n $>$ 1 then \+ \\ fact := n * fact(n-1) \- \\ else \+ \\ fact := 1; \-\- \\ end;\\ \end{tabbing}
table
\begin{table}[placement] body of the table \caption{table title} \end{table}
[placement]
determines where &latex; will try
to place your table. There are four places where &latex; can possibly put
a float; these are the same as that used with the figure
environment, and described there (report
and article
classes use the default
placement [tbp]
.
\caption
command allows you to title your table.
tabular
\begin{tabular}[pos]{cols} column 1 entry & column 2 entry ... & column n entry \\ ... \end{tabular}
\begin{tabular*}{width}[pos]{cols} column 1 entry & column 2 entry ... & column n entry \\ ... \end{tabular*}
tabular
\\
must be used to specify the end of each row of the table,
except for the last, where it is optional&textmdash;unless an \hline
command (to put a rule below the table) follows.
|
, \hline
, and
\vline
in the tabular
and array
environments; the
default is .4pt.
tabular
and array
environments; default is 1, for no scaling.
||
in the tabular
and array
environments; default is 2pt.
tabular
environment:
\multicolumn
\multicolumn{cols}{pos}{text}
\multicolumn
command makes an entry that spans several
columns. The first mandatory argument, cols, specifies the
number of columns to span. The second mandatory argument, pos,
specifies the formatting of the entry; c
for centered, l
for flushleft, r
for flushright. The third mandatory argument,
text, specifies what text to put in the entry.
\multicolumn
is used for the heading:
\begin{tabular}{r&arobase;{--}l} \multicolumn{2}{c}{\bf Unicode}\cr 0x80&0x7FF \cr 0x800&0xFFFF \cr 0x10000&0x1FFFF \cr \end{tabular}
\cline
\cline{i-j}
\cline
command draws horizontal lines across the columns
specified, beginning in column i and ending in column j,
which are specified in the mandatory argument.
\hline
\hline
command draws a horizontal line the width of the
enclosing tabular
or array
environment. It&textrsquo;s most
commonly used to draw a line at the top, bottom, and between the rows
of a table.
\vline
\vline
command will draw a vertical line extending the full
height and depth of its row. An \hfill
command can be used to
move the line to the edge of the column. It can also be used in an
&arobase;-expression.
thebibliography
\begin{thebibliography}{widest-label} \bibitem[label]{cite_key} ... \end{thebibliography}
thebibliography
environment produces a bibliography or
reference list.
article
class, this reference list is labelled
&textldquo;References&textrdquo;; in the report
class, it is labelled
&textldquo;Bibliography&textrdquo;. You can change the label (in the standard classes)
by redefining the command \refname
. For instance, this
eliminates it entirely:
\renewcommand{\refname}{}
\bibitem
commands. It is typically given as 9
for bibliographies with
less than 10 references, 99
for ones with less than 100, etc.
\bibitem
\bibitem[label]{cite_key}
\bibitem
command generates an entry labelled by
label. If the label argument is missing, a number is
automatically generated using the enumi
counter. The
cite_key is any sequence of letters, numbers, and punctuation
symbols not containing a comma.
\begin{document}
command, the item&textrsquo;s label
is
associated with cite_key
, causing references to cite_key
with a \cite
command (see next section) to produce the
associated label.
\cite
\cite[subcite]{keys
\cite[p.~314]{knuth}
might produce
&textlsquo;[Knuth, p. 314]&textrsquo;.
\nocite
\nocite{key_list}
\nocite
command produces no text, but writes key_list
,
which is a list of one or more citation keys, on the thebibliography
environment (\bibliographystyle{bibstyle} \bibliography{bibfile1,bibfile2}
\bibliographystyle
command does not produce any output of
its own. Rather, it defines the style in which the bibliography will
be produced: bibstyle refers to a file
bibstyle\bibliography
command is what actually produces the
bibliography. The argument to \bibliography
refers to files
named \cite
and
\nocite
will be listed in the bibliography.
theorem
\begin{theorem} theorem-text \end{theorem}
theorem
environment produces &textldquo;Theorem n&textrdquo; in
boldface followed by theorem-text, where the numbering
possibilities for n are described under \newtheorem
(titlepage
\begin{titlepage} text \end{titlepage}
titlepage
environment creates a title page, i.e., a page
with no printed page number or heading. It also causes the following
page to be numbered page one. Formatting the title page is left to
you. The \today
command may be useful on title pages
(\maketitle
command (titlepage
environment.
verbatim
\begin{verbatim} literal-text \end{verbatim}
verbatim
environment is a paragraph-making environment in
which &latex; produces exactly what you type in; for instance the
\
character produces a printed \. It turns &latex;
into a typewriter with carriage returns and blanks having the same
effect that they would on a typewriter.
verbatim
uses a monospaced typewriter-like font (\tt
).
\verb
\verbcharliteral-textchar \verb*charliteral-textchar
\verb
command typesets literal-text as it is input,
including special characters and spaces, using the typewriter
(\tt
) font. No spaces are allowed between \verb
or
\verb*
and the delimiter char, which begins and ends the
verbatim text. The delimiter must not appear in literal-text.
*
-form differs only in that spaces are printed with a
&textldquo;visible space&textrdquo; character.
verse
\begin{verse} line1 \\ line2 \\ ... \end{verse}
verse
environment is designed for poetry, though you may find
other uses for it.
verse
\\
, and use one or more blank lines to separate the
stanzas.
\\
command, and you can always manually force breaks.
\\
[*][morespace]\\
command tells &latex; to start a new line. It has an
optional argument, morespace, that specifies how much extra
vertical space is to be inserted before the next line. This can be a
negative amount.
\\*
command is the same as the ordinary \\
command
except that it tells &latex; not to start a new page after the line.
\obeycr
& \restorecr
\obeycr
command makes a return in the input file
(^^M, internally) the same as \\
(followed by
\relax
). So each new line in the input will also be a new line
in the output.
\restorecr
restores normal line-breaking behavior.
\newline
\newline
command breaks the line at the present point, with
no stretching of the text before it. It can only be used in paragraph
mode.
\-
(discretionary hyphen)\-
command tells &latex; that it may hyphenate the word at
that point. &latex; is very good at hyphenating, and it will usually
find most of the correct hyphenation points, and almost never use an
incorrect one. The \-
command is used for the exceptional
cases.
\-
commands in a word, the word will only be
hyphenated at those points and not at any of the hyphenation points
that &latex; might otherwise have chosen.
\fussy
\fussy
(which is the default) makes &tex;
picky about line breaking. This usually avoids too much space between
words, at the cost of an occasional overfull box.
\sloppy
command
(\sloppy
\sloppy
makes &tex; less fussy about line
breaking. This will avoid overfull boxes, at the cost of loose
interword spacing.
\fussy
command is issued (\hyphenation
\hyphenation{word-one word-two}
\hyphenation
command declares allowed hyphenation points
with a -
character in the given words. The words are separated
by spaces. &tex; will only hyphenate if the word matches exactly, no
inflections are tried. Multiple \hyphenation
commands
accumulate. Some examples (the default &tex; hyphenation patterns
misses the hyphenations in these words):
\hyphenation{ap-pen-dix col-umns data-base data-bases}
\linebreak
& \nolinebreak
\linebreak[priority] \nolinebreak[priority]
\linebreak
(\nolinebreak
) command forces
(prevents) a line break at the current position. For
\linebreak
, the spaces in the line are stretched out so that it
extends to the right margin as usual.
\cleardoublepage
\cleardoublepage
command ends the current page and causes all
figures and tables that have so far appeared in the input to be printed.
In a two-sided printing style, it also makes the next page a right-hand
(odd-numbered) page, producing a blank page if necessary.
\clearpage
\clearpage
command ends the current page and causes all
figures and tables that have so far appeared in the input to be printed.
\newpage
\newpage
command ends the current page, but does not clear
floats (see \clearpage
above).
\enlargethispage
\enlargethispage{size}
\enlargethispage*{size}
\textheight
for the current page by the specified
amount; e.g. \enlargethispage{\baselineskip}
will allow one
additional line.
\pagebreak
.
\pagebreak
& \nopagebreak
\pagebreak[priority] \nopagebreak[priority]
\pagebreak
(\nopagebreak
) command forces
(prevents) a page break at the current position. With
\pagebreak
, the vertical space on the page is stretched out
where possible so that it extends to the normal bottom margin.
\pagebreak
command from a demand to a request. The number must
be a number from 0 to 4. The higher the number, the more
insistent the request is.
\footnote
command. They can also be
produced with two commands, the \footnotemark
and the
\footnotetext
commands.
\footnote
\footnote[number]{text}
\footnote
command places the numbered footnote text
at the bottom of the current page. The optional argument number
changes the default footnote number.
\chapter
, in figures,
tables or in a tabular
environment. (See following sections.)
\footnotemark
\footnotemark
command puts the
current footnote number in the text. This command can be used in
inner paragraph mode. You give the text of the footnote separately,
with the \footnotetext
command.
\footnotemark[\value{footnote}]
\footnote
command.
\footnotetext
\footnotetext[number]{text}
\footnotetext
command places text at the bottom of
the page as a footnote. This command can come anywhere after the
\footnotemark
command. The \footnotetext
command must
appear in outer paragraph mode.
\thefootnote
like this:
\renewcommand{\thefootnote}{\fnsymbol{footnote}}
\fnsymbol
command produces a predefined series of symbols
(\&arobase;fnsymbol
.
0.4pt
thick (or wide), and
0.4\columnwidth
long in the standard document classes (except
slides, where it does not appear).
\footnotesize
fonts (\newcommand
& \renewcommand
\newcommand
and \renewcommand
define and redefine a
command, respectively. Synopses:
\newcommand{cmd}[nargs]{defn} \renewcommand{cmd}[nargs]{defn} \newcommand{cmd}[nargs][default]{defn} \renewcommand{cmd}[nargs][default]{defn}
\newcounter
\newcounter{cnt}[countername]
\newcounter
command defines a new counter named cnt.
The new counter is initialized to zero.
[countername]
, cnt
will be reset whenever countername is incremented.
\newlength
\newlength{\arg}
\newlength
command defines the mandatory argument as a
length
command with a value of 0in
. The argument must
be a control sequence, as in \newlength{\foo}
. An error
occurs if \foo
is already defined.
\newsavebox
\newsavebox{cmd}
\cmd
, which must be a command name not already
defined, to refer to a new bin for storing boxes.
\newenvironment
& \renewenvironment
\newenvironment{env}[nargs]{begdef}{enddef} \newenvironment{env}[nargs][default]{begdef}{enddef} \renewenvironment{env}[nargs]{begdef}{enddef}
\begin{env} &dots; \end{env}
.
\newtheorem
\newtheorem{newenv}{label}[within] \newtheorem{newenv}[numbered_like]{label}
\newfont
\newfont{cmd}{fontname}
\cmd
, which must not already
be defined, to make fontname be the current font. The file
looked for on the system is named \protect
\protect
. In addition, any fragile
commands within the arguments must have their own \protect
.
\caption
(\thanks
(tabular
and array
environments
(\protect
.
\
.
(enumi
&textndash;enumiv
are used for the nested enumerate
environment.) Below is a list of the counters used in &latex;&textrsquo;s
standard document classes to control numbering.
part paragraph figure enumi chapter subparagraph table enumii section page footnote enumiii subsection equation mpfootnote enumiv subsubsection
\alph \Alph \arabic \roman \Roman \fnsymbol
: Printing counters\alph{enumi}
.
asterix(*) dagger ddagger section-sign paragraph-sign parallel double-asterix(**) double-dagger double-ddagger
\usecounter{counter}
\usecounter{counter}
\usecounter
command is used in the second argument of the
list
environment to specify counter to be used to number
the list items.
\value{counter}
\value{counter}
\value
command produces the value of counter. It can
be used anywhere &latex; expects a number, for example:
\setcounter{myctr}{3} \addtocounter{myctr}{1} \hspace{\value{myctr}\parindent}
\setcounter{counter}{value}
\setcounter{\counter}{value}
\setcounter
command sets the value of \counter to the
value argument.
\addtocounter{counter}{value}
\addtocounter
command increments counter by the
amount specified by the value argument, which may be negative.
\refstepcounter{counter}
\refstepcounter
command works in the same way as
\stepcounter
\ref
value to be the result of \thecounter
.
\stepcounter{counter}
\stepcounter
command adds one to counter and
resets all subsidiary counters.
\day \month \year
: Predefined counters\day
,
1&textndash;31), month of the year (\month
, 1&textndash;12), and year
(\year
, Common Era). When &tex; starts up, they are
set to the current values on the system where &tex; is running. They
are not updated as the job progresses.
\today
produces a string representing the
current day (length
is a measure of distance. Many &latex; commands take a
length as an argument.
\setlength{\len}{value}
\setlength
sets the value of \len to the value
argument, which can be expressed in any units that &latex;
understands, i.e., inches (in
), millimeters (mm
), points
(pt
), big points (bp
, etc.
\addtolength
command increments a &textldquo;length command&textrdquo;
\len by the amount specified in the amount argument, which
may be negative.
\settodepth
\settodepth{\gnat}{text}
\settodepth
command sets the value of a length
command
equal to the depth of the text
argument.
\settoheight
\settoheight{\gnat}{text}
\settoheight
command sets the value of a length
command
equal to the height of the text
argument.
\settowidth{\len}{text}
\settowidth
command sets the value of the command \len
to the width of the text argument.
\width
\height
\depth
\totalheight
\totalheight
equals \height
+
\depth
. To make a box with the text stretched to double the
natural size, e.g., say
\makebox[2\width]{Get a stretcher}
%
. A blank line should not appear where a new
paragraph cannot be started, such as in math mode or in the argument of
a sectioning command.
\indent
\indent
produces a horizontal space whose width equals the
width of the \parindent
length, the normal paragraph
indentation. It is used to add paragraph indentation where it would
otherwise be suppressed.
\parindent
is 1em
in two-column
mode, otherwise 15pt
for 10pt
documents, 17pt
for
11pt
, and 1.5em
for 12pt
.
\noindent
\noindent
suppresses any paragraph indentation. It has no effect when used in
the middle of a paragraph.
\parskip
\parskip
is a rubber length defining extra vertical space added
before each paragraph. The default is 0pt plus1pt
.
\marginpar[left]{right}
\marginpar
command creates a note in the margin. The first
line of the note will have the same baseline as the line in the text
where the \marginpar
occurs.
\reversemarginpar
places subsequent marginal notes
in the opposite (inside) margin. \normalmarginpar
places them
in the default position.
\hspace{0pt}
.
math
environment can be used in both paragraph and LR mode,
but the displaymath
and equation
environments can be used
only in paragraph mode. The math
and displaymath
environments are used so often that they have the following short forms:
\(...\)instead of \begin{math}...\end{math} \[...\]instead of \begin{displaymath}...\end{displaymath}
math
environment is so common that it has an even
shorter form:
$ ... $instead of \(...\)
\boldmath
command changes math letters and symbols to be in
a bold font. It is used \unboldmath
command changes math glyphs to be in a normal font;
it too is used \displaystyle
declaration forces the size and style of the
formula to be that of displaymath
, e.g., with limits above and
below summations. For example
$\displaystyle \sum_{n=0}^\infty x_n $
_{
exp}
. To get exp to appear as a
superscript, you type ^{
exp}
. &latex; handles
superscripted superscripts and all of that stuff in the natural way.
It even does the right thing when something has both a subscript and a
superscript.
$\pi$
in your source, you will get
the pi symbol () in your output.
math
environment, &latex; ignores the spaces you type and
puts in the spacing according to the normal rules for mathematics
texts. If you want different spacing, &latex; provides the following
commands for use in math mode:
num
divided by den
.
\left( \sum_i=1^10 a_i \right]
.
x+y
would be typed as
$\sqrt[3]{x+y}$
.
\stackrel{f}{\longrightarrow}
.
\mbox
, &latex; would keep typesetting them from left
to right inside a single box, and then complain because the resulting
box was too wide to fit on the line.
\mbox
command. You can get it to enter a different mode inside the box - for
example, you can make it enter math mode to put a formula in the box.
There are also several text-producing commands and environments for
making a box that put &latex; in paragraph mode. The box make by one of
these commands or environments will be called a parbox
. When
&latex; is in paragraph mode while making a box, it is said to be in
&textldquo;inner paragraph mode&textrdquo;. Its normal paragraph mode, which it starts out
in, is called &textldquo;outer paragraph mode&textrdquo;.
\documentclass
command determines the size and position of
the page&textrsquo;s head and foot. The page style determines what goes in them.
\maketitle
\maketitle
command generates a title on a separate title
page&textmdash;except in the article
class, where the title is placed
at the top of the first page. Information used to produce the title
is obtained from the following declarations:
\author
\author
\author
command declares the document author(s), where the
argument is a list of authors separated by \and
commands. Use
\\
to separate lines within a single author&textrsquo;s entry&textmdash;for
example, to give the author&textrsquo;s institution or address.
\date
command declares text to be the document&textrsquo;s
date. With no \date
command, the current date (\thanks
command produces a \footnote
to the title,
usually used for credit acknowledgements.
\title
\title
command declares text to be the title of the
document. Use \\
to force a line break, as usual.
\pagenumbering
\pagenumbering{style}
\pagestyle
\pagestyle{style}
\pagestyle
command specifies how the headers and footers
are typeset from the current page onwards. Values for style:
\markboth
and \markright
:
\markboth
command before
the end of the page, while a &textldquo;right-hand heading&textrdquo; (right is
generated by the first \markboth
or \markright
that
comes on the page if there is one, otherwise by the last one before
the page.
\thispagestyle{style}
\thispagestyle
command works in the same manner as the
\pagestyle
command (see previous section) except that it
changes to style for the current page only.
\,
to produce a &textldquo;thin&textrdquo;
space (usually 1/6\hspace
\hspace[*]{length}
\hspace
command adds horizontal space. The length
argument can be expressed in any terms that &latex; understands:
points, inches, etc. It is a rubber length. You can add both
negative and positive space with an \hspace
command; adding
negative space is like backspacing.
*
form.
\hfill
\hfill
fill command produces a &textldquo;rubber length&textrdquo; which has
no natural space but can stretch or shrink horizontally as far as
needed.
\fill
parameter is the rubber length itself (technically,
the glue value 0pt plus1fill); thus, \hspace\fill
is
equivalent to \hfill
.
\SPACE
\
(space) command produces a normal interword space. It&textrsquo;s
useful after punctuation which shouldn&textrsquo;t end a sentence. For example
Knuth's article in Proc.\ Amer.\ Math\. Soc.\ is fundamental
.
It is also often used after control sequences, as in \TeX\ is a
nice system.
\
\
\
.
\&arobase;
\&arobase;
command makes the following punctuation character end a
sentence even if it normally would not. This is typically used after
a capital letter. Here are side-by-side examples with and without
\&arobase;
:
&dots; in C\&arobase;. Pascal, though &dots; &dots; in C. Pascal, though &dots;
\thinspace
\thinspace
produces an unbreakable and unstretchable space that
is 1/6 of an em. This is the proper space to use in nested quotes, as
in &textrsquo;\/
\/
command produces an italic correction. This is a
small space defined by the font designer for a given character,
to avoid the character colliding with whatever follows. The italic
f character typically has a large italic correction value.
\hrulefill
\hrulefill
fill command produces a &textldquo;rubber length&textrdquo; which can
stretch or shrink horizontally. It will be filled with a horizontal
rule.
\dotfill
\dotfill
command produces a &textldquo;rubber length&textrdquo; that fills
with dots instead of just white space.
\addvspace
\addvspace{length}
\addvspace
command normally adds a vertical space of height
length. However, if vertical space has already been added to the same
point in the output by a previous \addvspace
command, then this
command will not add more space than needed to make the natural length
of the total vertical space equal to length
.
\bigskip \medskip \smallskip
\...amount
parameters are determined by the document class.
\vfill
\vfill
fill command produces a rubber length (glue) which
can stretch or shrink vertically as far as needed. It&textrsquo;s equivalent to
\vspace{\fill}
(\vspace[*]{length}
\vspace[*]{length}
\vspace
command adds the vertical space length, i.e.,
a rubber length. length can be negative or positive.
\vspace
at
the top or bottom of a page. With the optional *
argument, the
space is not removed.
\mbox{text}
\mbox
command creates a box just wide enough to hold the
text created by its argument. The text is not broken into
lines, so it can be used to prevent hyphenation.
\fbox
and \framebox
\fbox{text} \framebox[width][position]{text}
\fbox
and \framebox
commands are like \mbox
,
except that they put a frame around the outside of the box being created.
\framebox
command allows for explicit
specification of the box width with the optional width argument
(a dimension), and positioning with the optional position
argument.
\fboxrule
(default
.4pt), and leave a space of \fboxsep
(default
3pt) between the rule and the contents of the box.
\framebox
command in the
picture
environment.
lrbox
\begin{lrbox}{cmd} text \end{lrbox}
\sbox
.
cmd
, which
must have been declared with \newsavebox
.
\makebox
\makebox[width][position]{text}
\makebox
command creates a box just wide enough to contain
the text specified. The width of the box is specified by the
optional width argument. The position of the text within the box
is determined by the optional position argument, which may take
the following values:
\makebox
is also used within the picture environment
\parbox
\parbox[position][height][inner-pos]{width}{text}
\parbox
command produces a box whose contents are created
in paragraph
mode. It should be used to make a box small
pieces of text, with nothing fancy inside. In particular, you
shouldn&textrsquo;t use any paragraph-making environments inside a
\parbox
argument. For larger pieces of text, including ones
containing a paragraph-making environment, you should use a
minipage
environment (\parbox
has two mandatory arguments:
\raisebox
\raisebox{distance}[height][depth]{text}
\raisebox
command raises or lowers text. The first
mandatory argument specifies how high text is to be raised (or
lowered if it is a negative amount). text itself is processed
in LR mode.
\savebox
\savebox{\boxcmd}[width][pos]{text}
\makebox
(\newsavebox
(\sbox{\boxcmd}{text}
\sbox{\boxcmd}{text}
\sbox
types text in a box just as with \mbox
(\newsavebox
(\usebox{\boxcmd
\usebox{\boxcmd}
\usebox
producesthe box most recently saved in the bin
\boxcmd by a \savebox
command (# $ % & ~ _ ^ \ { }
\
in front of the character. For
example, \$
will produce $
in your output.
\
itself, because \\
has
its own special (context-dependent) meaning. A roman \ is produced by
typing $\backslash$
in your file, and a typewriter \
is
produced by using \ in a verbatim command (\~
and \^
place tilde and circumflex accents over
the following letter, as in ~
or ^
, you can again use a verbatim
command.
\symbol
command. For example, the
visible space character used in the \verb*
command has the code
decimal 32, so it can be typed as \symbol{32}
.
'
or hexadecimal numbers
with "
, so the previous example could also be written as
\symbol{'40}
or \symbol{"20}
.
textcomp
package.
\ldots
and \dots
also work in math mode.
\textcapital...
form
has the cap height of the font, while the \textascender...
form
has the ascender height.
$
)$
)---
)---
)--
)--
)!`
)!`
)?`
)?`
)``
)``
)'
)'
)`
)`
)'
)'
)babel
package and related support. This
section does not attempt to cover all that support. It merely lists
the core &latex; commands for creating accented characters.
\capital...
commands produce alternative forms for use with
capital letters. These are not available with OT1.
\rule
\rule[raise]{width}{thickness}
\rule
command produces rules, that is, lines or
rectangles. The arguments are:
\today
\today
command produces today&textrsquo;s date, in the format
month dd, yyyy; for example, &textlsquo;July 4, 1976&textrsquo;.
It uses the predefined counters \day
, \month
, and
\year
(datetime
packagedatetime
package, among others, can produce a wide variety
of other date formats.
\include
\include{file}
\includeonly
command is present, the \include
command executes \clearpage
to start a new page
(\clearpage
.
\includeonly
command, the \include
actions are
only run if file is listed as an argument to
\includeonly
. See the next section.
\include
, not allowed\include
command may not appear in the preamble or in a file
read by another \include
command.
includeonly
\includeonly{file1,file2,...}
\includeonly
command controls which files will be read by
subsequent \include
commands. The list of filenames is
comma-separated. Each file must exactly match a filename
specified in a \include
command for the selection to be
effective.
\input{file}
\input
command causes the specified file to be read
and processed, as if its contents had been inserted in the current
file at that point.
\tableofcontents
command. You put the command right where you want the table of
contents to go; &latex; does the rest for you. A previous run must
have generated a \tableofcontents
command produces a heading, but it does
not automatically start a new page. If you want a new page after the
table of contents, write a \newpage
command after the
\tableofcontents
command.
\listoffigures
and \listoftables
produce a list of figures and a list of tables, respectively.
Everything works exactly the same as for the table of contents.
\nofiles
overrides these commands, and
\addcontentsline
{ext}{unit}{text}
command adds an entry to the specified list or table where:
\contentsline{unit}{name}
.
\addtocontents
{ext}{text} command adds text
(or formatting commands) directly to the \makeglossary
enables creating glossaries.
\glossary{text}
writes a glossary entry for
text to an auxiliary file with the \glossaryentry{text}{pageno}
, where
pageno is the current \thepage
value.
glossary
package on CTAN provides support for fancier
glossaries.
\makeindex
enables creating indexes. Put this in
the preamble.
\index{text}
writes an index entry for
text to an auxiliary file with the \indexentry{text}{pageno}
, where pageno
is the current \thepage
value.
\index{bar|see{foo}}
. Use seealso
instead of see
to make a &textlsquo;See also&textrsquo; entry.
\seename
, and &textlsquo;See also&textrsquo;
by the macro \alsoname
. These can be redefined for other
languages.
makeidx
package\printindex
command.
This is defined in the makeidx
package, so
\usepackage{makeidx}
needs to be in the preamble.
\indexspace
is inserted before each new
letter in the printed index; its default value is 10pt plus5pt
minus3pt.
showidx
packageshowidx
package causes each index entries to be shown in
the margin on the page where the entry appears. This can help in
preparing the index.
multind
packagemultind
package supports multiple indexes. See also the
&tex; FAQ entry on this topic,
letter
document class is designed to make a number of letters at
once, although you can make just one if you so desire.
\documentclass{letter} \begin{document} ... letters ... \end{document}
letter
environment, whose argument is the name
and address of the recipient. For example, you might have:
\begin{letter}{Mr. Joe Smith\\ 2345 Princess St. \\ Edinburgh, EH1 1AA} ... \end{letter}
\opening
command. The text of
the letter follows. It is typed as ordinary &latex; input. Commands that
make no sense in a letter, like \chapter
, do not work. The letter
closes with a \closing
command.
closing
, you can have additional material. The
\cc
command produces the usual &textldquo;cc: &dots;&textrdquo;. There&textrsquo;s also a
similar \encl
command for a list of enclosures. With both these
commands, use \\
to separate the items.
letter
class.
\address
specifies the return address of a letter, as it
should appear on the letter and the envelope. Separate lines of the
address should be separated by \\
commands.
\address
declaration, then the letter
will be formatted for copying onto your organisation&textrsquo;s standard
letterhead. (\address
declaration, then the
letter will be formatted as a personal letter.
\cc
\cc{name1\\name2}
\closing
\closing{text}
\closing
command, for example,
\closing{Best Regards,}
\encl
\encl{line1\\line2}
\location
\location{address}
firstpage
pagestyle is selected.
\makelabels
\makelabels{number}
\name
\name{June Davenport}
\opening{text}
\opening{text}
\opening
command. The mandatory
argument, text, is whatever text you wish to start your letter.
For instance:
\opening{Dear Joe,}
\ps
\ps
command to start a postscript in a letter, after
\closing
.
\signature{text}
\\
starts a new line within
text as usual.
\startbreaks
\startbreaks
\stopbreaks
command to allow page breaks again.
\stopbreaks
\stopbreaks
\startbreaks
command occurs.
\telephone
\telephone{number}
firstpage
pagestyle is selected.
\typein[cmd]{msg}
\typein[\cmd]{msg}
\typein
prints msg on the terminal and causes &latex; to
stop and wait for you to type a line of input, ending with return. If
the optional \cmd argument is omitted, the typed input is
processed as if it had been included in the input file in place of the
\typein
command. If the \cmd argument is present, it
must be a command name. This command name is then defined or
redefined to be the typed input.
\typeout{msg}
\typeout{msg}
msg
on the terminal and in the log
file.
Commands in msg
that are defined with \newcommand
or
\renewcommand
(among others) are replaced by their definitions
before being printed.
msg
. A
\space
command in msg
causes a single space to be
printed, independent of surrounding spaces. A ^^J
in
msg
prints a newline.
latex '\nonstopmode\input foo.tex'
\stop
(and return) and it will prematurely end the document.
book
templatebeamer
templatebeamer
class creates slides presentations.
tugboat
template