# How to input matrices when posting questions at Math StackExchange? [duplicate]

I would like to post a question here in which I would like to insert a $2 \times 2$ matrix with entries $a$, $b$, $c$, and $d$, respectively, in the positions row 1 col. 1, row 1 col. 2, row 2 col 1, and row 2 col 2. How to?

I would also like to input a general $m \times n$ matrix with entires $a_{ij}$, where $i = 1, 2, \ldots, m$, $j = 1, 2, \ldots, n$.

• Zev Chonoles, instead of closing down my question right away, please point out the exact place in this tutorial where I can look for my desired information. I think I've already gone through it. Commented Feb 16, 2014 at 16:51
• This page should give you a start at learning how to typeset mathematics here so that your posts say what you want them to, and also look good. Commented Feb 16, 2014 at 17:05
• The exact place in this tutorial which concerns matrices is linked in robjohn's answer below. It is this link: meta.math.stackexchange.com/questions/5020/… Commented Jan 13, 2016 at 12:09

There are a couple of ways: \begin{bmatrix}a&b\\c&d\end{bmatrix} $$\begin{bmatrix}a&b\\c&d\end{bmatrix}$$ or \left[\begin{array}{l}a&b\\c&d\end{array}\right] $$\left[\begin{array}{l}a&b\\c&d\end{array}\right]$$ The latter gives you control of the alignment of the elements (eg: l,c,r) and column and row separators.

For more details see the MathJax tutorial on matrices.

Note that if there is some MathJax in a post whose source you would like to see, simply right-click on the rendered MathJax and choose "Show Math As > TeX Commands"