Feeling a bit dumb as I plunge into math.stackexchange.com after many years away from the world of mathematics, but can somebody please provide a very quick tutorial -- list of reference pointers would be sufficient -- for getting math markup on math.stackexchange.com. I can use html sup, sub tags, but how to do the more complex markup like fractions, and even drawing diagrams.

Markdown doesn't do much for math, a far as I can tell, but I could be wrong.

Thanks --oldbie/newbie David

  • $\begingroup$ the site has TeX markup support — so you just need to take a look at some TeX tutorial (sorry, no good source comes to mind now) $\endgroup$
    – Grigory M
    Commented Aug 6, 2010 at 12:02
  • $\begingroup$ Tried Tex, with $\frac{-b}{2a}$ -- oops, may have forgotten the backslash. OK, will try again. $\endgroup$ Commented Aug 6, 2010 at 12:19
  • 4
    $\begingroup$ btw, we need to answer this question in the FAQ $\endgroup$
    – Grigory M
    Commented Aug 6, 2010 at 15:11
  • $\begingroup$ I've removed the meta tag, since all questions asked on meta.math.se are expected to be meta, and added the tex tag, since TeX is the system used here to render/display math. $\endgroup$
    – Larry Wang
    Commented Aug 7, 2010 at 1:56
  • $\begingroup$ @Grigory: It is already in the proposed faq. I will update it to include the answers here shortly. $\endgroup$
    – Larry Wang
    Commented Aug 9, 2010 at 2:57

3 Answers 3


All you have to do is find a question that uses the markup you'd like to use, then right click and select show source.

  • $\begingroup$ Duh! Thanks. Thought of that, but assumed I'd see html instead. I don't know why I didn't just try it. $\endgroup$ Commented Aug 6, 2010 at 20:27

To type inline TeX equations, surround the code with $'s, e.g.

$c = \sqrt{ a^2 + b^2 - 2ab \cos \theta } ⇒ $c = \sqrt{ a^2 + b^2 - 2ab \cos \theta }$

To put the equation in its own line, surround with $$'s, e.g.

$$\int_0^\infty e^{-x^2} dx = \frac{\sqrt\pi}2$$ ⇒ $$\int_0^\infty e^{-x^2} dx = \frac{\sqrt\pi}2$$

AMS math environment is also supported, e.g.

  \cos x &= \frac{\sin 2x}{2 \sin x} \\\\
\sin^2 x &= \cos^2 x - \cos 2x

⇒ \begin{align} \cos x &= \frac{\sin 2x}{2 \sin x} \\ \sin^2 x &= \cos^2 x - \cos 2x \end{align}

Note that you need 4 backslashes for a new line. Many times you also need extra backslashes to avoid conflict with Markdown syntax, e.g.

$$\alpha^{-1}_{-1} + \beta_{-2}$$ won't work, as _..._ is interpreted as italics.

$$\alpha^{-1}{-1} + \beta{-2}$$

Use $$\alpha^{-1}\_{-1} + \beta\_{-2}$$ instead.

$$\alpha^{-1}_{-1} + \beta_{-2}$$

  • $\begingroup$ The multi-backslash-issue should actually be solved $\endgroup$ Commented Aug 21, 2013 at 13:01

If you have firefox, go to your address bar and type in "lshort" without the quotes. Read the PDF tutorial on Latex. Actually you don't even have to read it. I just bookmarked pages that have the most used commands and I just refer to them when I need it. But that was the PDF that introduced me to Latex.

  • $\begingroup$ more explicitly: chapter 3 @ ctan.org/tex-archive/info/lshort/english/lshort.pdf (right?) $\endgroup$
    – Grigory M
    Commented Aug 6, 2010 at 15:10
  • $\begingroup$ Yes sir. But again, I would recommend going back and forth from all the chapters so while your learning the math markup, you can also learn how to format an article or journal entry. $\endgroup$ Commented Aug 6, 2010 at 15:18
  • $\begingroup$ I would also recommend looking over Kenny's answer for the minor differences when writing on this website rather then TexWorks or similar. $\endgroup$ Commented Aug 6, 2010 at 15:19

You must log in to answer this question.

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