Simple inline math . $1+1 = 2$ .
. Simple block math . $$1+1 = 2$$ . . No whitespace before and after is fine . foo$1+1 = 2$bar .
foobar
. Even when it starts with a negative sign . foo$-1+1 = 2$bar .foobar
. Shouldn't render empty content . aaa $$ bbb .aaa $$ bbb
. Shouldn't render USD . aaa $5.99 bbb .aaa $5.99 bbb
. Shouldn't render trailing delimiter . aaa 5.99$ bbb .aaa 5.99$ bbb
. Paragraph break in inline math is not allowed . foo $1+1 = 2$ bar .foo $1+1
= 2$ bar
. Neither is an end of document . foo $1+1 = 2 .foo $1+1 = 2
. Inline math with apparent markup . foo $1 *i* 1$ bar .foo bar
. Block math can be indented up to 3 spaces . $$ 1+1 = 2 $$ . . But 4 means a code block . $$ 1+1 = 2 $$ .$$
1+1 = 2
$$
.
Multiline inline math
.
foo $1 + 1
= 2$ bar
.
foo bar
. Multiline display math . $$ 1 + 1 = 2 $$ . . Text can immediately follow inline math . $n$-th order .-th order
. Display math self-closes at the end of document . $$ 1+1 = 2 . . Display and inline math can appear in lists . * $1+1 = 2$ * $$ 1+1 = 2 $$ .Foo $1$ bar $$ 1 $$
.