WritedocsWritedocs

Math

Write LaTeX between single dollar signs for math in a sentence, or between double dollar signs, on their own lines, for an equation on its own:

The Pythagorean theorem states that $a^2 + b^2 = c^2$ in a right triangle.

$$
E = mc^2
$$

The Pythagorean theorem states that a2+b2=c2a^2 + b^2 = c^2 in a right triangle.

E=mc2E = mc^2

Equations are typeset when the site is built, so they appear with the page, with no script to load. They’re text, not images: readers can select and zoom them.

A dollar sign is a delimiter, not just a character

A lone dollar sign with nothing to pair it with - a plain price mention, say - is left as ordinary text. But two or more dollar signs anywhere in the same paragraph can pair up and try to render as math even when none of them were meant to, including a dollar sign written inside inline code. When you need a literal dollar sign next to another one, back-slash escape it:

This plan costs \$50, that one costs \$80.

This plan costs $50, that one costs $80.

Keep a stray dollar sign’s own paragraph free of any other dollar sign, or escape it - this matters most on pricing pages, changelogs, or anywhere else dollar amounts show up more than once close together. Content inside a fenced ``` code block is always safe either way; math parsing never looks inside one.

Invalid LaTeX

An equation with a mistake doesn’t stop the site: it’s shown in red, with the error in a tooltip when you point at it.

Dark mode

Equations take the color of the text around them, so they follow the site’s theme.