How to Write Math in Markdown
LaTeX equations with $ and $$
You want to write math in Markdown, an inline symbol like a variable, or a full equation like an integral. Standard Markdown has no math syntax of its own, but nearly every tool that does support math uses the same convention: LaTeX wrapped in dollar signs.
Here is the syntax, the one dollar-sign gotcha that trips people up, and how it renders.
Inline and block math
Wrap LaTeX in one dollar sign on each side for inline math, inside a sentence:
The mass-energy formula is $E = mc^2$. Wrap it in two dollar signs for a block: a centered equation on its own lines.
$$
\int_{-\infty}^{\infty} e^{-x^2}\, dx = \sqrt{\pi}
$$ The part between the dollar signs is LaTeX math, rendered by a library like KaTeX. It is an extension, not standard Markdown, so it works in tools that support it (Obsidian, many editors, some GitHub views) and shows as plain text in ones that do not.
The dollar-sign gotcha: money vs math
The obvious risk with using $ for math is money. If a tool treated every dollar sign as math, the sentence "it cost $5 or $10" would turn the middle into a formula. To prevent that, the rules for inline math are strict:
- The opening
$must sit right against non-whitespace inside the formula (no space just inside the dollars). - The closing
$cannot be immediately followed by a digit, so a price is left alone.
So $E=mc^2$ renders as math, while a sentence about a 5 dollar or 10 dollar price stays as plain text. If your math is not rendering, check that there is no stray space just inside the dollars.
How it renders in NoteLoom
NoteLoom renders both $...$ and $$...$$ with KaTeX. The nice part for editing: in the edit view, when your cursor is on the line with a formula it shows the raw LaTeX so you can change it, and when you move the cursor away it renders back to the formula. The reading view just shows the rendered math.
What it covers is math-mode LaTeX: Greek letters, fractions, integrals, sums, matrices, and most symbols. It is not a full LaTeX document engine, it renders the math, and your file stays plain .md with the LaTeX readable inside it.
FAQ
How do you write math in Markdown?
Is math part of standard Markdown?
Why did a price turn into math, or why will my math not render?
What is the difference between one dollar sign and two?
Does NoteLoom render LaTeX math?
Can I use full LaTeX?
See your equations render as you type
Open NoteLoom in Chrome / Edge / Arc, open a .md file, and write LaTeX in dollar signs while the live and reading views render it with KaTeX, saved straight back to the file. No install and no account.