FANDOM

153 Pages

The array environment is used to make a table of information, with column alignment (left, center, or right) and optional vertical lines separating the columns.

 \begin{array}{col1col2…coln} item11 & item12 … & item1n\\ item21 & item22 … & item2n\\ 

 ... 

itemm1 & itemm2 … & itemmn \end{array} 

Each of col1, col2, etc. is a single letter,

c - for centred
l - for flush left
r - for flush right
The column format letters can be interspersed with vertical bars (|), which result in rendering vertical bars as needed in the formatted matrix.

If a horizontal line is needed in the matrix, \hline can be used.

Within the array itself, columns are separated by an &, and each row ends with a double backslash, \\.

LaTeX markup... ...results in: ...is used for:
\begin{array}{|l|cr}left1 & center1 & right1\\\hlined & e & f\end{array}  $\begin{array}{|l|cr} left1 & center1 & right1\\ \hline d & e & f \end{array}$ array.
|l|cr means
left-align, center,
and right align columns;
vertical bars before and
after first column.
\hline draws a
horizontal line.
\begin{array}{lcl}z & = & a \\& = & a \\f(x,y,z) & = & x + y + z\end{array}  $\begin{array}{lcl} z & = & a \\ & = & a \\ f(x,y,z) & = & x + y + z \end{array}$ using an array
to align equations