# How to typeset a matrix with MathJax?

I need to typeset a matrix with square brackets as delimiters for math.se (I believe they use MathJaX). How would I do that?

-
$\begin{bmatrix}a\\b\end{bmatrix}$ works –  egreg Feb 4 '12 at 23:22
@egreg How would I put multiple values in the same row? –  Bob Feb 4 '12 at 23:28
$\begin{bmatrix}a & b\\c & d\end{bmatrix}$, just like LaTeX with amsmath –  egreg Feb 4 '12 at 23:44
You can also find a suitable example and see its source code by clicking edit. Here is an old example that I found at a quick glance to my answers while I was active in there and has many matrices in it. –  percusse Feb 5 '12 at 2:09
You can also right click on an equation, Show Math As → TeX commands. –  KennyTM Feb 5 '12 at 7:57

MathJax seems to accept the standard amsmath syntax

$\begin{bmatrix}a & b\\c & d\end{bmatrix}$


Rows are terminated with \\ and columns are separated by &

-
  $\begin{matrix} a & b \\ c & d \end{matrix}$