Test page for math in Markdown

Bugs

Two brackets
$[a+b](c+d)$

$a+b$

Backslashes in $-math community/community#16993
$\{a\}$

${a}$

Oversized sqrt symbol around fractions community/community#39251
$$\sqrt{\frac{1}{2}}$$ $$\frac{\sum_{i=1}^n}{2}$$ $$a$$
  • \text{$b$}
    
Another funny issue

community/community#41087

$[x]_y a_{b}$

$[x]y a{b}$

Inline and display math

When $a \ne 0$, there are two solutions to $(ax^2 + bx + c = 0)$ and they are

$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$

Inline math spanned over multiple lines: $\log xy = \log x + \log y$

Display math spanned over multiple lines:

$$F = G \frac{m_1m_2}{r^2}$$
Cauchy's Theorem

Let $U$ be an open subset of the complex plane $\mathbb{C}$, and suppose the closed disk $D$ defined as

$$D = \{z:|z-z_{0}|\leq r\}$$

is completely contained in $U$. Let $f: U\to\mathbb{C}$ be a holomorphic function, and let $\gamma$ be the circle, oriented counterclockwise, forming the boundary of $D$. Then for every $a$ in the interior of $D$,

$$f(a) = \frac{1}{2\pi i} \oint_{\gamma}\frac{f(z)}{z-a}\,dz.$$

Math in lists

  • $E = mc^2$
  • $a^2 + b^2 = c^2$
  1. $V - E + F = 2$
  2. $i^2 = -1$

Math in titles $\exp(i\pi) + 1 = 0$

Math in tables

The Butcher tableau for this ERK method is

$0$
$1/2$ $1/2$
$1/2$ $0$ $1/2$
$1$ $0$ $0$ $1$
$1/6$ $1/3$ $1/3$ $1/6$

Global newcommands

Newcommand block (no output):

$$\newcommand\myexp[1]{e^{#1}}$$

Inline math that uses the newcommand: $\myexp{i}$

Display that uses the newcommand:

$$\myexp{i}$$

$-confusion?

  • An apple costs $1, a pear $.

    An apple costs $1, a pear $2.

  • An apple costs 1$, a pear 2$.

    An apple costs 1$, a pear 2$.

  • Let's try $x $y $ here.

    Let's try $x $y $ here.

  • $x = \text{my $y$}$

    $x = \text{my $y$}$

  • $x =\$$

    $x =$$

Font size comparison

ABC $ABC XYZ$ XYZ

abc $abc xyz$ xyz

Other LaTeX commands

  • \{n\in\mathbb{N}:\: n\,\text{even}\}
    $$\{n\in\mathbb{N}:\: n\,\text{even}\}$$
  • a <b > c
    $$a <b > c$$