# Survey of Syntax for Math in MarkDown

### this is a wiki, everyone is welcome to contribute

[If you don't see an  button on top, you need to Sign in/up to Github.]

## Help needed: check and document these:

TODO: This is becoming useful as a cheatsheet => rearrange this page to be user-oriented before being developer-oriented.

It'd be nice if everybody could agree on the same syntax(es) to denote math fragments in Markdown; alas, as every extension to Markdown, it's a mess :-( If you're adding math support to your markdown tool, I have one plea: please consider supporting [a subset of] standard LaTeX delimiters before inventing your own. Also see discussion on CommonMark.

I'm taking for granted that the content of the math fragments is LaTeX syntax. Arguably syntaxes like AsciiMath (MMD used to do this), are a better match for Markdown's philosophy, but most people who care about non-trivial math support already know [some] LaTeX syntax (which is why MMD 3 switched to LaTeX).

• CoffeeTeX is an intriguing new option, based on a lot of unicode. It's a superset of latex math, so could be used harmlessly(?) with these proposals. TODO: take a deeper look.

Multiple syntaxes exist:


There is no display math (can use \displaystyle hack inside formula, but won't get centered). Uses KaTeX.

Has markdown export, uses $$inline$$ syntax.

## Browser extensions

### Markdown Here browser extension

$inline$.
The documentation has a couple of $$display$$ examples which work but AFAICT this is not officially intended; the author has mentioned the idea of supportting $$display$$ in the future.
Markdown Here itself only recognizes the outer $...$ syntax; the inner $...$ syntax works with the default configuration which is to render math via Google Charts API, but this default might change.

### Markdown Preview Plus chrome extension

By default nothing.

1. If "MathJax" option is enabled: $$display$$, \$$inline\$$, \$display\$, environments e.g. $$...$$.
2. Additionally if "LaTeX delimiters" is also enabled: $inline$, $$inline$$, \$display\$.

### Markdown Viewer

Defaults off, need to enable "mathjax" option.
$inline$ and $$inline$$, $$display$$ and $display$.

## Desktop editors

### R Studio R Markdown v2

Based on Pandoc. $inline$ (without space between the $s and the math), $$display$$. Also supports raw MathML ($...$). Also superscript^2^ syntax is mentioned in v1->v2 migration doc, so I presume pandoc's subscript~2~ is also supported. I didn't test this but I have a suspicion the "no space between$ and math" rule was quoted from pandoc doc which is not exactly what pandoc actually implements.

#### R Markdown v1

Backslashes, dollars, and WordPress-inspired $latex ...$ and $$latex ...$$ syntaxes. Also supports raw MathML.

### Retext when configured for math

Based on pymarkups. $inline$, $$inline$$, $$display$$, $display$ as well as \begin{foo}...\end{foo}.

### Moe

$inline$ and $$display$$.

### MacDown

Uses Hoedown. Math support is optional, has 2 modes:

• \$$inline\$$, \$display\$, $$dwim$$ (either inline or display depending on context).
• \$$inline\$$, \$display\$, $inline$, $$display$$.

Also documented to support MathML [this simply follows from markdown's *ML pass-through plus MathJax (TeX-AMS-MML_HTMLorMML config) rendering MathML even on browsers that don't support it].

Has to be enabled in Preferences (General tab > Enable Mathematics Expression). Can choose between $$inline$$$ or $inline$ syntax; either way supports $$display$$. Also supports pandoc-like ^superscript^, ~subscript~. See also Korean doc about math and examples. ### Uberwriter Uses pandoc for export, so supports $inline$ (with heuristic of no spaces on inside of the dollars), $$display$$ and raw \foo{...} and \begin{bar}...\end{bar}. Plus standalone ~subscript~ and ^superscript^ syntaxes. The regular preview doesn't render math, but you can preview an individual formula by right-clicking it (Esc to close). This only works for dollar(s)-delimited math, not the other syntaxes pandoc recognizes. ### Remarkable Didn't find clear documentation of math support. Changelog mentions pandoc-like ^superscript^, ~subscript~ and new "MathJax support (slightly buggy)". It seems $inline$, $$display$$ are the supported syntaxes. All the above work equally in preview, HTML and PDF export and are not confused by chars significant to markdown (like *) inside the math. \$display\$ and \begin{foo}...\end{foo} also work (preview and export) but content that look like markdown markup breaks the rendering — I suppose these are incidental side effect of MathJax running on the full output. (I'll report the issue) ### Atom with markdown-preview-plus / markdown-preview-katex plugins $inline$, $$display$$, $display$. ### Texts.io It's a semi-WYSIWYG editor: IIUC editing happens on a document model, which is then exported back into markdown. Most markdown syntaxes can be manually entered and are then auto-converted into the internal model — including $inline$ followed by Space and $$ followed by Enter. Since version 1.2 defaults to Kramdown-style $$ display $$ and $$inline$$; it's possible to configure to use the older inline style. Not sure of exact criteria when $$ is display vs inline. Conversions are generally Pandoc-powered. ### Mou $$display$$ and $$inline$$$.

An older version documented \$$inline\$$ and \$display\$ plus requirement to convert double backslashes to triple (\$\begin{vmatrix} ... \\\ ... \end{vmatrix}\$); don't know if that's still supported.

Need to enable View -> Math Rendering option. Supported in all modes, not only in markdown files. $inline$, $$display$$.

### Inkdrop with math plugin

$inline$,

$$display$$


and

math
display



### Typora

Typora has math support. Type $inline$ for inline math or $$display$$ for display math. One can also type $$ followed by an Enter to open a math editor accepting LaTeX syntax. (more info on the project webpage https://typora.io/, features, Math Blocks). Tested under Linux. Not sure without trying (don't have a Mac). $$ opens display math block and from the in-place formatting goals I suppose you can just type $$math$$ without any mouse clicks and it will render, but not sure. Also unclear if $inline$ is supported yet.