This question already has an answer here:

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$.

marked as duplicate by Zev Chonoles, Dan Rust, user61527, Davide Giraudo, user642796 Feb 17 '14 at 4:59

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 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
up vote 14 down vote accepted

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"

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