I need to typeset a matrix with square brackets as delimiters for math.se (I believe they use MathJaX). How would I do that?
Asked
Active
Viewed 6.0k times
54
3 Answers
54
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 &
egreg
- 1,121,712
-
2The Chapter 4.1 matrices of amsmath explains the options for matrices. There is also
smallmatrixenviroment which allows to use the matrices inline with text$\begin{bmatrix}a & b\\c & d\end{bmatrix}$– RubenLaguna Sep 22 '16 at 08:13 -
1For anyone looking, this is a working link of @RubenLaguna's comment: https://web.archive.org/web/20180619212427/ftp://ftp.ams.org/pub/tex/doc/amsmath/amsldoc.pdf – zfj3ub94rf576hc4eegm Dec 12 '20 at 02:34
15
The curved brace matrix in Mathjax is:
$$\begin{pmatrix}a & b\\\ c & d\end{pmatrix}$$
Note: I used the wrapper \color{#C00}{ <code goes here> } to format it in this dark red color :)
Conor
- 349
- 2
- 7
10
MathJax comes with a configuration file that includes all the most general of the pre-defined configurations. It loads all the important MathJax components, including the TeX and MathML preprocessors and input processors, the AMSmath, AMSsymbols etc. So what you do you write in a similar fashion to a normal TeX file.
$\begin{matrix} a & b \\ c & d \end{matrix}$
Whenever you get stuck do a search on wikipedia and view the equation in the editor tab. Most of the wiki mark-up will work straight with MathJax.
yannisl
- 117,160

$\begin{bmatrix}a\\b\end{bmatrix}$works – egreg Feb 04 '12 at 23:22$\begin{bmatrix}a & b\\c & d\end{bmatrix}$, just like LaTeX with amsmath – egreg Feb 04 '12 at 23:44edit. 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 05 '12 at 02:09