Skip to content
All referenceBlock Elements

Markdown Math / LaTeX

How to write math equations in markdown using LaTeX syntax with dollar sign delimiters. GitHub, Obsidian, and Jupyter support.

What is markdown math / latex?

Math expressions in markdown use LaTeX syntax wrapped in dollar sign delimiters. Inline math uses single dollar signs ($x^2$) and display math uses double dollar signs ($$). GitHub added native math rendering in 2022 using MathJax. Obsidian and Jupyter notebooks also support LaTeX math.

Syntax

Inline math

Single $ wraps inline math expressions within a sentence.

Result
The formula is E = mc² where c is the speed of light.

Display math (block)

Double $$ creates a centered equation block on its own line.

Result
(Centered equation block)

Common LaTeX

Common LaTeX symbols: Greek letters, summation, roots.

Result
α + β = γ, summation, square root

Platform support

PlatformSupportedNotes
GitHubYesNative MathJax rendering since 2022
ObsidianYesMathJax rendering built-in
JupyterYesFirst-class LaTeX support
GitLabYes
DiscordNo
NotionPartialInline math block available via /math command

Common mistakes

Wrong
Spaces inside $ delimiters: $ x^2 $
Right
$x^2$

Spaces immediately inside the dollar signs may prevent the math from rendering on some parsers.

Tips for math / latex

1Escape the dollar sign for currency

If you write $100, some parsers try to interpret it as math. Write \$100 or use a code span `$100` to display dollar signs literally.

2Use KaTeX reference for syntax

KaTeX (used by many renderers) supports a large subset of LaTeX. Their documentation at katex.org/docs/supported has a complete list of supported functions.

Frequently asked questions

Everything you need to know.

1

How do I write math equations in GitHub markdown?

Wrap LaTeX in single $ for inline: $E=mc^2$, or in $$ for a block equation. GitHub renders these with MathJax as of 2022.

Related elements

Try it in the editor

Paste your markdown and see math / latex rendered instantly with professional themes.