Math

This is an equation:

(1)\[a^2 + b^2 = c^2 + \sum_i (i-i)\]

Equations can be numbered and also referenced using the :label: option.

(2)\[e^{i\pi} + 1 = 0\]

For example, Eq (2) is Euler’s identity, Eq. (1) is a dummy equation.

Attention

Cross-referencing equations using :eq:<label> only works within the same document.

rST vs MD syntax

.. math::
   :label: mymath

   (a + b)^2  &=  (a + b)(a + b) \\
              &=  a^2 + 2ab + b^2

Cross-reference with :eq:`mymath`.
```{math}
:label: mymath
(a + b)^2  &=  (a + b)(a + b) \\
           &=  a^2 + 2ab + b^2
```

Cross-reference with {eq}`mymath`

Note

In MD you can use dollar signs to write inline math (for example $\alpha$) provided that you enable this functionality adding "dollarmath" to myst_enable_extensions in conf.py. See here for more info.