53

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

5
  • 1
    $\begin{bmatrix}a\\b\end{bmatrix}$ works
    – egreg
    Feb 4, 2012 at 23:22
  • @egreg How would I put multiple values in the same row?
    – Bob
    Feb 4, 2012 at 23:28
  • $\begin{bmatrix}a & b\\c & d\end{bmatrix}$, just like LaTeX with amsmath
    – egreg
    Feb 4, 2012 at 23:44
  • 1
    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, 2012 at 2:09
  • You can also right click on an equation, Show Math As → TeX commands.
    – kennytm
    Feb 5, 2012 at 7:57

3 Answers 3

53

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 &

2
14

The curved brace matrix in Mathjax is:

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

enter image description here


Note: I used the wrapper \color{#C00}{ <code goes here> } to format it in this dark red color :)

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .