Next: , Previous: abstract, Up: Environments


8.2 array

Synopsis:

     \begin{array}{template}
     col1 text&col1 text&coln}\\
     ...
     \end{array}

Math arrays are produced with the array environment, normally within an equation environment (see equation). It has a single mandatory template argument describing the number of columns and the alignment within them. Each column col is specified by a single letter that tells how items in that row should be formatted, as follows:

c
centered
l
flush left
r
flush right

Column entries are separated by &. Column entries may include other LaTeX commands. Each row of the array is terminated with \\.

In the template, the construct @{text} puts text between columns in each row.

Here's an example:

     \begin{equation}
       \begin{array}{lrc}
       left1 & right1 & centered1 \\
       left2 & right2 & centered2 \\
       \end{array}
     \end{equation}

The \arraycolsep parameter defines half the width of the space separating columns; the default is ‘5pt’. See tabular, for other parameters which affect formatting in array environments, namely \arrayrulewidth and \arraystretch.

The array environment can only be used in math mode.