Math¶
To use mathematical expressions, you can use LaTeX expressions under the following directives:
:math:`<expression>`Since Pythagoras, we know that \(a^2 + b^2 = c^2\).
Code:
Since Pythagoras, we know that :math:`a^2 + b^2 = c^2`.
.. math::directive\[(\prod \limits_{i=1}^n (x_i+1))^{1/n}-1 = \sqrt[n]{(x_1+1)(x_2+1) \cdots (x_n+1)} -1\]Code:
.. math:: (\prod \limits_{i=1}^n (x_i+1))^{1/n}-1 = \sqrt[n]{(x_1+1)(x_2+1) \cdots (x_n+1)} -1
In Sphinx, math directives can include an optional label which can be used to
reference a formula (in the same document) using the :eq: role.
.. math:: e^{i\pi} + 1 = 0
:label: euler
Euler's identity equation :eq:`euler`,
as elected one of the most
beautiful mathematical formulas.
|
(1)¶\[e^{i\pi} + 1 = 0\]
Euler’s identity equation (1), as elected one of the most beautiful mathematical formulas. |
Syntax¶
Math code in Sphinx uses LaTeX syntax.
Symbols¶
\(\alpha\) |
|
\(\beta\) |
|
\(\gamma\) |
|
\(\Gamma\) |
|
\(\delta\) |
|
\(\Delta\) |
|
\(\epsilon\) |
|
\(\varepsilon\) |
|
\(\theta\) |
|
\(\Theta\) |
|
\(\eta\) |
|
\(\kappa\) |
|
\(\lambda\) |
|
\(\Lambda\) |
|
\(\mu\) |
|
\(\nu\) |
|
\(\xi\) |
|
\(\pi\) |
|
\(\rho\) |
|
\(\sigma\) |
|
\(\phi\) |
|
\(\Phi\) |
|
\(\psi\) |
|
\(\Psi\) |
|
\(\omega\) |
|
\(\Omega\) |
|
\(\varphi\) |
|
\(\hbar\) |
|
\(\ne\) |
|
\(\pm\) |
|
\(\sim\) |
|
\(\approx\) |
|
\(\equiv\) |
|
\(\simeq\) |
|
\(\leq\) |
|
\(\geq\) |
|
\(\mid\) |
|
\(\parallel\) |
|
\(\|\) |
|
\(\perp\) |
|
\(\lim\) |
|
\(\Pr\) |
|
\(\neg\) |
|
\(A^\intercal\) |
|
\(\hat{a}\) |
|
\(\tilde{a}\) |
|
\(\bar{a}\) |
|
\(\vec{a}\) |
|
\(\overline{abc}\) |
|
\(\overrightarrow{abc}\) |
|
\(\widehat{abc}\) |
|
\(\dot{a}\) |
|
\(\in\) |
|
\(\notin\) |
|
\(\emptyset\) |
|
\(\varnothing\) |
|
\(\cap\) |
|
\(\cup\) |
|
\(\cdot\) |
|
\(\cdots\) |
|
\(\ldots\) |
|
\(\vdots\) |
|
\(\ddots\) |
|
\(\times\) |
|
\(\rfloor\) |
|
\(\lrcorner\) |
|
\(\infty\) |
|
\(\prime\) |
|
Fonts¶
\(\mathcal{A}\) |
|
\(\mathbb{A}\) |
|
\(\mathbf{A}\) |
|
\(\boldsymbol{\alpha}\) |
|
Functions¶
\(\min\) |
|
\(\max\) |
|
\(\lim\) |
|
\(\sin\) |
|
\(\cos\) |
|
\(\tan\) |
|
\(\exp\) |
|
\(\log\) |
|
\(\ln\) |
|
\(\arg\) |
|
\(\sum\) |
|
\(\int\) |
|
Styling equations¶
Align equations to the left with align
.. math::
\begin{align}
&S = {A,B,C} \\
&P(3, 2) = 6; \quad \{AB, AC, BA, BC, CA, CB\} \\
\end{align}
|
\[\begin{split}\begin{align}
&S = {A,B,C} \\
&P(3, 2) = 6; \quad \{AB, AC, BA, BC, CA, CB\} \\
\end{align}\end{split}\]
|
Control the size of brackets and parentheses with:
\big, \Big, \bigg, \Bigg
\(\big(\) |
|
\(\Big]\) |
|
\(\bigg\{\) |
|
\(\Bigg \rangle\) |
|
Create a function with different steps using cases:
.. math::
\kappa = \begin{cases}
0 & \text{if censored} \\
1 & \text{if not censored}
\end{cases}
|
\[\begin{split} \kappa = \begin{cases}
0 & \text{if censored} \\
1 & \text{if not censored}
\end{cases}\end{split}\]
|
Matrix¶
Matrix can be including in LaTeX with array:
.. math::
M=
\left[ {\begin{array}{cc}
1 & 2 \\
3 & 4 \\
\end{array} } \right]
|
\[\begin{split}M=
\left[ {\begin{array}{cc}
1 & 2 \\
3 & 4 \\
\end{array} } \right]\end{split}\]
|
https://en.wikipedia.org/wiki/Wikipedia:LaTeX_symbols
https://tex.stackexchange.com/questions/145657/align-equation-left
https://www.overleaf.com/learn/latex/Brackets_and_Parentheses
- 1
\mathbf{A}does not work with other LaTeX symbols