Environments
LaTeX provides many environments for marking off certain text. Each environment begins and ends in the same manner:

\begin{envname}
...
\end{envname}

abstract
Synopsis:

\begin{abstract}
...
\end{abstract}

Environment for producing an abstract, possibly of multiple paragraphs.

array
Synopsis:

\begin{array}{cols}
column 1 entry &column 2 entry ... &column n entry \\
...
\end{array}

or

\begin{array}[pos]{cols}
column 1 entry &column 2 entry ... &column n entry \\
...
\end{array}

Produce a mathematical array. This environment can only be used in math mode, and normally appears within a displayed mathematics environment such as equation (see equation). Column entries are separated by an ampersand (&). Rows are terminated with double-backslashes (\\) (see \\).
The required argument cols describes the number of columns, their alignment, and the formatting of the intercolumn regions. See tabular for the complete description of cols, and of the other common features of the two environments, including the optional pos argument.
There are two ways that array diverges from tabular. The first is that array entries are typeset in mathematics mode, in textstyle (except if the cols definition specifies the column with @p{..}, which causes the entry to be typeset in text mode). The second is that, instead of tabular’s parameter \tabcolsep, LaTeX’s intercolumn space in an array is governed by \arraycolsep which gives half the width between columns. The default for this is ‘5pt’.
To obtain arrays with braces the standard is to use the amsmath package. It comes with environments pmatrix for an array surrounded by parentheses (..), bmatrix for an array surrounded by square brackets [..], Bmatrix for an array surrounded by curly braces {..}, vmatrix for an array surrounded by vertical bars |..|, and Vmatrix for an array surrounded by double vertical bars ||..||, along with a number of other array constructs.
Here is an example of an array:

\begin{equation}
  \begin{array}{cr}
    \sqrt{y}  &12.3 \\
    x^2       &3.4       
  \end{array}
\end{equation}

center
Synopsis:

\begin{center}
 .. text ..
\end{center}

Environment to create a sequence of lines that are centered within the left and right margins on the current page. If the text in the environment body is too long to fit on a line, LaTeX will insert line breaks that avoid hyphenation and avoid stretching or shrinking any interword space. To force a line break at a particular spot use double-backslash \\ (see \\).
This environment inserts space above and below the text body. See \centering to avoid such space, for example inside a figure environment.
In this example, depending on the line width, LaTeX may choose a break for the part before the double backslash, will center the line or two, then will break at the double backslash, and will center the ending.

\begin{center}
  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{center}

A double backslash after the final line is optional.

\centering
Declaration that causes material in its scope to be centered. It is most often used inside an environment such as figure, or in a parbox.
Unlike the center environment, the \centering command does not add vertical space above and below the text.
It also does not start a new paragraph; it simply changes how LaTeX formats paragraph units. If ww {\centering xx \\ yy} zz is surrounded by blank lines then LaTeX will create a paragraph whose first line ‘ww xx’ is centered and whose second line, not centered, contains ‘yy zz’. Usually what is desired is for the scope of the declaration to contain a blank line or the \end command of an environment such as figure or table that ends the paragraph unit. Thus, if {\centering xx \\ yy\par} zz is surrounded by blank lines then it makes a new paragraph with two centered lines ‘xx’ and ‘yy’, followed by a new paragraph with ‘zz’ that is formatted as usual. See also the following example.
This example’s \centering causes the graphic to be horizontally centered.

\begin{figure}
  \centering
  \includegraphics[width=0.6\textwidth]{ctan_lion.png}
  \caption{CTAN Lion}  \label{fig:CTANLion}
\end{figure}

The scope of the \centering ends with the \end{figure}.

description
Synopsis:

\begin{description}
\item [first label] text of first item
\item [second label] text of second item
  ...
\end{description}

Environment to make a labelled list of items. Each item’s label is typeset in bold, flush-left. Each item’s text may contain multiple paragraphs. Although the labels on the items are optional there is no sensible default, so all items should have labels.
The list consists of at least one item; see \item (having no items causes the LaTeX error ‘Something's wrong--perhaps a missing \item’). Each item is produced with an \item command.
Since the labels are in bold style, if the label text calls for a font change given in argument style (see Font styles) then it will come out bold. For instance, if the label text calls for typewriter with \item[\texttt{label text}] then it will appear in bold typewriter, if that is available. The simplest way to get non-bolded typewriter is to use declaritive style \item[{\tt label text}]. Similarly, get normal text use \item[{\rm label text}].
For other major LaTeX labelled list environments, see itemize and enumerate. For information about customizing list layout, see list; also, the package enumitem is useful for this.
This example shows the environment used for a sequence of definitions.

\begin{definition}
  \item[lama] A priest.
  \item[llama] A beast.
\end{definition}

displaymath
Synopsis:

\begin{displaymath}
  .. math text ..
\end{displaymath}

Environment to typeset the math text on its own line, in display style and centered. To make the text be flush-left use the global option fleqn; see Document class options.
LaTeX will not break the math text across lines.
In the displaymath environment no equation number is added to the math text. One way to get an equation number is to use the equation environment (see equation).
Note that the amsmath package has extensive displayed equation facilities. Those facilities are the best approach for such output in new documents. For example, there are a number of options in that package for having math text broken across lines.
The construct \[..math text..\] is essentially a synonym for \begin{displaymath}..math text..\end{displaymath} but the latter is easier to work with in the source file; for instance, searching for a square bracket may get false positives but the word displaymath will likely be unique. (The construct $$..math text..$$ from Plain TeX is sometimes mistakenly used as a synonym for displaymath. It is not a synonym, because the displaymath environment checks that it isn’t started in math mode and that it ends in math mode begun by the matching environment start, because the displaymath environment has different vertical spacing, and because the displaymath environment honors the fleqn option.)
The output from this example is centered and alone on its line.

\begin{displaymath}
  \int_1^2 x^2\,dx=7/3
\end{displaymath}

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

document
The document environment encloses the entire body of a document. It is required in every LaTeX document. See Starting and ending.
Synopsis:

\AtBeginDocument{code}

Save code and execute it when \begin{document} 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.
You can issue this command more than once; the successive code lines will be executed in the order that you gave them.
Synopsis:

\AtEndDocument{code}

Save code and execute it near the end of the document. Specifically, it is executed when \end{document} 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 \clearpage at the appropriate point in code.
You can issue this command more than once; the successive code lines will be executed in the order that you gave them.

enumerate
Synopsis:

\begin{enumerate}
\item [first label] text of first item
\item [second label] text of second item
...
\end{enumerate}

Environment to produce a numbered list of items. The format of the label numbering depends on whether this environment is nested within another; see below.
The list consists of at least one item. Having no items causes the LaTeX error ‘Something's wrong--perhaps a missing \item’. Each item is produced with an \item command.
This example lists the top two finishers in the 1908 Olympic marathon.

\begin{enumerate}
 \item Johnny Hayes (USA)
 \item Charles Hefferon (RSA) 
\end{enumerate}

Enumerations may be nested within a paragraph-making environment, including itemize (see itemize), description (see description) and enumeration, up to four levels deep. The format of the label produced depends on the place in the nesting. This gives LaTeX’s default for the format at each nesting level (where 1 is the outermost level):
arabic number followed by a period: ‘1.’, ‘2.’, …
lower case letter inside parentheses: ‘(a)’, ‘(b)’ …
lower case roman numeral followed by a period: ‘i.’, ‘ii.’, …
upper case letter followed by a period: ‘A.’, ‘B.’, …
The enumerate environment uses the counters \enumi through \enumiv counters (see Counters). If you use the optional argument to \item then the counter is not incremented for that item (see \item).
To change the format of the label use \renewcommand (see \newcommand & \renewcommand) on the commands \labelenumi through \labelenumiv. For instance, this first level list will be labelled with uppercase letters, in boldface, and without a trailing period:

\renewcommand{\labelenumi}{\textbf{\Alph{enumi}}}
\begin{enumerate}
  \item eI
  \item bi:
  \item si:
\end{enumerate}

For a list of counter-labelling commands like \Alph see \alph \Alph \arabic \roman \Roman \fnsymbol.
For more on customizing the layout see list. Also, the package enumitem is useful for this.

eqnarray
First, a caveat: the eqnarray environment is depreciated. It has infelicities that cannot be overcome, including spacing that is inconsistent with other mathematics elements (see the article “Avoid eqnarray!” by Lars Madsen http://tug.org/TUGboat/tb33-1/tb103madsen.pdf). New documents should include the amsmath package and use the displayed mathematics environments provided there, such as the align environment.
Nevertheless, for completeness and for a reference when working with old documents, a synopsis:

\begin{eqnarray} 
  first formula left  &first formula middle  &first formula right \\
  ...
\end{eqnarray}

or

\begin{eqnarray*} 
  first formula left  &first formula middle  &first formula right \\
  ...
\end{eqnarray*}

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.
It is similar to a three-column array environment, with items within a row separated by an ampersand (&), and with rows separated by double backslash  \\). The starred form of line break (\\*) can also be used to separate equations, and will disallow a page break there (see \\).
The unstarred form eqnarray places an equation number on every line (using the equation counter), unless that line contains a \nonumber command. The starred form eqnarray* omits equation numbering, while otherwise being the same.
The command \lefteqn is used for splitting long formulas across lines. It typesets its argument in display style flush left in a box of zero width.
This example shows three lines. The first two lines make an inequality, while the third line has not entry on the left side.

\begin{eqnarray*}
  \lefteqn{x_1+x_2+\cdots+x_n}     \\
    &\leq &y_1+y_2+\cdots+y_n      \\
    &=    &z+y_3+\cdots+y_n
\end{eqnarray*}

equation
Synopsis:

\begin{equation}
  math text
\end{equation}

Make a displaymath environment (see displaymath) with an equation number in the right margin.
The equation number is generated using the equation counter.
Note that the amsmath package has extensive displayed equation facilities. Those facilities are the best approach for such output in new documents.

figure
Synopsis:

\begin{figure}[placement]
  figure body
\caption[loftitle]{title}
\label{label}
\end{figure}

or

\begin{figure*}[placement]
  figure body
\caption[loftitle]{title}
\label{label}
\end{figure*}

A class of floats (see Floats). Because they cannot be split across pages, they are not typeset in sequence with the normal text but instead are “floated” to a convenient place, such as the top of a following page.
For the possible values of placement and their effect on the float placement algorithm, see Floats.
The starred form figure* is used when a document is in double-column mode (see \twocolumn). 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 placement b in Floats.
The figure body is typeset in a parbox of width \textwidth and so it can contain text, commands, etc.
The label is optional; it is used for cross-references (see Cross references). The optional \caption command specifies caption text for the figure. By default it is numbered. If loftitle is present, it is used in the list of figures instead of title (see Tables of contents).
This example makes a figure out of a graphic. It requires one of the packages graphics or graphicx. The graphic, with its caption, will be placed at the top of a page or, if it is pushed to the end of the document, on a page of floats.

\begin{figure}[t]
  \centering
  \includegraphics[width=0.5\textwidth]{CTANlion.png}
  \caption{The CTAN lion, by Duane Bibby}
\end{figure}

filecontents: Write an external file
Synopsis:

\begin{filecontents}{filename}
  text
\end{filecontents}

or

\begin{filecontents*}{filename}
  text
\end{filecontents*}

Create a file named filename and fill it with text. The unstarred version of the environment filecontents prefixes the content of the created file with a header; see the example below. The starred version filecontents* does not include the header.
This environment can be used anywhere in the preamble, although it often appears before the \documentclass command. It is typically used when a source file requires a nonstandard style or class file. The environment will write that file to the directory containing the source and thus make the source file self-contained. Another use is to include bib references in the file, again to make it self-contained.
The environment checks whether a file of that name already exists and if so, does not do anything. There is a filecontents package that redefines the filecontents environment so that instead of doing nothing in that case, it will overwrite the existing file.
For example, this document

\documentclass{article}
\begin{filecontents}{JH.sty}
\newcommand{\myname}{Jim Hef{}feron}
\end{filecontents}
\usepackage{JH}
\begin{document}
Article by \myname.
\end{document}

produces this file JH.sty.

%% LaTeX2e file `JH.sty'
%% generated by the `filecontents' environment
%% from source `test' on 2015/10/12.
%%
\newcommand{\myname}{Jim Hef{}feron}

flushleft

\begin{flushleft}
line1 \\
line2 \\
...
\end{flushleft}

The 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
The \raggedright declaration corresponds to the flushleft environment. This declaration can be used inside an environment such as quote or in a parbox.
Unlike the flushleft environment, the \raggedright command does not start a new paragraph; it only changes how LaTeX formats paragraph units. To affect a paragraph unit’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}

The flushright environment allows you to create a paragraph consisting of lines that are flush to the right-hand margin and ragged left. Each line must be terminated with the control sequence \\.

\raggedleft
The \raggedleft declaration corresponds to the flushright environment. This declaration can be used inside an environment such as quote or in a parbox.
Unlike the flushright environment, the \raggedleft command does not start a new paragraph; it only changes how LaTeX formats paragraph units. To affect a paragraph unit’s format, the scope of the declaration must contain the blank line or \end command that ends the paragraph unit.

itemize
Synopsis:

\begin{itemize}
\item item1
\item item2
...
\end{itemize}

The itemize environment produces an “unordered”, “bulleted” 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 (see enumerate).
Each item of an itemize list begins with an \item command. There must be at least one \item command within the environment.
By default, the marks at each level look like this:
• (bullet)
-- (bold en-dash)
* (asterisk)
. (centered dot, rendered here as a period)
The 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$}

The \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.
The defaults vary from ‘.5em’ (highest levels of nesting) to ‘2.5em’ (first level), and are a bit reduced in two-column mode. This example greatly reduces the margin space for outermost lists:

\setlength{\leftmargini}{1.25em} % default 2.5em

Some parameters that affect list formatting:
\itemindent 	Extra indentation before each item in a list; default zero.
\labelsep 	Space between the label and text of an item; default ‘.5em’.
\labelwidth 	Width of the label; default ‘2em’, or ‘1.5em’ in two-column mode.
\listparindent 	Extra indentation added to second and subsequent paragraphs within a list item; default ‘0pt’.
\rightmargin 	Horizontal distance between the right margin of the list and the enclosing environment; default ‘0pt’, except in the quote, quotation, and verse environments, where it is set equal to \leftmargin.
Parameters affecting vertical spacing between list items (rather loose, by default).
\itemsep 	Vertical space between items. The default is 2pt plus1pt minus1pt for 10pt documents, 3pt plus2pt minus1pt for 11pt, and 4.5pt plus2pt minus1pt for 12pt.
\parsep 	Extra vertical space between paragraphs within a list item. Defaults are the same as \itemsep.
\topsep 	Vertical space between the first item and the preceding paragraph. For top-level lists, the default is 8pt plus2pt minus4pt for 10pt documents, 9pt plus3pt minus5pt for 11pt, and 10pt plus4pt minus6pt for 12pt. These are reduced for nested lists.
\partopsep 	Extra space added to \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.
Especially for lists with short items, it may be desirable to elide space between items. Here is an example defining an itemize* environment with no extra spacing between items, or between paragraphs within a single item (\parskip is not list-specific, see \parskip):

\newenvironment{itemize*}%
  {\begin{itemize}%
    \setlength{\itemsep}{0pt}%
    \setlength{\parsep}{0pt}}%
    \setlength{\parskip}{0pt}}%
  {\end{itemize}}

letter environment: writing letters
This environment is used for creating letters. See Letters.

list
The 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}

The mandatory labeling argument specifies how items should be labelled (unless the optional argument is supplied to \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.
The mandatory spacing argument contains commands to change the spacing parameters for the list. This argument will most often be empty, i.e., {}, which leaves the default spacing.
The width used for typesetting the list items is specified by \linewidth (see Page layout parameters).
Synopsis:

\item text of item

or

\item[optional label] text of item

An entry in a list. The entries are prefixed by a label, whose default depends on the list type.
Because the optional argument optional label is surrounded by square brackets ([ and ]), to use square brackets inside the optional argument you must hide them inside curly braces, as in \item[Close square bracket, {]}]. Similarly, to use an open square bracket as first character in the text of the item, also hide it inside curly braces. See LaTeX command syntax.
In this example the enumerate list has two items that use the default label and one that uses the optional label.

\begin{enumerate}
  \item Moe
  \item[sometimes] Shemp
  \item Larry
\end{enumerate}

The first item is labelled ‘1.’, the second item is labelled ‘sometimes’, and the third item is labelled ‘2.’ (note that, because of the optional label in the second item, the third item does not get a ‘3.’).

math
Synopsis:

\begin{math}
math
\end{math}

The math environment inserts the given math within the running text. \(...\) and $...$ are synonyms. See Math formulas.

minipage

\begin{minipage}[position][height][inner-pos]{width}
text
\end{minipage}

The minipage environment typesets its body text in a block that will not be broken across pages. This is similar to the \parbox command (see \parbox), but unlike \parbox, other paragraph-making environments can be used inside a minipage.
The arguments are the same as for \parbox (see \parbox).
By default, paragraphs are not indented in the minipage environment. You can restore indentation with a command such as \setlength{\parindent}{1pc} command.
Footnotes in a 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 (see Counters).
However, don’t put one minipage inside another if you are using footnotes; they may wind up at the bottom of the wrong minipage.

picture

\begin{picture}(width,height)(xoffset,yoffset)
… picture commands …
\end{picture}

The picture environment allows you to create just about any kind of picture you want containing text, lines, arrows and circles. You tell LaTeX where to put things in the picture by specifying their coordinates. A coordinate is a number that may have a decimal point and a minus sign—a number like 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. The default value is 1pt.
A position is a pair of coordinates, such as (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.
The picture environment has one mandatory argument which is a position (width,height), which specifies the size of the picture. The environment produces a rectangular box with these width and height.
The picture environment also has an optional position argument (xoffset,yoffset), following the size argument, that can change the origin. (Unlike ordinary optional arguments, this argument is not contained in square brackets.) The optional argument gives the coordinates of the point at the lower-left corner of the picture (thereby determining the origin). For example, if \unitlength has been set to 1mm, the command

\begin{picture}(100,200)(10,20)

produces a picture of width 100 millimeters and height 200 millimeters, whose lower-left corner is the point (10,20) and whose upper-right corner is therefore the point (110,220). When you first draw a picture, you typically omit the optional argument, leaving the origin at the lower-left corner. If you then want to modify your picture by shifting everything, you can just add the appropriate optional argument.
The environment’s mandatory argument determines the nominal size of the picture. This need bear no relation to how large the picture really is; LaTeX will happily allow you to put things outside the picture, or even off the page. The picture’s nominal size is used by LaTeX in determining how much room to leave for it.
Everything that appears in a picture is drawn by the \put command. The command

\put (11.3,-.3){...}

puts the object specified by ... in the picture, with its reference point at coordinates (11.3,-.3). The reference points for various objects will be described below.
The \put command creates an LR box. You can put anything that can go in an \mbox (see \mbox) in the text argument of the \put command. When you do this, the reference point will be the lower left corner of the box.
The picture commands are described in the following sections.

\circle
Synopsis:

\circle[*]{diameter}

The \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.
Circles up to 40pt can be drawn.

\makebox
Synopsis:

\makebox(width,height)[position]{text}

The \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.
The optional argument, [position], specifies the quadrant that your text appears in. You may select up to two of the following:
t 	Moves the item to the top of the rectangle.
b 	Moves the item to the bottom.
l 	Moves the item to the left.
r 	Moves the item to the right.
See \makebox.

\framebox
Synopsis:

\framebox(width,height)[pos]{...}

The \framebox command is like \makebox (see previous section), except that it puts a frame around the outside of the box that it creates.
The \framebox command produces a rule of thickness \fboxrule, and leaves a space \fboxsep between the rule and the contents of the box.

\dashbox
Draws a box with a dashed line. Synopsis:

\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.
A dashed box looks best when the rwidth and rheight are multiples of the dlen.

\frame
Synopsis:

\frame{text}

The \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
Synopsis:

\line(xslope,yslope){length}

The \line command draws a line with the given length and slope xslope/yslope.
Standard LaTeX can only draw lines with slope = x/y, where x and y have integer values from −6 through 6. For lines of any slope, and plenty of other shapes, see pict2e and many other packages on CTAN.

\linethickness
The \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
The \thicklines command is an alternate line thickness for horizontal and vertical lines in a picture environment; cf. \linethickness and \thinlines.

\thinlines
The \thinlines command is the default line thickness for horizontal and vertical lines in a picture environment; cf. \linethickness and \thicklines.

\multiput
Synopsis:

\multiput(x,y)(delta_x,delta_y){n}{obj}

The \multiput command copies the object obj in a regular pattern across a picture. obj is first placed at position (x,y), then at (x+\delta x,y+\delta y), and so on, n times.

\oval
Synopsis:

\oval(width,height)[portion]

The \oval command produces a rectangle with rounded corners. The optional argument portion allows you to produce only half of the oval via the following:
t 	selects the top half;
b 	selects the bottom half;
r 	selects the right half;
l 	selects the left half.
It is also possible to produce only one quarter of the oval by setting portion to tr, br, bl, or tl.
The “corners” of the oval are made with quarter circles with a maximum radius of 20pt, so large “ovals” will look more like boxes with rounded corners.

\put
Synopsis:

\put(xcoord,ycoord){ ... }

The \put command places the material specified by the (mandatory) argument in braces at the given coordinate, (xcoord,ycoord).

\shortstack
Synopsis:

\shortstack[position]{...\\...\\...}

The \shortstack command produces a stack of objects. The valid positions are:
r 	Move the objects to the right of the stack.
l 	Move the objects to the left of the stack
c 	Move the objects to the centre of the stack (default)
Objects are separated with \\.

\vector
Synopsis:

\vector(xslope,yslope){length}

The \vector command draws a line with an arrow of the specified length and slope. The xslope and yslope values must lie between −4 and +4, inclusive.

quotation and quote
Synopsis:

\begin{quotation}
text
\end{quotation}

or

\begin{quote}
text
\end{quote}

Include a quotation.
In both environments, margins are indented on both sides by \leftmargin and the text is justified at both. As with the main text, leaving a blank line produces a new paragraph.
To compare the two: in the quotation environment, paragraphs are indented by 1.5em and the space between paragraphs is small, 0pt plus 1pt. In the quote environment, paragraphs are not indented and there is vertical space between paragraphs (it is the rubber length \parsep). Thus, the quotation environment may be more suitable for documents where new paragraphs are marked by an indent rather than by a vertical separation. In addition, quote may be more suitable for a short quotation or a sequence of short quotations.

\begin{quotation}
\it Four score and seven years ago
  .. shall not perish from the earth.
\hspace{1em plus 1fill}---Abraham Lincoln
\end{quotation}

tabbing
Synopsis:

\begin{tabbing}
row1col1 \= row1col2 \= row1col3 \= row1col4 \\
row2col1 \>                \> row2col3 \\
...
\end{tabbing}

The 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.
This environment can be broken across pages, unlike the tabular environment.
The following commands can be used inside a tabbing environment:
\\ (tabbing) 	End a line.
\= (tabbing) 	Sets a tab stop at the current position.
\> (tabbing) 	 Advances to the next tab stop.
\< 	Put following text to the left of the local margin (without changing the margin). Can only be used at the start of the line.
\+ 	Moves the left margin of the next and all the following commands one tab stop to the right, beginning tabbed line if necessary.
\- 	Moves the left margin of the next and all the following commands one tab stop to the left, beginning tabbed line if necessary.
\' (tabbing) 	Moves everything that you have typed so far in the current column, i.e., everything from the most recent \>, \<, \', \\, or \kill command, to the right of the previous column, flush against the current column’s tab stop.
\` (tabbing) 	Allows you to put text flush right against any tab stop, including tab stop 0. However, it can’t move text to the right of the last column because there’s no tab stop there. The \` 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.
\a (tabbing) 	 In a tabbing environment, the commands \=, \' and \` do not produce accents as usual (see Accents). Instead, the commands \a=, \a' and \a` are used.
\kill 	Sets tab stops without producing text. Works just like \\ 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.
\poptabs 	 Restores the tab stop positions saved by the last \pushtabs.
\pushtabs 	Saves all current tab stop positions. Useful for temporarily changing tab stop positions in the middle of a tabbing environment.
\tabbingsep 	Distance to left of tab stop moved by \'.
This example typesets a Pascal function in a traditional format:

\begin{tabbing}
function \= fact(n : integer) : integer;\\
         \> begin \= \+ \\
               \> if \= n $>$ 1 then \+ \\
                        fact := n * fact(n-1) \- \\
                  else \+ \\
                        fact := 1; \-\- \\
            end;\\
\end{tabbing}

table
Synopsis:

\begin{table}[placement]
  table body
\caption[loftitle]{title}
\label{label}
\end{table}

A class of floats (see Floats). Because they cannot be split across pages, they are not typeset in sequence with the normal text but instead are “floated” to a convenient place, such as the top of a following page.
For the possible values of placement and their effect on the float placement algorithm, see Floats.
The table body is typeset in a parbox of width \textwidth and so it can contain text, commands, etc.
The label is optional; it is used for cross-references (see Cross references). The optional \caption command specifies caption text for the table. By default it is numbered. If lottitle is present, it is used in the list of tables instead of title (see Tables of contents).
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.

\begin{table}[b]
  \centering
  \begin{tabular}{r|p{2in}} \hline
    One &The loneliest number \\
    Two &Can be as sad as one.
         It's the loneliest number since the number one.
  \end{tabular}
  \caption{Cardinal virtues}
  \label{tab:CardinalVirtues}
\end{table}

tabular
Synopsis:

\begin{tabular}[pos]{cols}
column 1 entry &column 2 entry ... &column n entry \\
  ...
\end{tabular}

or

\begin{tabular*}{width}[pos]{cols}
column 1 entry &column 2 entry ... &column n entry \\
  ...
\end{tabular*}

These environments produce a table, a box consisting of a sequence of horizontal rows. Each row consists of items that are aligned vertically in columns. This illustrates many of the features.

\begin{tabular}{l|l}
  \textit{Player name}  &\textit{Career home runs}  \\ 
  \hline
  Hank Aaron  &755 \\
  Babe Ruth   &714
\end{tabular}

The vertical format of two left-aligned columns, with a vertical bar between them, is specified in tabular’s argument {l|l}. Columns are separated with an ampersand &. A horizontal rule between two rows is created with \hline. The end of each row is marked with a double backslash \\. This \\ is optional after the last row unless an \hline command follows, to put a rule below the table.
The required and optional arguments to tabular consist of:
width 	Required for tabular*, not allowed for tabular. Specifies the width of the tabular* environment. The space between columns should be rubber, as with @{\extracolsep{\fill}}, to allow the table to stretch or shrink to make the specified width, or else you are likely to get the Underfull \hbox (badness 10000) in alignment .. warning.
pos 	Optional. Specifies the table’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: t aligns the table so its top row matches the baseline of the surrounding text, and b aligns on the bottom row.
This only has an effect if there is other text. In the common case of a tabular alone in a center environment this option makes no difference.
cols 	Required. Specifies the formatting of columns. It consists of a sequence of the following specifiers, corresponding to the types of column and intercolumn material.
l 	A column of left-aligned items.
r 	A column of right-aligned items.
c 	A column of centered items.
| 	A vertical line the full height and depth of the environment.
@{text or space} 	This inserts text or space at this location in every row. The text or space material is typeset in LR mode. This text is fragile (see \protect).
This specifier is optional: unless you put in your own @-expression then LaTeX’s book, article, and report classes will put on either side of each column a space of length \tabcolsep, which by default is ‘6pt’. That is, by default adjacent columns are separated by 12pt (so \tabcolsep is misleadingly-named since it is not the separation between tabular columns). Also by default a space of 6pt comes before the first column as well as after the final column, unless you put a @{..} or | there.
If you override the default and use an @-expression then you must insert any desired space yourself, as in @{\hspace{1em}}.
An empty expression @{} will eliminate the space, including the space at the start or end, as in the example below where the tabular lines need to lie on the left margin.

\begin{flushleft}
  \begin{tabular}{@{}l}
    ..
  \end{tabular}
\end{flushleft}

This example shows text, a decimal point, between the columns, arranged so the numbers in the table are aligned on that decimal point.

\begin{tabular}{r@{$.$}l}
  $3$ &$14$  \\
  $9$ &$80665$
\end{tabular}

An \extracolsep{wd} command in an @-expression causes an extra space of width wd to appear to the left of all subsequent columns, until countermanded by another \extracolsep command. Unlike ordinary intercolumn space, this extra space is not suppressed by an @-expression. An \extracolsep command can be used only in an @-expression in the cols argument. Below, LaTeX inserts the right amount of intercolumn space to make the entire table 4 inches wide.

\begin{center}
  \begin{tabular*}{4in}{l@{\ \ldots\extracolsep{\fill}}l}
    Seven times down, eight times up 
    &such is life!
  \end{tabular*}
\end{center}

To insert commands that are automatically executed before a given column, load the array package and use the >{...} specifier.
p{wd} 	Each item in the column is typeset in a parbox of width wd.
Note that a line break double backslash \\ may not appear in the item, except inside an environment like minipage, array, or tabular, or inside an explicit \parbox, or in the scope of a \centering, \raggedright, or \raggedleft declaration (when used in a p-column element these declarations must appear inside braces, as with {\centering .. \\ ..}). Otherwise LaTeX will misinterpret the double backslash as ending the row.
*{num}{cols} 	Equivalent to num copies of cols, where num is a positive integer and cols is a list of specifiers. Thus \begin{tabular}{|*{3}{l|r}|} is equivalent to \begin{tabular}{|l|rl|rl|r|}. Note that cols may contain another *-expression.
Parameters that control formatting:
\arrayrulewidth 	A length that is the thickness of the rule created by |, \hline, and \vline in the tabular and array environments. The default is ‘.4pt’. Change it as in \setlength{\arrayrulewidth}{0.8pt}.
\arraystretch 	A factor by which the spacing between rows in the tabular and array environments is multiplied. The default is ‘1’, for no scaling. Change it as \renewcommand{\arraystretch}{1.2}.
\doublerulesep 	A length that is the distance between the vertical rules produced by the || specifier. The default is ‘2pt’.
\tabcolsep 	A length that is half of the space between columns. The default is ‘6pt’. Change it with \setlength.
The following commands can be used inside the body of a tabular environment, the first two inside an entry and the second two between lines:

\multicolumn
Synopsis:

\multicolumn{numcols}{cols}{text}

Make an array or tabular entry that spans several columns. The first argument numcols gives the number of columns to span. The second argument cols specifies the formatting of the entry, with c for centered, l for flush left, or r for flush right. The third argument text gives the contents of that entry.
In this example, in the first row, the second and third columns are spanned by the single heading ‘Name’.

\begin{tabular}{lccl} 
  \textit{ID}       &\multicolumn{2}{c}{\textit{Name}} &\textit{Age} \\ \hline % row one 
  978-0-393-03701-2 &O'Brian &Patrick                  &55           \\        % row two 
    ..
\end{tabular}

What counts as a column is: the column format specifier for the array or tabular environment is broken into parts, where each part (except the first) begins with l, c, r, or p. So from \begin{tabular}{|r|ccp{1.5in}|} the parts are |r|, c, c, and p{1.5in}|.
The cols argument overrides the array or tabular environment’s intercolumn area default adjoining this multicolumn entry. To affect that area, this argument can contain vertical bars | indicating the placement of vertical rules, and @{..} expressions. Thus if cols is ‘|c|’ 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.

\begin{tabular}{|cc|c|c|}
  \multicolumn{1}{r}{w}       % entry one
    &\multicolumn{1}{|r|}{x}  % entry two 
    &\multicolumn{1}{|r}{y}   % entry three
    &z                        % entry four
\end{tabular}

Before the first entry the output will not have a vertical rule because the \multicolumn has the cols specifier ‘r’ with no initial vertical bar. Between entry one and entry two there will be a vertical rule; although the first cols does not have an ending vertical bar, the second cols does have a starting one. Between entry two and entry three there is a single vertical rule; despite that the cols in both of the surrounding multicolumn’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 cols in the entry three \multicolumn leaves it out, and that takes precedence. Finally, following entry four there is a vertical rule because of the default.
The number of spanned columns numcols can be 1. Besides giving the ability to change the horizontal alignment, this also is useful to override for one row the tabular definition’s default intercolumn area specification, including the placement of vertical rules.
In the example below, in the tabular definition the first column is specified to default to left justified but in the first row the entry is centered with \multicolumn{1}{c}{\textsc{Period}}. Also in the first row, the second and third columns are spanned by a single entry with \multicolumn{2}{c}{\textsc{Span}}, overriding the specification to center those two columns on the page range en-dash.

\begin{tabular}{l|r@{--}l} 
  \multicolumn{1}{c}{\textsc{Period}}  
    &multicolumn{2}{c}{\textsc{Span}} \\ \hline
  Baroque          &1600           &1760         \\
  Classical        &1730           &1820         \\
  Romantic         &1780           &1910         \\
  Impressionistic  &1875           &1925
\end{tabular}

Note that although the tabular specification by default puts a vertical rule between the first and second columns, because there is no vertical bar in the cols of either of the first row’s \multicolumn commands, no rule appears in the first row.

\vline
Draw a vertical line in a tabular or array environment extending the full height and depth of an entry’s row. Can also be used in an @-expression, although its synonym vertical bar | is more common. This command is rarely used; typically a table’s vertical lines are specified in tabular’s cols argument and overriden as needed with \multicolumn.
This example illustrates some pitfalls. In the first line’s second entry the \hfill moves the \vline to the left edge of the cell. But that is different than putting it halfway between the two columns, so in that row between the first and second columns there are two vertical rules, with the one from the {c|cc} specifier coming before the one produced by the \vline\hfill. In contrast, the first line’s third entry shows the usual way to put a vertical bar between two columns. In the second line, the ghi is the widest entry in its column so in the \vline\hfill the \hfill has no effect and the vertical line in that entry appears immediately next to the g, with no whitespace.

\begin{tabular}{c|cc}
  x   &\vline\hfill y   &\multicolumn{1}{|r}{z} \\  
  abc &def &\vline\hfill ghi 
\end{tabular}

\cline
Synopsis:

\cline{i-j}

Draw a horizontal rule in an array or tabular environment beginning in column i and ending in column j. The dash - must appear in the mandatory argument. To span a single column use the number twice.
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.

\begin{tabular}{llrr} 
  a &b &c &d \\ \cline{1-1} \cline{3-4} 
  e &f &g &h 
\end{tabular}

\hline
Draws a horizontal line the width of the enclosing tabular or array environment. It’s most commonly used to draw a line at the top, bottom, and between the rows of a table.
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 \hline, the tabular second row’s line ending double backslash \\ is required.

\begin{tabular}{ll} \hline\hline
  Baseball   &Red Sox  \\
  Basketball &Celtics  \\ \hline
\end{tabular}

thebibliography
Synopsis:

\begin{thebibliography}{widest-label}
\bibitem[label]{cite_key}
...
\end{thebibliography}

The thebibliography environment produces a bibliography or reference list.
In the article class, this reference list is labelled “References”; in the report class, it is labelled “Bibliography”. You can change the label (in the standard classes) by redefining the command \refname. For instance, this eliminates it entirely:

\renewcommand{\refname}{}

The mandatory widest-label argument is text that, when typeset, is as wide as the widest item label produced by the \bibitem commands. It is typically given as 9 for bibliographies with less than 10 references, 99 for ones with less than 100, etc.

\bibitem
Synopsis:

\bibitem[label]{cite_key}

The \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.
This command writes an entry to the .aux file containing the item’s cite_key and label. When the .aux file is read by the \begin{document} command, the item’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
Synopsis:

\cite[subcite]{keys}

The keys argument is a list of one or more citation keys, separated by commas. This command generates an in-text citation to the references associated with keys by entries in the .aux file.
The text of the optional subcite argument appears after the citation. For example, \cite[p.~314]{knuth} might produce ‘[Knuth, p. 314]’.

\nocite
\nocite{keys}
The \nocite command produces no text, but writes keys, which is a list of one or more citation keys, to the .aux file.

Using BibTeX
If you use the BibTeX program by Oren Patashnik (highly recommended if you need a bibliography of more than a couple of titles) to maintain your bibliography, you don’t use the thebibliography environment (see thebibliography). Instead, you include the lines

\bibliographystyle{bibstyle}
\bibliography{bibfile1,bibfile2}

The \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.bst, which defines how your citations will look. The standard style names distributed with BibTeX are:
alpha 	Sorted alphabetically. Labels are formed from name of author and year of publication.
plain 	Sorted alphabetically. Labels are numeric.
unsrt 	Like plain, but entries are in order of citation.
abbrv 	Like plain, but more compact labels.
In addition, numerous other BibTeX style files exist tailored to the demands of various publications. See http://mirror.ctan.org/biblio/bibtex/contrib.
The \bibliography command is what actually produces the bibliography. The argument to \bibliography refers to files named bibfile.bib, which should contain your database in BibTeX format. Only the entries referred to via \cite and \nocite will be listed in the bibliography.

theorem
Synopsis:

\begin{theorem}
theorem-text
\end{theorem}

The theorem environment produces “Theorem n” in boldface followed by theorem-text, where the numbering possibilities for n are described under \newtheorem (see \newtheorem).

titlepage
Synopsis:

\begin{titlepage}
text
\end{titlepage}

The 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 (see \today).
You can use the \maketitle command (see \maketitle) to produce a standard title page without a titlepage environment.

verbatim
Synopsis:

\begin{verbatim}
literal-text
\end{verbatim}

The 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.
The verbatim uses a monospaced typewriter-like font (\tt).

\verb
Synopsis:

\verbcharliteral-textchar
\verb*charliteral-textchar

The \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.
The *-form differs only in that spaces are printed with a “visible space” character.

verse
Synopsis:

\begin{verse}
line1 \\
line2 \\
...
\end{verse}

The verse environment is designed for poetry, though you may find other uses for it.
The margins are indented on the left and the right, paragraphs are not indented, and the text is not justified. Separate the lines of each stanza with \\, and use one or more blank lines to separate the stanzas.