Latex Standard Environments

LaTeX provides a number of different paragraph-making environments. Each environment begins and ends in the same manner.
        \begin{environment-name}
        .
        .
        .
        \end{environment-name}
The following environments are available: There are commands which are closely related to certain environments, but can be used elsewhere:

array

 \begin{array}{col1col2...coln}
 column 1 entry & column 2 entry ... & column n entry \\
 . . .
 \end{array}
Math arrays are produced with the array environment. It has a single mandatory argument describing the number of columns and the alignment within them. Each column, coln, is specified by a single letter that tells how items in that row should be formatted. Column entries must be separated by an &. Column entries may include other LaTeX commands. Each row of the array must be terminated with the string \\.

Go to the top.


center

 \begin{center}
 Text on line 1 \\
 Text on line 2 \\
 . . .
 \end{center}
The 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 must be terminated with the string \\.

Go to the top.


\centering

This declaration corresponds to the center environment. This declaration can be used inside an environment such as quote or in a parbox. 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.

Unlike the center environment, the \centering command does not start a new paragraph; it simply 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 (of an environment like quote) that ends the paragraph unit.

Go to the top.


description

 \begin{description}
 \item [label] First item
 \item [label] Second item
 . . .
 \end{description}
The description environment is used to make labeled lists. The label is bold face and flushed right.

Go to the top.


enumerate

 \begin{enumerate}
 \item First item
 \item Second item
 . . .
 \end{enumerate}
The 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.

Each item of an enumerated list begins with an \item command. There must be at least one \item command within the environment.

Go to the top.


eqnarray

 \begin{eqnarray}
 math formula 1 \\
 math formula 2 \\
 . . .
 \end{eqnarray}
The 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 &. An equation number is placed on every line unless that line has a \nonumber command.

Go to the top.


equation, equation*

 \begin{equation}
  math formula
 \end{equation}
The equation environment centers your equation on the page and places the equation number in the right margin. Using equation* does not produce equation number.

Go to the top.


figure

 \begin{figure}[placement]
  body of the figure
 \caption{figure title}
 \end{figure}
Figures are objects that are not part of the normal text, and are usually "floated" to a convenient place, like the top of a page. Figures will not be split between two pages.

The optional argument [placement] determines where LaTeX will try to place your figure. There are four places where LaTeX can possibly put a float:

The standard report and article styles use the default placement tbp.

The body of the figure is made up of whatever text, LaTeX commands, etc. you wish. The \caption command allows you to title your figure.

Go to the top.


flushleft

 \begin{flushleft}
 Text on line 1 \\
 Text on line 2 \\
 . . .
 \end{flushleft}
The flushleft environment allows you to create a paragraph consisting of lines that are flushed left to the left-hand margin. Each line must be terminated with the string \\.

Go to the top.


\raggedright

This 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 simply 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 (of an environment like quote) that ends the paragraph unit.

Go to the top.


flushright

 \begin{flushright}
 Text on line 1 \\
 Text on line 2 \\
 . . .
 \end{flushright}
The flushright environment allows you to create a paragraph consisting of lines that are flushed right to the right-hand margin. Each line must be terminated with the string \\.

\raggedleft

This 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 simply 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 (of an environment like quote) that ends the paragraph unit.

Go to the top.


itemize

 \begin{itemize}
 \item First item
 \item Second item
 . . .
 \end{itemize}
The itemize environment produces a bulleted list. Itemizations can be nested within one another, up to four levels deep. They can also be nested within other paragraph-making environments.

Each item of an itemized list begins with an \item command. There must be at least one \item command within the environment.

Go to the top.


list

 \begin{list}{label}{spacing}
 \item First item
 \item Second item
 . . .
 \end{list}
The {label} argument specifies how items should be labeled. This argument is a piece of text that is inserted in a box to form the label. This argument can and usually does contain other LaTeX commands.

The {spacing} argument contains commands to change the spacing parameters for the list. This argument will most often be null, i.e., {}. This will select all default spacing which should suffice for most cases.

Go to the top.


minipage

 \begin{minipage}[position]{width}
  text
 \end{minipage}
The minipage environment is similar to a \parbox command. It takes the same optional position argument and mandatory width argument. You may use other paragraph-making environments inside a minipage.

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.

NOTE: Don't put one minipage inside another if you are using footnotes; they may wind up at the bottom of the wrong minipage.

Go to the top.


picture

 \begin{picture}(width,height)(x offset,y offset)
 .
  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, 2.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 can change the value of \unitlength anywhere you want, using the \setlength command, but strange things will happen if you try changing it inside the picture environment.

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. It specifies the size of the picture. The environment produces a rectangular box with width and height determined by this argument's x- and y-coordinates.

The 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)
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 will omit the optional argument, leaving the origin at the lower-left corner. If you then want to modify your picture by shifting everything, you 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 TeX 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 in the text argument of the \put command that you'd put into the argument of an \mbox and related commands. When you do this, the reference point will be the lower left corner of the box.

Go to the top.


quotation

 \begin{quotation}
  text
 \end{quotation}
The margins of the quotation environment are indented on the left and the right. The text is justified at both margins and there is paragraph indentation. Leaving a blank line between text produces a new paragraph.

Go to the top.


quote

 \begin{quote}
  text
 \end{quote}
The margins of the quote environment are indented on the left and the right. The text is justified at both margins. Leaving a blank line between text produces a new paragraph.

Go to the top.


tabbing

 \begin{tabbing}
 text \= more text \= still more text \= last text \\
 second row \>  \> more \\
 . . .
 \end{tabbing}
The tabbing environment provides a way to align text in columns. It works by setting tab stops and tabbing to them much the way you do with an ordinary typewriter.

Go to the top.


table

 \begin{table}[placement]
  body of the table
 \caption{table title}
 \end{table}
Tables are objects that are not part of the normal text, and are usually "floated" to a convenient place, like the top of a page. Tables will not be split between two pages.

The optional argument [placement] determines where LaTeX will try to place your table. There are four places where LaTeX can possibly put a float:

The standard report and article styles use the default placement tbp.

The body of the table is made up of whatever text, LaTeX commands, etc., you wish. The \caption command allows you to title your table.

Go to the top.


tabular

 \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 box consisting of a sequence of rows of items, aligned vertically in columns. The mandatory and optional arguments consist of:
width
Specifies the width of the tabular* environment. There must be rubber space between columns that can stretch to fill out the specified width.
pos
Specifies the vertical position; default is alignment on the center of the environment.
cols
Specifies the column formatting. It consists of a sequence of the following specifiers, corresponding to the sequence of columns and intercolumn material.
In the tabular material the following commands may be used:
\cline{i-j}
The \cline command draws horizontal lines across the columns specified, beginning in column i and ending in column j, which are identified in the mandatory argument.
\hline
The \hline command will draw a horizontal line the width of the table. It's most commonly used to draw a line at the top, bottom, and between the rows of the table.
\multicolumn{cols}{pos}{text}
The \multicolumn is used to make 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 is to make up the entry.
\vline
The \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 @-expression.

Go to the top.


thebibliography

 \begin{thebibliography}{widest-label}
 \bibitem[label]{cite_key}
 . . .
 \end{thebibliography}
The thebibliography environment produces a bibliography or reference list. In the article style, this reference list is labeled "References"; in the report style, it is labeled "Bibliography".
\bibitem[label]{cite_key}
The \bibitem command generates an entry labeled by label. If the label argument is missing, a number is generated as the label, 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 on the aux file containing cite_key and the item's label. When this aux file is read by the \begin{document} command, the item's label is associated with cite_key, causing the reference to cite_key by a \cite command to produce the associated label.

Go to the top.


\cite[text]{key_list}

The key_list argument is a list of citation keys. This command generates an in-text citation to the references associated with the keys in key_list by entries on the aux file read by the \begin{document} command.

\nocite{key_list}

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

Go to the top.


theorem

 \begin{theorem}
  theorem text
 \end{theorem}
The theorem environment produces "Theorem x" in boldface followed by your theorem text.

Go to the top.


titlepage

 \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 comes in handy for title pages.

Go to the top.


verbatim

 \begin{verbatim}
  text
 \end{verbatim}
The verbatim environment is a paragraph-making environment that gets LaTeX to print exactly what you type in. It turns LaTeX into a typewriter with carriage returns and blanks having the same effect that they would on a typewriter.

\verb, \verb*

 \verb char literal_text char
 \verb*char literal_text char
Typesets literal_text exactly as typed, including special characters and spaces, using a typewriter (\tt) type style. There may be no space between \verb or \verb* and char (space is shown here only for clarity). The *-form differs only in that spaces are printed.

Go to the top.


verse

 \begin{verse}
  text
 \end{verse}
The verse environment is designed for poetry, though you may find other uses for it.

Go to the top.


Back to the main LaTeX page.