1. ## Matrices in Latex

In the advanced algebra post I recently tried to use latex to express mathis using 3 x 3 matrices and had problems

Here was my attempt to write the 3 x 3 identity matrix - I put the following code in between $\displaystyle and$

\left(\begin{array}{ccc}1&0&0\\0&1&0\\0&0&1\end{ar ray}\right)

Can someone please tell me my error here?

Further, does anyone know of a brief and easy to use document describing how to present matrices in latex?

Peter

2. ## Re: Matrices in Latex

\left(\begin{array}{ccc}1&0&0\\0&1&0\\0&0&1\end{ar ray}\right)

You left a space between "ar" and "ray". If you replace "ar ray" with "array", your code will work fine. Here's a more better way of creating matrices:

1.
\begin{pmatrix} a & b &c \\ d & e & f \\ g & h & i \end{pmatrix}

$\displaystyle \begin{pmatrix} a & b &c \\ d & e & f \\ g & h & i\end{pmatrix}$

2.

\begin{bmatrix} a & b &c \\ d & e & f \\ g & h & i \end{bmatrix}

$\displaystyle \begin{bmatrix} a & b &c \\ d & e & f \\ g & h & i\end{bmatrix}$

3.
\begin{vmatrix} a & b &c \\ d & e & f \\ g & h & i \end{vmatrix}

$\displaystyle \begin{vmatrix} a & b &c \\ d & e & f \\ g & h & i\end{vmatrix}$

4.
\begin{Bmatrix} a & b &c \\ d & e & f \\ g & h & i \end{Bmatrix}

$\displaystyle \begin{Bmatrix} a & b &c \\ d & e & f \\ g & h & i\end{Bmatrix}$