File: math.txt

package info (click to toggle)
python-docutils 0.19%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,668 kB
  • sloc: python: 45,630; lisp: 14,475; xml: 1,789; javascript: 1,032; sh: 130; makefile: 104
file content (105 lines) | stat: -rw-r--r-- 2,890 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
Mathematics
-----------

.. math:: N = \idotsint

Docutils supports inline math with the prefix or postfix ``:math:``
role specificator, :math:`n! + \sin(x_n^2)` and `A_\text{c} =
\frac{\pi}{4} d^2`:math:, as well as displayed math via the
`math` directive:

.. math::

   f(\epsilon) = \frac{1}{1 + \exp\left(\frac{\varepsilon}{k_\text{B}T}\right)}

Content may start on the first line of the directive, e.g.

.. math:: N = \frac{\text{number of apples}}{7}

Equations can be labeled with a reference name using the ``:name:`` option.
See `eq:M`_ and `eq:schrödinger`_ below.

The determinant of the matrix

.. math:: :name: eq:M

   \mathbf{M} = \left(\begin{matrix}a&b\\c&d\end{matrix}\right)

is :math:`|\mathbf{M}| = ad - bc`.

More than one display math block can be put in one math directive.
For example, the following sum and integral with limits:

.. math::

          \int_0^1 x^n dx = \frac{1}{n + 1}

          \sum_{n=1}^m n = \frac{m(m+1)}{2}

LaTeX-supported Unicode math symbols can be used in math roles and
directives:

The Schrödinger equation

.. math:: :name: eq:schrödinger

   i\hbar \frac{∂}{∂t}Ψ = \hat{H}Ψ,

with the *wave function* :math:`Ψ`, describes how the quantum state of a
physical system changes in time.

Math-Accents:
  .. list-table::
     :class: borderless
     :width: 100%

     * - :math:`\acute{a}`      ``\acute{a}``
       - :math:`\dot{t}`        ``\dot{t}``
       - :math:`\hat{\gamma}`   ``\hat{\gamma}``

     * - :math:`\grave{a}`      ``\grave{a}``
       - :math:`\ddot{t}`       ``\ddot{t}``
       - :math:`\tilde{\alpha}` ``\tilde{\alpha}``

     * - :math:`\breve{x}`      ``\breve{x}``
       - :math:`\dddot{t}`      ``\dddot{t}``
       - :math:`\vec{\imath}`   ``\vec{\imath}``

     * - :math:`\check{a}`      ``\check{a}``
       - :math:`\bar{a}`        ``\bar{a}``
       - :math:`\vec{R}`        ``\vec{R}``

..
       \widetilde{xxx}
       \widehat{xxx}

Modulation Transfer Function:

.. math::

 \text{MTF} = \left|\frac{\mathcal{F}\{s(x)\}}
                         {\mathcal{F}\{ s(x)\} |_{ω_{x}=0}}\right|
            = \mathrm{abs}\left(\frac
                  {∫_{-∞}^{∞}s(x) \mathrm{e}^{\mathrm{i}ω_{x}x}\mathrm{d}{x}}
                  {∫_{-∞}^{∞}s(x)\mathrm{d}{x}}
              \right).

Math split over two lines: If a double backslash is detected outside a
``\begin{...} \end{...}`` pair, the math code is wrapped in an AMSmath_
``align`` environment:

.. math::

   s_{\mathrm{out}}(x) & = s_{\mathrm{in}}(x') * s_δ(x-x') \\
                       & = ∫ s_{\mathrm{in}}(x')s_δ(x-x')\mathrm{d}x'

Cases with the AMSmath_ ``cases`` environment:

.. math::

   \mathrm{sgn}(x) = \begin{cases}
                                -1 & x<0\\
                       \phantom{-} 1 & x>0
                     \end{cases}

.. _AMSmath: ftp://ftp.ams.org/ams/doc/amsmath/short-math-guide.pdf