# 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. – Saaqib Mahmood Feb 16 '14 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. – Dan Rust Feb 16 '14 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/… – Martin Sleziak Jan 13 '16 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.