RichMarkdown › Math in Markdown
Math in Markdown
Updated
Markdown has no math of its own. The common convention is LaTeX between dollar signs: $x^2$ inside a sentence and $$…$$ for a formula on its own line. RichMarkdown typesets both as you type and keeps them as plain LaTeX in the exported file.
In short
- Inline:
$E = mc^2$. On its own line:$$\frac{a}{b}$$. - In the editor, the formula is drawn when you type the closing
$. - Download Word gives equations you can edit in Word; Save as PDF prints them typeset.
Syntax you will use most
| You want | You type |
|---|---|
| Superscript and subscript | $x^2$, $a_i$, $x^{n+1}$ |
| Fraction | $\frac{a}{b}$ |
| Square root | $\sqrt{x}$, $\sqrt[3]{x}$ |
| Sum and integral | $\sum_{i=1}^{n} i$, $\int_0^1 x\,dx$ |
| Greek letters | $\alpha$, $\beta$, $\pi$, $\Delta$ |
| Comparison and operators | $\le$, $\ge$, $\ne$, $\times$, $\approx$ |
| Text inside a formula | $v = \text{distance} / \text{time}$ |
| Matrix | $$\begin{pmatrix} a & b \\ c & d \end{pmatrix}$$ |
Writing formulas in RichMarkdown
- Type it. Write
$x^2$and the formula is typeset when you type the closing dollar sign.$$…$$makes a centred formula on its own line. - Paste it. Formulas copied from AI chat tools such as ChatGPT keep their LaTeX. The
\( … \)and\[ … \]forms those tools often write are turned into$…$and$$…$$. - Paste from Word. Equations in a pasted Word document, or in an opened
.docx, become LaTeX. - Prices are safe. A sentence such as It costs $5 and $6 is not mistaken for a formula.
Where the formula goes next
| Destination | What arrives |
|---|---|
| Export .md | Plain LaTeX between dollar signs, unchanged. |
| Download Word (.docx) | Equations you can edit in Word. |
| Copy into desktop Word | Editable equations (tested with Word 16). Other apps, such as Google Docs, receive the LaTeX as text. |
| Save as PDF / print | Typeset formulas. |
| A shared link | Typeset formulas, with no scripts on the page. |
| Obsidian | Displays $…$ and $$…$$ as written. |
| GitHub | Displays $…$ and $$…$$ in README files, issues and comments. |
Common mistakes
- Spaces just inside the dollar signs. Write
$x^2$, not$ x^2 $. Many apps, this one included, treat the spaced form as ordinary text. - More than one character in an exponent.
$x^10$raises only the 1. Use braces:$x^{10}$. - A formula inside a code block. Code is shown exactly as typed, so the formula is not typeset there.
- Words in italics. Letters in a formula are variables. Wrap words in
\text{…}.
Related guides
FAQ
Does standard Markdown support math?
No. Math is an extension. Most tools that support it use LaTeX between dollar signs, which is what RichMarkdown writes.
Do I need to install LaTeX?
No. The formulas are typeset in your browser.
Will the formulas be editable in Word?
Yes. Download Word (.docx) writes them as Word equations, and copying into desktop Word does the same.
Why is my formula shown as plain text?
Check for a space right after the opening dollar sign or before the closing one, and check that the formula is not inside a code block.
Can I paste formulas from ChatGPT?
Yes. Pasted formulas keep their LaTeX, including the bracket forms that AI tools write.