How to create matrices in LaTeX

This is video #16 in a series of twenty one by Dr Vincent Knight of Cardiff University.

In this video, Vince shows how to quickly write out matrices in LaTeX, using the amsmath package and the \pmatrix (for a matrix with curly brackets), \matrix (for a matrix with no brackets), and \vmatrix (used to denote the determinant of a matrix) commands. Here's the code for the final example:

$$\begin{vmatrix} a&b\\ c&d\\ e&f\\ \end{vmatrix}$$


The example above (also shown in the video) is also provided here as a template. Simply open the 'Matrices' example (opens in a new tab/window), and use the online writeLaTeX editor to try it for yourself.