version to 0.16b.dev
[docutils.git] / docutils / test / functional / expected / math_output_html.html
blobb89abcab785a1a0d51de1963ac721b5b863a881f
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.16b.dev: http://docutils.sourceforge.net/" />
7 <title>Mathematics</title>
8 <link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
9 <link rel="stylesheet" href="../input/data/math.css" type="text/css" />
10 </head>
11 <body>
12 <div class="document" id="mathematics">
13 <h1 class="title">Mathematics</h1>
15 <p>Docutils supports inline math with the prefix or postfix <tt class="docutils literal">:math:</tt>
16 role specificator, <span class="formula"><i>n</i>! + sin(<i>x</i><span class="scripts"><sup class="script">2</sup><sub class="script"><i>n</i></sub></span>)</span> and <span class="formula"><i>A</i><sub><span class="text">c</span></sub> = <span class="fraction"><span class="ignored">(</span><span class="numerator"><i>π</i></span><span class="ignored">)/(</span><span class="denominator">4</span><span class="ignored">)</span></span><i>d</i><sup>2</sup></span>, as well as displayed math via the
17 <cite>math</cite> directive:</p>
18 <div class="formula">
19 <i>f</i>(<i>ϵ</i>) = <span class="fraction"><span class="ignored">(</span><span class="numerator">1</span><span class="ignored">)/(</span><span class="denominator">1 + exp<span class="array"><span class="arrayrow"><span class="bracket align-left"></span></span><span class="arrayrow"><span class="bracket align-left"></span></span></span><span class="fraction"><span class="ignored">(</span><span class="numerator"><i>ε</i></span><span class="ignored">)/(</span><span class="denominator"><i>k</i><sub><span class="text">B</span></sub><i>T</i></span><span class="ignored">)</span></span><span class="array"><span class="arrayrow"><span class="bracket align-right"></span></span><span class="arrayrow"><span class="bracket align-right"></span></span></span></span><span class="ignored">)</span></span>
20 </div>
21 <p>Content may start on the first line of the directive, e.g.</p>
22 <div class="formula">
23 <i>N</i> = <span class="fraction"><span class="ignored">(</span><span class="numerator"><span class="text">number of apples</span></span><span class="ignored">)/(</span><span class="denominator">7</span><span class="ignored">)</span></span>
24 </div>
25 <p>Equations can be labeled with a reference name using the <tt class="docutils literal">:name:</tt> option.
26 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>
27 <p>The determinant of the matrix</p>
28 <div class="formula" id="eq-m">
29 <b>M</b> = <span class="array"><span class="arrayrow"><span class="bracket align-left"></span></span><span class="arrayrow"><span class="bracket align-left"></span></span><span class="arrayrow"><span class="bracket align-left"></span></span></span><span class="array"><span class="arrayrow">
30 <span class="arraycell align-c">
31 <i>a</i>
32 </span>
33 <span class="arraycell align-c">
34 <i>b</i>
35 </span>
37 </span>
38 <span class="arrayrow">
39 <span class="arraycell align-c">
40
41 </span>
42 <span class="arraycell align-c">
43
44 </span>
46 </span>
47 <span class="arrayrow">
48 <span class="arraycell align-c">
49 <i>c</i>
50 </span>
51 <span class="arraycell align-c">
52 <i>d</i>
53 </span>
55 </span>
56 </span><span class="array"><span class="arrayrow"><span class="bracket align-right"></span></span><span class="arrayrow"><span class="bracket align-right"></span></span><span class="arrayrow"><span class="bracket align-right"></span></span></span>
57 </div>
58 <p>is <span class="formula">|<b>M</b>| = <i>ad</i> − <i>bc</i></span>.</p>
59 <p>More than one display math block can be put in one math directive.
60 For example, the following sum and integral with limits:</p>
61 <div class="formula">
62 <span class="limits"><sup class="limit">1</sup><span class="limit"></span><span class="limit"></span><sub class="limit">0</sub></span><i>x</i><sup><i>n</i></sup><i>dx</i> = <span class="fraction"><span class="ignored">(</span><span class="numerator">1</span><span class="ignored">)/(</span><span class="denominator"><i>n</i> + 1</span><span class="ignored">)</span></span>
63 </div>
64 <div class="formula">
65 <span class="limits"><sup class="limit"><i>m</i></sup><span class="limit"></span><span class="limit"></span><sub class="limit"><i>n</i> = 1</sub></span><i>n</i> = <span class="fraction"><span class="ignored">(</span><span class="numerator"><i>m</i>(<i>m</i> + 1)</span><span class="ignored">)/(</span><span class="denominator">2</span><span class="ignored">)</span></span>
66 </div>
67 <p>LaTeX-supported Unicode math symbols can be used in math roles and
68 directives:</p>
69 <p>The Schrödinger equation</p>
70 <div class="formula" id="eq-schrodinger">
71 <i>i</i><span class="fraction"><span class="ignored">(</span><span class="numerator"></span><span class="ignored">)/(</span><span class="denominator"><i>t</i></span><span class="ignored">)</span></span>Ψ = <i></i>Ψ, 
72 </div>
73 <p>with the <em>wave function</em> <span class="formula">Ψ</span>, describes how the quantum state of a
74 physical system changes in time.</p>
75 <dl class="docutils">
76 <dt>Math-Accents:</dt>
77 <dd><table border="1" class="colwidths-given borderless first last docutils">
78 <colgroup>
79 <col width="33%" />
80 <col width="33%" />
81 <col width="33%" />
82 </colgroup>
83 <tbody valign="top">
84 <tr><td><span class="formula"><i></i></span> <tt class="docutils literal">\acute{a}</tt></td>
85 <td><span class="formula"><i></i></span> <tt class="docutils literal">\dot{t}</tt></td>
86 <td><span class="formula"><i>γ̂</i></span> <tt class="docutils literal"><span class="pre">\hat{\gamma}</span></tt></td>
87 </tr>
88 <tr><td><span class="formula"><i></i></span> <tt class="docutils literal">\grave{a}</tt></td>
89 <td><span class="formula"><i></i></span> <tt class="docutils literal">\ddot{t}</tt></td>
90 <td><span class="formula"><i>α̃</i></span> <tt class="docutils literal"><span class="pre">\tilde{\alpha}</span></tt></td>
91 </tr>
92 <tr><td><span class="formula"><i></i></span> <tt class="docutils literal">\breve{x}</tt></td>
93 <td><span class="formula"><i>t⃛</i></span> <tt class="docutils literal">\dddot{t}</tt></td>
94 <td><span class="formula"><i>ı⃗</i></span> <tt class="docutils literal"><span class="pre">\vec{\imath}</span></tt></td>
95 </tr>
96 <tr><td><span class="formula"><i></i></span> <tt class="docutils literal">\check{a}</tt></td>
97 <td><span class="formula"><span class="bar"><i>a</i></span></span> <tt class="docutils literal">\bar{a}</tt></td>
98 <td><span class="formula"><i>R⃗</i></span> <tt class="docutils literal">\vec{R}</tt></td>
99 </tr>
100 </tbody>
101 </table>
102 </dd>
103 </dl>
104 <!-- \widetilde{xxx}
105 \widehat{xxx} -->
106 <p>Modulation Transfer Function:</p>
107 <div class="formula">
108 <span class="text">MTF</span> = <span class="array"><span class="arrayrow"><span class="bracket align-left">|</span></span><span class="arrayrow"><span class="bracket align-left">|</span></span></span><span class="fraction"><span class="ignored">(</span><span class="numerator">ℱ{<i>s</i>(<i>x</i>)}</span><span class="ignored">)/(</span><span class="denominator">ℱ{<i>s</i>(<i>x</i>)}|<sub><i>ω</i><sub><i>x</i></sub> = 0</sub></span><span class="ignored">)</span></span><span class="array"><span class="arrayrow"><span class="bracket align-right">|</span></span><span class="arrayrow"><span class="bracket align-right">|</span></span></span> = <span class="mathrm"> abs</span><span class="array"><span class="arrayrow"><span class="bracket align-left"></span></span><span class="arrayrow"><span class="bracket align-left"></span></span></span><span class="fraction"><span class="ignored">(</span><span class="numerator"><span class="limits"><span class="limit"></span><span class="limit"></span></span><span class="scripts"><sup class="script"></sup><sub class="script"> − ∞</sub></span><i>s</i>(<i>x</i>)<span class="mathrm">e</span><sup><span class="mathrm">i</span><i>ω</i><sub><i>x</i></sub><i>x</i></sup><span class="mathrm">d</span><i>x</i></span><span class="ignored">)/(</span><span class="denominator"><span class="limits"><span class="limit"></span><span class="limit"></span></span><span class="scripts"><sup class="script"></sup><sub class="script"> − ∞</sub></span><i>s</i>(<i>x</i>)<span class="mathrm">d</span><i>x</i></span><span class="ignored">)</span></span><span class="array"><span class="arrayrow"><span class="bracket align-right"></span></span><span class="arrayrow"><span class="bracket align-right"></span></span></span>.
109 </div>
110 <p>Math split over two lines: If a double backslash is detected outside a
111 <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>
112 <tt class="docutils literal">align</tt> environment:</p>
113 <div class="formula">
114 <span class="environment"><span class="arrayrow">
115 <span class="arraycell align-r">
116 <i>s</i><sub><span class="mathrm">out</span></sub>(<i>x</i>)
117 </span>
118 <span class="arraycell align-l">
119  = <i>s</i><sub><span class="mathrm">in</span></sub>(<i>x</i>’)*<i>s</i><sub><i>δ</i></sub>(<i>x</i> − <i>x</i>’)
120 </span>
122 </span>
123 <span class="arrayrow">
124 <span class="arraycell align-r">
126 </span>
127 <span class="arraycell align-l">
129 </span>
131 </span>
132 <span class="arrayrow">
133 <span class="arraycell align-r">
135 </span>
136 <span class="arraycell align-l">
137  = <span class="limits"><span class="limit"></span><span class="limit"></span></span><i>s</i><sub><span class="mathrm">in</span></sub>(<i>x</i>’)<i>s</i><sub><i>δ</i></sub>(<i>x</i> − <i>x</i>’)<span class="mathrm">d</span><i>x</i>
138 </span>
140 </span>
141 </span>
142 </div>
143 <p>Cases (&quot;manually&quot;, with <tt class="docutils literal">matrix</tt> environment):</p>
144 <div class="formula">
145 <span class="mathrm">sgn</span>(<i>x</i>) = <span class="array"><span class="arrayrow"><span class="bracket align-left"></span></span><span class="arrayrow"><span class="bracket align-left"></span></span><span class="arrayrow"><span class="bracket align-left"></span></span></span><span class="array"><span class="arrayrow">
146 <span class="arraycell align-c">
147  − 1
148 </span>
149 <span class="arraycell align-c">
150 <i>x</i>&lt;0
151 </span>
153 </span>
154 <span class="arrayrow">
155 <span class="arraycell align-c">
157 </span>
158 <span class="arraycell align-c">
160 </span>
162 </span>
163 <span class="arrayrow">
164 <span class="arraycell align-c">
166 </span>
167 <span class="arraycell align-c">
168 <i>x</i>&gt;0
169 </span>
171 </span>
172 </span><span class="emptydot"></span>
173 </div>
174 <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
175 HTML writers with <tt class="docutils literal"><span class="pre">--math-output=MathML</span></tt>):</p>
176 <div class="formula">
177 <span class="mathrm">sgn</span>(<i>x</i>) = <span class="array"><span class="arrayrow"><span class="bracket align-l"></span></span><span class="arrayrow"><span class="bracket align-l"></span></span><span class="arrayrow"><span class="bracket align-l"></span></span></span><span class="bracketcases">
178 <span class="arrayrow">
179 <span class="case align-l">
180  − 1
181 </span>
182 <span class="case align-l">
183 <i>x</i>&lt;0
184 </span>
186 </span>
187 <span class="arrayrow">
188 <span class="case align-l">
189   
190 </span>
191 <span class="case align-l">
192   
193 </span>
195 </span>
196 <span class="arrayrow">
197 <span class="case align-l">
198 1
199 </span>
200 <span class="case align-l">
201 <i>x</i>&gt;0
202 </span>
204 </span>
206 </span>
208 </div>
209 </div>
210 </body>
211 </html>