Common directive options:
[docutils.git] / test / functional / expected / math_output_latex.html
blob54050f347347f33580095793ad9a3e044f74e93e
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.8: http://docutils.sourceforge.net/" />
7 <title>Mathematics</title>
8 <link rel="stylesheet" href="../../../docutils/writers/html4css1/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">
16 n! + \sin(x_n^2)</tt>
17 and <tt class="math">
18 A_\text{c} =
19 \frac{\pi}{4} d^2</tt>
20 , as well as displayed math via the
21 <cite>math</cite> directive:</p>
22 <pre class="math">
23 f(\epsilon) = \frac{1}{1 + \exp\left(\frac{\varepsilon}{k_\text{B}T}\right)}
24 </pre>
25 <p>Content may start on the first line of the directive, e.g.</p>
26 <pre class="math">
27 N = \frac{\text{number of apples}}{7}
28 </pre>
29 <p>Equations can be labeled with a reference name using the <tt class="docutils literal">:name:</tt> option.
30 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>
31 <p>The determinant of the matrix</p>
32 <pre class="math" id="eq-m">
33 \mathbf{M} = \left(\begin{matrix}a&amp;b\\c&amp;d\end{matrix}\right)
34 </pre>
35 <p>is <tt class="math">
36 |\mathbf{M}| = ad - bc</tt>
37 .</p>
38 <p>More than one display math block can be put in one math directive.
39 For example, the following sum and integral with limits:</p>
40 <pre class="math">
41 \int_0^1 x^n dx = \frac{1}{n + 1}
42 </pre>
43 <pre class="math">
44 \sum_{n=1}^m n = \frac{m(m+1)}{2}
45 </pre>
46 <p>LaTeX-supported Unicode math symbols can be used in math roles and
47 directives:</p>
48 <p>The Schrödinger equation</p>
49 <pre class="math" id="eq-schrodinger">
50 i\hbar \frac{\partial }{\partial t}\Psi = \hat{H}\Psi ,
51 </pre>
52 <p>with the <em>wave function</em> <tt class="math">
53 \Psi </tt>
54 , describes how the quantum state of a
55 physical system changes in time.</p>
56 <dl class="docutils">
57 <dt>Math-Accents:</dt>
58 <dd><table border="1" class="borderless first last docutils">
59 <colgroup>
60 <col width="33%" />
61 <col width="33%" />
62 <col width="33%" />
63 </colgroup>
64 <tbody valign="top">
65 <tr><td><tt class="math">
66 \acute{a}</tt>
67 <tt class="docutils literal">\acute{a}</tt></td>
68 <td><tt class="math">
69 \dot{t}</tt>
70 <tt class="docutils literal">\dot{t}</tt></td>
71 <td><tt class="math">
72 \hat{\gamma}</tt>
73 <tt class="docutils literal"><span class="pre">\hat{\gamma}</span></tt></td>
74 </tr>
75 <tr><td><tt class="math">
76 \grave{a}</tt>
77 <tt class="docutils literal">\grave{a}</tt></td>
78 <td><tt class="math">
79 \ddot{t}</tt>
80 <tt class="docutils literal">\ddot{t}</tt></td>
81 <td><tt class="math">
82 \tilde{\alpha}</tt>
83 <tt class="docutils literal"><span class="pre">\tilde{\alpha}</span></tt></td>
84 </tr>
85 <tr><td><tt class="math">
86 \breve{x}</tt>
87 <tt class="docutils literal">\breve{x}</tt></td>
88 <td><tt class="math">
89 \dddot{t}</tt>
90 <tt class="docutils literal">\dddot{t}</tt></td>
91 <td><tt class="math">
92 \vec{\imath}</tt>
93 <tt class="docutils literal"><span class="pre">\vec{\imath}</span></tt></td>
94 </tr>
95 <tr><td><tt class="math">
96 \check{a}</tt>
97 <tt class="docutils literal">\check{a}</tt></td>
98 <td><tt class="math">
99 \bar{a}</tt>
100 <tt class="docutils literal">\bar{a}</tt></td>
101 <td><tt class="math">
102 \vec{R}</tt>
103 <tt class="docutils literal">\vec{R}</tt></td>
104 </tr>
105 </tbody>
106 </table>
107 </dd>
108 </dl>
109 <!-- \widetilde{xxx}
110 \widehat{xxx} -->
111 <p>Modulation Transfer Function:</p>
112 <pre class="math">
113 \text{MTF} = \left|\frac{\mathcal{F}\{s(x)\}}
114 {\mathcal{F}\{ s(x)\} |_{\omega _{x}=0}}\right|
115 = \mathrm{abs}\left(\frac
116 {\int _{-\infty }^{\infty }s(x) \mathrm{e}^{\mathrm{i}\omega _{x}x}\mathrm{d}{x}}
117 {\int _{-\infty }^{\infty }s(x)\mathrm{d}{x}}
118 \right).
119 </pre>
120 <p>Math split over two lines: If a double backslash is detected outside a
121 <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>
122 <tt class="docutils literal">align</tt> environment:</p>
123 <pre class="math">
124 s_{\mathrm{out}}(x) &amp; = s_{\mathrm{in}}(x') * s_\delta (x-x') \\
125 &amp; = \int s_{\mathrm{in}}(x')s_\delta (x-x')\mathrm{d}x'
126 </pre>
127 <p>Cases (&quot;manually&quot;, with <tt class="docutils literal">matrix</tt> environment):</p>
128 <pre class="math">
129 \mathrm{sgn}(x) = \left\{\begin{matrix}
130 -1 &amp; x&lt;0\\
131 1 &amp; x&gt;0
132 \end{matrix}\right.
133 </pre>
134 <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
135 HTML writers with <tt class="docutils literal"><span class="pre">--math-output=MathML</span></tt>):</p>
136 <pre class="math">
137 \mathrm{sgn}(x) = \begin{cases}
138 -1 &amp; x&lt;0\\
139 1 &amp; x&gt;0
140 \end{cases}
141 </pre>
142 </div>
143 </body>
144 </html>