This question already has an answer here:

How can I create matrices in general in LaTeX? As well as the one below? enter image description here

Are there packages that are preferred over others?

marked as duplicate by Henri Menke, Stefan Pinnow, Mensch, ebosi, Zarko Dec 4 '16 at 21:43

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Use amsmath: it defines 6 types of matrix environments: matrix (without any delimiter), pmatrix (delimiters: ( )), bmatrix ([ ]), Bmatrix ({ }), vmatrix (| |), Vmatrix (|| ||). Columns are centred.

Still better: with mathtools, an extension of amsmath, you have starred variants which accept an optional argument for the columns alignment ([l], [r] or [c], valid for all columns).

Here is a code for your image:

\[ \begin{pmatrix}x'\\y'\end{pmatrix}=
     \cos\theta & -\sin\theta\\
     \sin\theta & \cos\theta
   \begin{pmatrix}x \\y \end{pmatrix} \]

The use of \[ ... \] can be substituted by the equation environment \begin{equation} ... \end{equation}

Not the answer you're looking for? Browse other questions tagged or ask your own question.