| 1 |
Mathematics |
| 2 |
----------- |
| 3 |
|
| 4 |
Docutils supports inline math with the prefix or postfix ``:math:`` |
| 5 |
role specificator, :math:`n! + \sin(x_n^2)` and `A_\text{c} = |
| 6 |
\frac{\pi}{4} d^2`:math:, as well as displayed math via the |
| 7 |
`math` directive: |
| 8 |
|
| 9 |
.. math:: |
| 10 |
|
| 11 |
f(\epsilon) = \frac{1}{1 + \exp\left(\frac{\varepsilon}{k_\text{B}T}\right)} |
| 12 |
|
| 13 |
Content may start on the first line of the directive, e.g. |
| 14 |
|
| 15 |
.. math:: N = \frac{\text{number of apples}}{7} |
| 16 |
|
| 17 |
Equations can be labeled with a reference name using the ``:name:`` option. |
| 18 |
See `eq:M`_ and `eq:schrödinger`_ below. |
| 19 |
|
| 20 |
The determinant of the matrix |
| 21 |
|
| 22 |
.. math:: :name: eq:M |
| 23 |
|
| 24 |
\mathbf{M} = \left(\begin{matrix}a&b\\c&d\end{matrix}\right) |
| 25 |
|
| 26 |
is :math:`|\mathbf{M}| = ad - bc`. |
| 27 |
|
| 28 |
More than one display math block can be put in one math directive. |
| 29 |
For example, the following sum and integral with limits: |
| 30 |
|
| 31 |
.. math:: |
| 32 |
|
| 33 |
\int_0^1 x^n dx = \frac{1}{n + 1} |
| 34 |
|
| 35 |
\sum_{n=1}^m n = \frac{m(m+1)}{2} |
| 36 |
|
| 37 |
LaTeX-supported Unicode math symbols can be used in math roles and |
| 38 |
directives: |
| 39 |
|
| 40 |
The Schrödinger equation |
| 41 |
|
| 42 |
.. math:: :name: eq:schrödinger |
| 43 |
|
| 44 |
i\hbar \frac{∂}{∂t}Ψ = \hat{H}Ψ, |
| 45 |
|
| 46 |
with the *wave function* :math:`Ψ`, describes how the quantum state of a |
| 47 |
physical system changes in time. |
| 48 |
|
| 49 |
Math-Accents: |
| 50 |
.. list-table:: |
| 51 |
:class: borderless |
| 52 |
:width: 100% |
| 53 |
|
| 54 |
* - :math:`\acute{a}` ``\acute{a}`` |
| 55 |
- :math:`\dot{t}` ``\dot{t}`` |
| 56 |
- :math:`\hat{\gamma}` ``\hat{\gamma}`` |
| 57 |
|
| 58 |
* - :math:`\grave{a}` ``\grave{a}`` |
| 59 |
- :math:`\ddot{t}` ``\ddot{t}`` |
| 60 |
- :math:`\tilde{\alpha}` ``\tilde{\alpha}`` |
| 61 |
|
| 62 |
* - :math:`\breve{x}` ``\breve{x}`` |
| 63 |
- :math:`\dddot{t}` ``\dddot{t}`` |
| 64 |
- :math:`\vec{\imath}` ``\vec{\imath}`` |
| 65 |
|
| 66 |
* - :math:`\check{a}` ``\check{a}`` |
| 67 |
- :math:`\bar{a}` ``\bar{a}`` |
| 68 |
- :math:`\vec{R}` ``\vec{R}`` |
| 69 |
|
| 70 |
.. |
| 71 |
\widetilde{xxx} |
| 72 |
\widehat{xxx} |
| 73 |
|
| 74 |
Modulation Transfer Function: |
| 75 |
|
| 76 |
.. math:: |
| 77 |
|
| 78 |
\text{MTF} = \left|\frac{\mathcal{F}\{s(x)\}} |
| 79 |
{\mathcal{F}\{ s(x)\} |_{ω_{x}=0}}\right| |
| 80 |
= \mathrm{abs}\left(\frac |
| 81 |
{∫_{-∞}^{∞}s(x) \mathrm{e}^{\mathrm{i}ω_{x}x}\mathrm{d}{x}} |
| 82 |
{∫_{-∞}^{∞}s(x)\mathrm{d}{x}} |
| 83 |
\right). |
| 84 |
|
| 85 |
Math split over two lines: If a double backslash is detected outside a |
| 86 |
``\begin{...} \end{...}`` pair, the math code is wrapped in an AMSmath_ |
| 87 |
``align`` environment: |
| 88 |
|
| 89 |
.. math:: |
| 90 |
|
| 91 |
s_{\mathrm{out}}(x) & = s_{\mathrm{in}}(x') * s_δ(x-x') \\ |
| 92 |
& = ∫ s_{\mathrm{in}}(x')s_δ(x-x')\mathrm{d}x' |
| 93 |
|
| 94 |
Cases with the AMSmath_ ``cases`` environment: |
| 95 |
|
| 96 |
.. math:: |
| 97 |
|
| 98 |
\mathrm{sgn}(x) = \begin{cases} |
| 99 |
-1 & x<0\\ |
| 100 |
\phantom{-} 1 & x>0 |
| 101 |
\end{cases} |
| 102 |
|
| 103 |
.. _AMSmath: ftp://ftp.ams.org/ams/doc/amsmath/short-math-guide.pdf |