Release 0.11: set version number to 0.12
[docutils.git] / test / functional / expected / math_output_latex.html
blob8ef54b8060fea4fd0029356b6c1432213b70e309
1 <?xml version="1.0" encoding="utf-8" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
7 <title>Mathematics</title>
8 <link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
9 </head>
10 <body>
11 <div class="document" id="mathematics">
12 <h1 class="title">Mathematics</h1>
14 <p>Docutils supports inline math with the prefix or postfix <tt class="docutils literal">:math:</tt>
15 role specificator, <tt class="math">n! + \sin(x_n^2)</tt>
16 and <tt class="math">A_\text{c} =
17 \frac{\pi}{4} d^2</tt>
18 , as well as displayed math via the
19 <cite>math</cite> directive:</p>
20 <pre class="math">
21 f(\epsilon) = \frac{1}{1 + \exp\left(\frac{\varepsilon}{k_\text{B}T}\right)}
22 </pre>
23 <p>Content may start on the first line of the directive, e.g.</p>
24 <pre class="math">
25 N = \frac{\text{number of apples}}{7}
26 </pre>
27 <p>Equations can be labeled with a reference name using the <tt class="docutils literal">:name:</tt> option.
28 See <a class="reference internal" href="#eq-m">eq:M</a> and <a class="reference internal" href="#eq-schrodinger">eq:schrödinger</a> below.</p>
29 <p>The determinant of the matrix</p>
30 <pre class="math" id="eq-m">
31 \mathbf{M} = \left(\begin{matrix}a&amp;b\\c&amp;d\end{matrix}\right)
32 </pre>
33 <p>is <tt class="math">|\mathbf{M}| = ad - bc</tt>
34 .</p>
35 <p>More than one display math block can be put in one math directive.
36 For example, the following sum and integral with limits:</p>
37 <pre class="math">
38 \int_0^1 x^n dx = \frac{1}{n + 1}
39 </pre>
40 <pre class="math">
41 \sum_{n=1}^m n = \frac{m(m+1)}{2}
42 </pre>
43 <p>LaTeX-supported Unicode math symbols can be used in math roles and
44 directives:</p>
45 <p>The Schrödinger equation</p>
46 <pre class="math" id="eq-schrodinger">
47 i\hbar \frac{\partial }{\partial t}\Psi = \hat{H}\Psi ,
48 </pre>
49 <p>with the <em>wave function</em> <tt class="math">\Psi </tt>
50 , describes how the quantum state of a
51 physical system changes in time.</p>
52 <dl class="docutils">
53 <dt>Math-Accents:</dt>
54 <dd><table border="1" class="borderless first last docutils">
55 <colgroup>
56 <col width="33%" />
57 <col width="33%" />
58 <col width="33%" />
59 </colgroup>
60 <tbody valign="top">
61 <tr><td><tt class="math">\acute{a}</tt>
62 <tt class="docutils literal">\acute{a}</tt></td>
63 <td><tt class="math">\dot{t}</tt>
64 <tt class="docutils literal">\dot{t}</tt></td>
65 <td><tt class="math">\hat{\gamma}</tt>
66 <tt class="docutils literal"><span class="pre">\hat{\gamma}</span></tt></td>
67 </tr>
68 <tr><td><tt class="math">\grave{a}</tt>
69 <tt class="docutils literal">\grave{a}</tt></td>
70 <td><tt class="math">\ddot{t}</tt>
71 <tt class="docutils literal">\ddot{t}</tt></td>
72 <td><tt class="math">\tilde{\alpha}</tt>
73 <tt class="docutils literal"><span class="pre">\tilde{\alpha}</span></tt></td>
74 </tr>
75 <tr><td><tt class="math">\breve{x}</tt>
76 <tt class="docutils literal">\breve{x}</tt></td>
77 <td><tt class="math">\dddot{t}</tt>
78 <tt class="docutils literal">\dddot{t}</tt></td>
79 <td><tt class="math">\vec{\imath}</tt>
80 <tt class="docutils literal"><span class="pre">\vec{\imath}</span></tt></td>
81 </tr>
82 <tr><td><tt class="math">\check{a}</tt>
83 <tt class="docutils literal">\check{a}</tt></td>
84 <td><tt class="math">\bar{a}</tt>
85 <tt class="docutils literal">\bar{a}</tt></td>
86 <td><tt class="math">\vec{R}</tt>
87 <tt class="docutils literal">\vec{R}</tt></td>
88 </tr>
89 </tbody>
90 </table>
91 </dd>
92 </dl>
93 <!-- \widetilde{xxx}
94 \widehat{xxx} -->
95 <p>Modulation Transfer Function:</p>
96 <pre class="math">
97 \text{MTF} = \left|\frac{\mathcal{F}\{s(x)\}}
98 {\mathcal{F}\{ s(x)\} |_{\omega _{x}=0}}\right|
99 = \mathrm{abs}\left(\frac
100 {\int _{-\infty }^{\infty }s(x) \mathrm{e}^{\mathrm{i}\omega _{x}x}\mathrm{d}{x}}
101 {\int _{-\infty }^{\infty }s(x)\mathrm{d}{x}}
102 \right).
103 </pre>
104 <p>Math split over two lines: If a double backslash is detected outside a
105 <tt class="docutils literal"><span class="pre">\begin{...}</span> <span class="pre">\end{...}</span></tt> pair, the math code is wrapped in an <a class="reference external" href="ftp://ftp.ams.org/ams/doc/amsmath/short-math-guide.pdf">AMSmath</a>
106 <tt class="docutils literal">align</tt> environment:</p>
107 <pre class="math">
108 s_{\mathrm{out}}(x) &amp; = s_{\mathrm{in}}(x') * s_\delta (x-x') \\
109 &amp; = \int s_{\mathrm{in}}(x')s_\delta (x-x')\mathrm{d}x'
110 </pre>
111 <p>Cases (&quot;manually&quot;, with <tt class="docutils literal">matrix</tt> environment):</p>
112 <pre class="math">
113 \mathrm{sgn}(x) = \left\{\begin{matrix}
114 -1 &amp; x&lt;0\\
115 1 &amp; x&gt;0
116 \end{matrix}\right.
117 </pre>
118 <p>Cases with the <a class="reference external" href="ftp://ftp.ams.org/ams/doc/amsmath/short-math-guide.pdf">AMSmath</a> <tt class="docutils literal">cases</tt> environment (not (yet) supported by
119 HTML writers with <tt class="docutils literal"><span class="pre">--math-output=MathML</span></tt>):</p>
120 <pre class="math">
121 \mathrm{sgn}(x) = \begin{cases}
122 -1 &amp; x&lt;0\\
123 1 &amp; x&gt;0
124 \end{cases}
125 </pre>
126 </div>
127 </body>
128 </html>