Release 0.18.1
[docutils.git] / docutils / test / functional / expected / math_output_mathml.html
blobcf4c0d3addf50477c98028089ba053fe85a67798
1 <!DOCTYPE html>
2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3 <head>
4 <meta charset="utf-8"/>
5 <meta name="viewport" content="width=device-width, initial-scale=1" />
6 <meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
7 <title>Mathematics</title>
8 <link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
9 <link rel="stylesheet" href="../input/data/plain.css" type="text/css" />
10 </head>
11 <body>
12 <main id="mathematics">
13 <h1 class="title">Mathematics</h1>
15 <p>Docutils supports inline math with the prefix or postfix <span class="docutils literal">:math:</span>
16 role specificator, <math xmlns="http://www.w3.org/1998/Math/MathML">
17 <mi>n</mi>
18 <mo>!</mo>
19 <mo>+</mo>
20 <mi>sin</mi>
21 <mo>&ApplyFunction;</mo>
22 <mo stretchy="false">(</mo>
23 <msubsup>
24 <mi>x</mi>
25 <mi>n</mi>
26 <mn>2</mn>
27 </msubsup>
28 <mo stretchy="false">)</mo>
29 </math> and <math xmlns="http://www.w3.org/1998/Math/MathML">
30 <msub>
31 <mi>A</mi>
32 <mtext>c</mtext>
33 </msub>
34 <mo>=</mo>
35 <mfrac>
36 <mi>π</mi>
37 <mn>4</mn>
38 </mfrac>
39 <msup>
40 <mi>d</mi>
41 <mn>2</mn>
42 </msup>
43 </math>, as well as displayed math via the
44 <cite>math</cite> directive:</p>
45 <div>
46 <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
47 <mi>f</mi>
48 <mo stretchy="false">(</mo>
49 <mi>ϵ</mi>
50 <mo stretchy="false">)</mo>
51 <mo>=</mo>
52 <mfrac>
53 <mn>1</mn>
54 <mrow>
55 <mn>1</mn>
56 <mo>+</mo>
57 <mi>exp</mi>
58 <mo>&ApplyFunction;</mo>
59 <mrow>
60 <mo>(</mo>
61 <mfrac>
62 <mi>ε</mi>
63 <mrow>
64 <msub>
65 <mi>k</mi>
66 <mtext>B</mtext>
67 </msub>
68 <mi>T</mi>
69 </mrow>
70 </mfrac>
71 <mo>)</mo>
72 </mrow>
73 </mrow>
74 </mfrac>
75 </math>
76 </div>
77 <p>Content may start on the first line of the directive, e.g.</p>
78 <div>
79 <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
80 <mi>N</mi>
81 <mo>=</mo>
82 <mfrac>
83 <mtext>number of apples</mtext>
84 <mn>7</mn>
85 </mfrac>
86 </math>
87 </div>
88 <p>Equations can be labeled with a reference name using the <span class="docutils literal">:name:</span> option.
89 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>
90 <p>The determinant of the matrix</p>
91 <div id="eq-m">
92 <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
93 <mi mathvariant="bold">M</mi>
94 <mo>=</mo>
95 <mrow>
96 <mo>(</mo>
97 <mtable>
98 <mtr>
99 <mtd>
100 <mi>a</mi>
101 </mtd>
102 <mtd>
103 <mi>b</mi>
104 </mtd>
105 </mtr>
106 <mtr>
107 <mtd>
108 <mi>c</mi>
109 </mtd>
110 <mtd>
111 <mi>d</mi>
112 </mtd>
113 </mtr>
114 </mtable>
115 <mo>)</mo>
116 </mrow>
117 </math>
118 </div>
119 <p>is <math xmlns="http://www.w3.org/1998/Math/MathML">
120 <mo stretchy="false">|</mo>
121 <mi mathvariant="bold">M</mi>
122 <mo stretchy="false">|</mo>
123 <mo>=</mo>
124 <mi>a</mi>
125 <mi>d</mi>
126 <mo></mo>
127 <mi>b</mi>
128 <mi>c</mi>
129 </math>.</p>
130 <p>More than one display math block can be put in one math directive.
131 For example, the following sum and integral with limits:</p>
132 <div>
133 <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
134 <msubsup>
135 <mo></mo>
136 <mn>0</mn>
137 <mn>1</mn>
138 </msubsup>
139 <msup>
140 <mi>x</mi>
141 <mi>n</mi>
142 </msup>
143 <mi>d</mi>
144 <mi>x</mi>
145 <mo>=</mo>
146 <mfrac>
147 <mn>1</mn>
148 <mrow>
149 <mi>n</mi>
150 <mo>+</mo>
151 <mn>1</mn>
152 </mrow>
153 </mfrac>
154 </math>
155 </div>
156 <div>
157 <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
158 <munderover>
159 <mo movablelimits="true"></mo>
160 <mrow>
161 <mi>n</mi>
162 <mo>=</mo>
163 <mn>1</mn>
164 </mrow>
165 <mi>m</mi>
166 </munderover>
167 <mi>n</mi>
168 <mo>=</mo>
169 <mfrac>
170 <mrow>
171 <mi>m</mi>
172 <mo stretchy="false">(</mo>
173 <mi>m</mi>
174 <mo>+</mo>
175 <mn>1</mn>
176 <mo stretchy="false">)</mo>
177 </mrow>
178 <mn>2</mn>
179 </mfrac>
180 </math>
181 </div>
182 <p>LaTeX-supported Unicode math symbols can be used in math roles and
183 directives:</p>
184 <p>The Schrödinger equation</p>
185 <div id="eq-schrodinger">
186 <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
187 <mi>i</mi>
188 <mi></mi>
189 <mfrac>
190 <mo></mo>
191 <mrow>
192 <mo></mo>
193 <mi>t</mi>
194 </mrow>
195 </mfrac>
196 <mi class="capital-greek">Ψ</mi>
197 <mo>=</mo>
198 <mover>
199 <mi>H</mi>
200 <mo stretchy="false">ˆ</mo>
201 </mover>
202 <mi class="capital-greek">Ψ</mi>
203 <mo>,</mo>
204 </math>
205 </div>
206 <p>with the <em>wave function</em> <math xmlns="http://www.w3.org/1998/Math/MathML">
207 <mi class="capital-greek">Ψ</mi>
208 </math>, describes how the quantum state of a
209 physical system changes in time.</p>
210 <dl>
211 <dt>Math-Accents:</dt>
212 <dd><table class="borderless" style="width: 100%;">
213 <tbody>
214 <tr><td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
215 <mover>
216 <mi>a</mi>
217 <mo stretchy="false">´</mo>
218 </mover>
219 </math> <span class="docutils literal">\acute{a}</span></p></td>
220 <td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
221 <mover>
222 <mi>t</mi>
223 <mo stretchy="false">˙</mo>
224 </mover>
225 </math> <span class="docutils literal">\dot{t}</span></p></td>
226 <td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
227 <mover>
228 <mi>γ</mi>
229 <mo stretchy="false">ˆ</mo>
230 </mover>
231 </math> <span class="docutils literal"><span class="pre">\hat{\gamma}</span></span></p></td>
232 </tr>
233 <tr><td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
234 <mover>
235 <mi>a</mi>
236 <mo stretchy="false">`</mo>
237 </mover>
238 </math> <span class="docutils literal">\grave{a}</span></p></td>
239 <td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
240 <mover>
241 <mi>t</mi>
242 <mo stretchy="false">¨</mo>
243 </mover>
244 </math> <span class="docutils literal">\ddot{t}</span></p></td>
245 <td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
246 <mover>
247 <mi>α</mi>
248 <mo stretchy="false">˜</mo>
249 </mover>
250 </math> <span class="docutils literal"><span class="pre">\tilde{\alpha}</span></span></p></td>
251 </tr>
252 <tr><td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
253 <mover>
254 <mi>x</mi>
255 <mo stretchy="false">˘</mo>
256 </mover>
257 </math> <span class="docutils literal">\breve{x}</span></p></td>
258 <td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
259 <mover>
260 <mi>t</mi>
261 <mo stretchy="false"></mo>
262 </mover>
263 </math> <span class="docutils literal">\dddot{t}</span></p></td>
264 <td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
265 <mover>
266 <mi>ı</mi>
267 <mo stretchy="false" accent="false"></mo>
268 </mover>
269 </math> <span class="docutils literal"><span class="pre">\vec{\imath}</span></span></p></td>
270 </tr>
271 <tr><td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
272 <mover>
273 <mi>a</mi>
274 <mo stretchy="false">ˇ</mo>
275 </mover>
276 </math> <span class="docutils literal">\check{a}</span></p></td>
277 <td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
278 <mover>
279 <mi>a</mi>
280 <mo stretchy="false">ˉ</mo>
281 </mover>
282 </math> <span class="docutils literal">\bar{a}</span></p></td>
283 <td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
284 <mover>
285 <mi>R</mi>
286 <mo stretchy="false" accent="false"></mo>
287 </mover>
288 </math> <span class="docutils literal">\vec{R}</span></p></td>
289 </tr>
290 </tbody>
291 </table>
292 </dd>
293 </dl>
294 <!-- \widetilde{xxx}
295 \widehat{xxx} -->
296 <p>Modulation Transfer Function:</p>
297 <div>
298 <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
299 <mtext>MTF</mtext>
300 <mo>=</mo>
301 <mrow>
302 <mo>|</mo>
303 <mfrac>
304 <mrow>
305 <mi mathvariant="script">F</mi>
306 <mo>{</mo>
307 <mi>s</mi>
308 <mo stretchy="false">(</mo>
309 <mi>x</mi>
310 <mo stretchy="false">)</mo>
311 <mo>}</mo>
312 </mrow>
313 <mrow>
314 <mi mathvariant="script">F</mi>
315 <mo>{</mo>
316 <mi>s</mi>
317 <mo stretchy="false">(</mo>
318 <mi>x</mi>
319 <mo stretchy="false">)</mo>
320 <mo>}</mo>
321 <msub>
322 <mo stretchy="false">|</mo>
323 <mrow>
324 <msub>
325 <mi>ω</mi>
326 <mi>x</mi>
327 </msub>
328 <mo>=</mo>
329 <mn>0</mn>
330 </mrow>
331 </msub>
332 </mrow>
333 </mfrac>
334 <mo>|</mo>
335 </mrow>
336 <mo>=</mo>
337 <mi mathvariant="normal">abs</mi>
338 <mrow>
339 <mo>(</mo>
340 <mfrac>
341 <mrow>
342 <msubsup>
343 <mo></mo>
344 <mrow>
345 <mo></mo>
346 <mo></mo>
347 </mrow>
348 <mo></mo>
349 </msubsup>
350 <mi>s</mi>
351 <mo stretchy="false">(</mo>
352 <mi>x</mi>
353 <mo stretchy="false">)</mo>
354 <msup>
355 <mi mathvariant="normal">e</mi>
356 <mrow>
357 <mi mathvariant="normal">i</mi>
358 <msub>
359 <mi>ω</mi>
360 <mi>x</mi>
361 </msub>
362 <mi>x</mi>
363 </mrow>
364 </msup>
365 <mi mathvariant="normal">d</mi>
366 <mi>x</mi>
367 </mrow>
368 <mrow>
369 <msubsup>
370 <mo></mo>
371 <mrow>
372 <mo></mo>
373 <mo></mo>
374 </mrow>
375 <mo></mo>
376 </msubsup>
377 <mi>s</mi>
378 <mo stretchy="false">(</mo>
379 <mi>x</mi>
380 <mo stretchy="false">)</mo>
381 <mi mathvariant="normal">d</mi>
382 <mi>x</mi>
383 </mrow>
384 </mfrac>
385 <mo>)</mo>
386 </mrow>
387 <mo>.</mo>
388 </math>
389 </div>
390 <p>Math split over two lines: If a double backslash is detected outside a
391 <span class="docutils literal"><span class="pre">\begin{...}</span> <span class="pre">\end{...}</span></span> 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>
392 <span class="docutils literal">align</span> environment:</p>
393 <div>
394 <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
395 <mtable class="align" columnalign="right left" columnspacing="0" displaystyle="true">
396 <mtr>
397 <mtd>
398 <msub>
399 <mi>s</mi>
400 <mi mathvariant="normal">out</mi>
401 </msub>
402 <mo stretchy="false">(</mo>
403 <mi>x</mi>
404 <mo stretchy="false">)</mo>
405 </mtd>
406 <mtd>
407 <mo>=</mo>
408 <msub>
409 <mi>s</mi>
410 <mi mathvariant="normal">in</mi>
411 </msub>
412 <mo stretchy="false">(</mo>
413 <mi>x</mi>
414 <mo>'</mo>
415 <mo stretchy="false">)</mo>
416 <mo>*</mo>
417 <msub>
418 <mi>s</mi>
419 <mi>δ</mi>
420 </msub>
421 <mo stretchy="false">(</mo>
422 <mi>x</mi>
423 <mo></mo>
424 <mi>x</mi>
425 <mo>'</mo>
426 <mo stretchy="false">)</mo>
427 </mtd>
428 </mtr>
429 <mtr>
430 <mtd>
431 </mtd>
432 <mtd>
433 <mo>=</mo>
434 <mo></mo>
435 <msub>
436 <mi>s</mi>
437 <mi mathvariant="normal">in</mi>
438 </msub>
439 <mo stretchy="false">(</mo>
440 <mi>x</mi>
441 <mo>'</mo>
442 <mo stretchy="false">)</mo>
443 <msub>
444 <mi>s</mi>
445 <mi>δ</mi>
446 </msub>
447 <mo stretchy="false">(</mo>
448 <mi>x</mi>
449 <mo></mo>
450 <mi>x</mi>
451 <mo>'</mo>
452 <mo stretchy="false">)</mo>
453 <mi mathvariant="normal">d</mi>
454 <mi>x</mi>
455 <mo>'</mo>
456 </mtd>
457 </mtr>
458 </mtable>
459 </math>
460 </div>
461 <p>Cases with the <a class="reference external" href="ftp://ftp.ams.org/ams/doc/amsmath/short-math-guide.pdf">AMSmath</a> <span class="docutils literal">cases</span> environment:</p>
462 <div>
463 <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
464 <mi mathvariant="normal">sgn</mi>
465 <mo stretchy="false">(</mo>
466 <mi>x</mi>
467 <mo stretchy="false">)</mo>
468 <mo>=</mo>
469 <mrow>
470 <mo rspace="0.17em">{</mo>
471 <mtable columnalign="left">
472 <mtr>
473 <mtd>
474 <mo></mo>
475 <mn>1</mn>
476 </mtd>
477 <mtd>
478 <mi>x</mi>
479 <mo>&lt;</mo>
480 <mn>0</mn>
481 </mtd>
482 </mtr>
483 <mtr>
484 <mtd>
485 <mphantom>
486 <mo></mo>
487 </mphantom>
488 <mn>1</mn>
489 </mtd>
490 <mtd>
491 <mi>x</mi>
492 <mo>&gt;</mo>
493 <mn>0</mn>
494 </mtd>
495 </mtr>
496 </mtable>
497 </mrow>
498 </math>
499 </div>
500 </main>
501 </body>
502 </html>