4
$\begingroup$

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

$\endgroup$
  • $\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 Aug 6 '10 at 12:02
  • $\begingroup$ Tried Tex, with $\frac{-b}{2a}$ -- oops, may have forgotten the backslash. OK, will try again. $\endgroup$ – David Lewis Aug 6 '10 at 12:19
  • 4
    $\begingroup$ btw, we need to answer this question in the FAQ $\endgroup$ – Grigory M Aug 6 '10 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 Aug 7 '10 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 Aug 9 '10 at 2:57
8
$\begingroup$

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.

$\endgroup$
  • $\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$ – David Lewis Aug 6 '10 at 20:27
6
$\begingroup$

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.

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

⇒ \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}$$

$\endgroup$
  • $\begingroup$ The multi-backslash-issue should actually be solved $\endgroup$ – Tobias Kienzler Aug 21 '13 at 13:01
2
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ more explicitly: chapter 3 @ ctan.org/tex-archive/info/lshort/english/lshort.pdf (right?) $\endgroup$ – Grigory M Aug 6 '10 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$ – Tyler Hilton Aug 6 '10 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$ – Tyler Hilton Aug 6 '10 at 15:19

You must log in to answer this question.

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