[Univ of Cambridge] [Dept of Engineering]
next up previous contents
Next: Macros Up: Maths Previous: Numbering and labelling

Matrices

The array environment is like LATEX's tabular environment except that each element is in math mode. The default font style used is \textstyle but you can override this by changing the \displaystyle.

\begin{math}
\begin{array}{clrr} %
      a+b+c & uv & x-y & 27 \\
       x+y  & w  & +z  & 363 
\end{array}
\end{math}
produces $\begin{array}{clrr}
a+b+c & uv & x-y & 27 \\
x+y & w & +z & 363
\end{array}$

The rows are arranged so that their centres are aligned. You can align their tops or bottoms instead by using a further argument when you create the array.

\begin{array}{clrr}[t]
would produce top-aligned lines, and `[b]' would produce bottom-aligned ones. The Delimiters section of this document shows how to bracket matrices.

TEX has a few maths facilities not mentioned in the LATEX book. The following TEX construction might be useful.

\begin{math}
\bordermatrix{&a_1&a_2&...&a_n\cr
          b_1 & 1.2  & 3.3  & 5.1  & 2.8  \cr
          c_1 & 4.7  & 7.8  & 2.4  & 1.9  \cr
          ... & ...  & ...  & ...  & ...  \cr
          z_1 & 8.0  & 9.9  & 0.9  & 9.99  \cr}
\end{math}

$\bordermatrix{&a_1&a_2&...&a_n\cr
b_1 & 1.2 & 3.3 & 5.1 & 2.8 \cr
c_1 & 4.7 &...
...4 & 1.9 \cr
... & ... & ... & ... & ... \cr
z_1 & 8.0 & 9.9 & 0.9 & 9.99 \cr}$



Tim Love
1999-08-05