9 Math#

https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#math

Inline: \(a^2 + b^2 = c^2\)

https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#math

Block:

\[ \begin{align}\begin{aligned}(a + b)^2 = a^2 + 2ab + b^2\\(a - b)^2 = a^2 - 2ab + b^2\end{aligned}\end{align} \]

Another block:

\[\begin{split}(a + b)^2 &= (a + b)(a + b) \\ &= a^2 + 2ab + b^2\end{split}\]

https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#the-math-domain

9.1 Math in Section Title: \(e^{i\pi} + 1 = 0\)#

With label (since Sphinx 1.8):

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

Euler’s identity, equation (9.1), was elected one of the most beautiful mathematical formulas.