change version number from 0.14rc2 to 0.14rc2.dev
[docutils.git] / test / functional / expected / math_output_mathml.xhtml
blob7a85ea3ebd8730241c063e60db7fcacd6d0decaa
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="generator" content="Docutils 0.14rc2.dev: http://docutils.sourceforge.net/" />
6 <title>Mathematics</title>
7 <link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
8 <link rel="stylesheet" href="../input/data/plain.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 <span class="docutils literal">:math:</span>
15 role specificator, <math xmlns="http://www.w3.org/1998/Math/MathML">
16 <mrow><mi>n</mi><mo>!</mo><mo>+</mo><mo>sin</mo><mo>(</mo><msubsup><mi>x</mi><mi>n</mi><mn>2</mn></msubsup><mo>)</mo></mrow></math> and <math xmlns="http://www.w3.org/1998/Math/MathML">
17 <mrow><msub><mi>A</mi><mtext>c</mtext></msub><mo>=</mo><mfrac>
18 <mrow><mi>π</mi></mrow>
19 <mrow><mn>4</mn></mrow></mfrac><msup><mi>d</mi><mn>2</mn></msup></mrow></math>, as well as displayed math via the
20 <cite>math</cite> directive:</p>
21 <div>
22 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
23 <mtable>
24 <mtr>
25 <mtd><mi>f</mi><mo>(</mo><mi>ϵ</mi><mo>)</mo><mo>=</mo><mfrac>
26 <mrow><mn>1</mn></mrow>
27 <mrow><mn>1</mn><mo>+</mo><mo>exp</mo><mfenced open="(" close=")">
28 <mrow><mfrac>
29 <mrow><mi>ε</mi></mrow>
30 <mrow><msub><mi>k</mi><mtext>B</mtext></msub><mi>T</mi></mrow></mfrac></mrow></mfenced></mrow></mfrac></mtd></mtr></mtable></math>
31 </div>
32 <p>Content may start on the first line of the directive, e.g.</p>
33 <div>
34 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
35 <mtable>
36 <mtr>
37 <mtd><mi>N</mi><mo>=</mo><mfrac>
38 <mrow><mtext>number of apples</mtext></mrow>
39 <mrow><mn>7</mn></mrow></mfrac></mtd></mtr></mtable></math>
40 </div>
41 <p>Equations can be labeled with a reference name using the <span class="docutils literal">:name:</span> option.
42 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>
43 <p>The determinant of the matrix</p>
44 <div id="eq-m">
45 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
46 <mtable>
47 <mtr>
48 <mtd><mstyle fontweight="bold">
49 <mrow><mi>M</mi></mrow></mstyle><mo>=</mo><mfenced open="(" close=")">
50 <mrow>
51 <mtable>
52 <mtr>
53 <mtd><mi>a</mi></mtd>
54 <mtd><mi>b</mi></mtd></mtr>
55 <mtr>
56 <mtd><mi>c</mi></mtd>
57 <mtd><mi>d</mi></mtd></mtr></mtable></mrow></mfenced></mtd></mtr></mtable></math>
58 </div>
59 <p>is <math xmlns="http://www.w3.org/1998/Math/MathML">
60 <mrow><mo>|</mo><mstyle fontweight="bold">
61 <mrow><mi>M</mi></mrow></mstyle><mo>|</mo><mo>=</mo><mi>a</mi><mi>d</mi><mo>-</mo><mi>b</mi><mi>c</mi></mrow></math>.</p>
62 <p>More than one display math block can be put in one math directive.
63 For example, the following sum and integral with limits:</p>
64 <div>
65 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
66 <mtable>
67 <mtr>
68 <mtd><munderover><mo></mo><mn>0</mn><mn>1</mn></munderover><msup><mi>x</mi><mi>n</mi></msup><mi>d</mi><mi>x</mi><mo>=</mo><mfrac>
69 <mrow><mn>1</mn></mrow>
70 <mrow><mi>n</mi><mo>+</mo><mn>1</mn></mrow></mfrac></mtd></mtr></mtable></math>
71 </div>
72 <div>
73 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
74 <mtable>
75 <mtr>
76 <mtd><munderover><mo></mo>
77 <mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><mi>m</mi></munderover><mi>n</mi><mo>=</mo><mfrac>
78 <mrow><mi>m</mi><mo>(</mo><mi>m</mi><mo>+</mo><mn>1</mn><mo>)</mo></mrow>
79 <mrow><mn>2</mn></mrow></mfrac></mtd></mtr></mtable></math>
80 </div>
81 <p>LaTeX-supported Unicode math symbols can be used in math roles and
82 directives:</p>
83 <p>The Schrödinger equation</p>
84 <div id="eq-schrodinger">
85 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
86 <mtable>
87 <mtr>
88 <mtd><mi>i</mi><mi></mi><mfrac>
89 <mrow><mo></mo></mrow>
90 <mrow><mo></mo><mi>t</mi></mrow></mfrac><mo>Ψ</mo><mo>=</mo><mover>
91 <mrow><mi>H</mi></mrow><mo>^</mo></mover><mo>Ψ</mo><mo>,</mo></mtd></mtr></mtable></math>
92 </div>
93 <p>with the <em>wave function</em> <math xmlns="http://www.w3.org/1998/Math/MathML">
94 <mrow><mo>Ψ</mo></mrow></math>, describes how the quantum state of a
95 physical system changes in time.</p>
96 <dl>
97 <dt>Math-Accents:</dt>
98 <dd><table class="colwidths-given borderless">
99 <colgroup>
100 <col style="width: 33%" />
101 <col style="width: 33%" />
102 <col style="width: 33%" />
103 </colgroup>
104 <tbody>
105 <tr><td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
106 <mrow><mover>
107 <mrow><mi>a</mi></mrow><mo>´</mo></mover></mrow></math> <span class="docutils literal">\acute{a}</span></p></td>
108 <td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
109 <mrow><mover>
110 <mrow><mi>t</mi></mrow><mo>˙</mo></mover></mrow></math> <span class="docutils literal">\dot{t}</span></p></td>
111 <td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
112 <mrow><mover>
113 <mrow><mi>γ</mi></mrow><mo>^</mo></mover></mrow></math> <span class="docutils literal"><span class="pre">\hat{\gamma}</span></span></p></td>
114 </tr>
115 <tr><td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
116 <mrow><mover>
117 <mrow><mi>a</mi></mrow><mo>`</mo></mover></mrow></math> <span class="docutils literal">\grave{a}</span></p></td>
118 <td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
119 <mrow><mover>
120 <mrow><mi>t</mi></mrow><mo>¨</mo></mover></mrow></math> <span class="docutils literal">\ddot{t}</span></p></td>
121 <td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
122 <mrow><mover>
123 <mrow><mi>α</mi></mrow><mo>˜</mo></mover></mrow></math> <span class="docutils literal"><span class="pre">\tilde{\alpha}</span></span></p></td>
124 </tr>
125 <tr><td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
126 <mrow><mover>
127 <mrow><mi>x</mi></mrow><mo>˘</mo></mover></mrow></math> <span class="docutils literal">\breve{x}</span></p></td>
128 <td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
129 <mrow><mover>
130 <mrow><mi>t</mi></mrow><mo></mo></mover></mrow></math> <span class="docutils literal">\dddot{t}</span></p></td>
131 <td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
132 <mrow><mover>
133 <mrow><mi>ı</mi></mrow><mo></mo></mover></mrow></math> <span class="docutils literal"><span class="pre">\vec{\imath}</span></span></p></td>
134 </tr>
135 <tr><td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
136 <mrow><mover>
137 <mrow><mi>a</mi></mrow><mo>ˇ</mo></mover></mrow></math> <span class="docutils literal">\check{a}</span></p></td>
138 <td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
139 <mrow><mover>
140 <mrow><mi>a</mi></mrow><mo>¯</mo></mover></mrow></math> <span class="docutils literal">\bar{a}</span></p></td>
141 <td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
142 <mrow><mover>
143 <mrow><mi>R</mi></mrow><mo></mo></mover></mrow></math> <span class="docutils literal">\vec{R}</span></p></td>
144 </tr>
145 </tbody>
146 </table>
147 </dd>
148 </dl>
149 <!-- \widetilde{xxx}
150 \widehat{xxx} -->
151 <p>Modulation Transfer Function:</p>
152 <div>
153 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
154 <mtable>
155 <mtr>
156 <mtd><mtext>MTF</mtext><mo>=</mo><mfenced open="|" close="|">
157 <mrow><mfrac>
158 <mrow><mi></mi><mo>{</mo><mi>s</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>}</mo></mrow>
159 <mrow><mi></mi><mo>{</mo><mi>s</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>}</mo><msub><mo>|</mo>
160 <mrow><msub><mi>ω</mi>
161 <mrow><mi>x</mi></mrow></msub><mo>=</mo><mn>0</mn></mrow></msub></mrow></mfrac></mrow></mfenced><mo>=</mo><mtext>abs</mtext><mfenced open="(" close=")">
162 <mrow><mfrac>
163 <mrow><munderover><mo></mo>
164 <mrow><mo>-</mo><mo></mo></mrow>
165 <mrow><mo></mo></mrow></munderover><mi>s</mi><mo>(</mo><mi>x</mi><mo>)</mo><msup><mtext>e</mtext>
166 <mrow><mtext>i</mtext><msub><mi>ω</mi>
167 <mrow><mi>x</mi></mrow></msub><mi>x</mi></mrow></msup><mtext>d</mtext>
168 <mrow><mi>x</mi></mrow></mrow>
169 <mrow><munderover><mo></mo>
170 <mrow><mo>-</mo><mo></mo></mrow>
171 <mrow><mo></mo></mrow></munderover><mi>s</mi><mo>(</mo><mi>x</mi><mo>)</mo><mtext>d</mtext>
172 <mrow><mi>x</mi></mrow></mrow></mfrac></mrow></mfenced><mo>.</mo></mtd></mtr></mtable></math>
173 </div>
174 <p>Math split over two lines: If a double backslash is detected outside a
175 <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>
176 <span class="docutils literal">align</span> environment:</p>
177 <div>
178 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
179 <mtable>
180 <mtr>
181 <mtd><msub><mi>s</mi>
182 <mrow><mtext>out</mtext></mrow></msub><mo>(</mo><mi>x</mi><mo>)</mo></mtd>
183 <mtd><mo>=</mo><msub><mi>s</mi>
184 <mrow><mtext>in</mtext></mrow></msub><mo>(</mo><mi>x</mi><mo>'</mo><mo>)</mo><mo>*</mo><msub><mi>s</mi><mi>δ</mi></msub><mo>(</mo><mi>x</mi><mo>-</mo><mi>x</mi><mo>'</mo><mo>)</mo></mtd></mtr>
185 <mtr>
186 <mtd></mtd>
187 <mtd><mo>=</mo><mo></mo><msub><mi>s</mi>
188 <mrow><mtext>in</mtext></mrow></msub><mo>(</mo><mi>x</mi><mo>'</mo><mo>)</mo><msub><mi>s</mi><mi>δ</mi></msub><mo>(</mo><mi>x</mi><mo>-</mo><mi>x</mi><mo>'</mo><mo>)</mo><mtext>d</mtext><mi>x</mi><mo>'</mo></mtd></mtr></mtable></math>
189 </div>
190 <p>Cases (&quot;manually&quot;, with <span class="docutils literal">matrix</span> environment):</p>
191 <div>
192 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
193 <mtable>
194 <mtr>
195 <mtd><mtext>sgn</mtext><mo>(</mo><mi>x</mi><mo>)</mo><mo>=</mo><mfenced open="{" close="">
196 <mrow>
197 <mtable>
198 <mtr>
199 <mtd><mo>-</mo><mn>1</mn></mtd>
200 <mtd><mi>x</mi><mo>&lt;</mo><mn>0</mn></mtd></mtr>
201 <mtr>
202 <mtd><mn>1</mn></mtd>
203 <mtd><mi>x</mi><mo>&gt;</mo><mn>0</mn></mtd></mtr></mtable></mrow></mfenced></mtd></mtr></mtable></math>
204 </div>
205 <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 (not (yet) supported by
206 HTML writers with <span class="docutils literal"><span class="pre">--math-output=MathML</span></span>):</p>
207 <div class="system-message">
208 <p class="system-message-title">System Message: ERROR/3 (<span class="docutils literal">functional/input/data/math.txt</span>, line 108)</p>
210 Environment not supported! Supported environment: "matrix".</p>
211 <pre class="literal-block">
212 \mathrm{sgn}(x) = \begin{cases}
213 -1 &amp; x&lt;0\\
214 1 &amp; x&gt;0
215 \end{cases}
216 </pre>
217 </div>
218 </div>
219 </body>
220 </html>