math update
[docutils.git] / test / functional / expected / math_output_mathml.xhtml
blob1e949a0a592f6696588dbd559c392a9dcfda51ac
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="application/xhtml+xml; 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, <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>A display formula can also be given as directive argument, 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>The determinant of the matrix</p>
42 <div>
43 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
44 <mtable>
45 <mtr>
46 <mtd><mstyle fontweight="bold">
47 <mrow><mi>M</mi></mrow></mstyle><mo>=</mo><mfenced open="(" close=")">
48 <mrow>
49 <mtable>
50 <mtr>
51 <mtd><mi>a</mi></mtd>
52 <mtd><mi>b</mi></mtd></mtr>
53 <mtr>
54 <mtd><mi>c</mi></mtd>
55 <mtd><mi>d</mi></mtd></mtr></mtable></mrow></mfenced></mtd></mtr></mtable></math>
56 </div>
57 <p>is <math xmlns="http://www.w3.org/1998/Math/MathML">
58 <mrow><mo>|</mo><mstyle fontweight="bold">
59 <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>
60 <p>More than one display math block can be put in one math directive.
61 For example, the following sum and integral with limits:</p>
62 <div>
63 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
64 <mtable>
65 <mtr>
66 <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>
67 <mrow><mn>1</mn></mrow>
68 <mrow><mi>n</mi><mo>+</mo><mn>1</mn></mrow></mfrac></mtd></mtr></mtable></math>
69 </div>
70 <div>
71 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
72 <mtable>
73 <mtr>
74 <mtd><munderover><mo></mo>
75 <mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><mi>m</mi></munderover><mi>n</mi><mo>=</mo><mfrac>
76 <mrow><mi>m</mi><mo>(</mo><mi>m</mi><mo>+</mo><mn>1</mn><mo>)</mo></mrow>
77 <mrow><mn>2</mn></mrow></mfrac></mtd></mtr></mtable></math>
78 </div>
79 <p>LaTeX-supported Unicode math symbols can be used in math roles and
80 directives:</p>
81 <p>The Schrödinger equation</p>
82 <div>
83 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
84 <mtable>
85 <mtr>
86 <mtd><mi>i</mi><mo></mo><mfrac>
87 <mrow><mo></mo></mrow>
88 <mrow><mo></mo><mi>t</mi></mrow></mfrac><mo>Ψ</mo><mo>=</mo><mover>
89 <mrow><mi>H</mi></mrow><mo>^</mo></mover><mo>Ψ</mo><mo>,</mo></mtd></mtr></mtable></math>
90 </div>
91 <p>with the <em>wave function</em> <math xmlns="http://www.w3.org/1998/Math/MathML">
92 <mrow><mo>Ψ</mo></mrow></math>, describes how the quantum state of a
93 physical system changes in time.</p>
94 <dl class="docutils">
95 <dt>Math-Accents:</dt>
96 <dd><table border="1" class="borderless first last docutils">
97 <colgroup>
98 <col width="33%" />
99 <col width="33%" />
100 <col width="33%" />
101 </colgroup>
102 <tbody valign="top">
103 <tr><td><math xmlns="http://www.w3.org/1998/Math/MathML">
104 <mrow><mover>
105 <mrow><mi>a</mi></mrow><mo>´</mo></mover></mrow></math> <tt class="docutils literal">\acute{a}</tt></td>
106 <td><math xmlns="http://www.w3.org/1998/Math/MathML">
107 <mrow><mover>
108 <mrow><mi>t</mi></mrow><mo>˙</mo></mover></mrow></math> <tt class="docutils literal">\dot{t}</tt></td>
109 <td><math xmlns="http://www.w3.org/1998/Math/MathML">
110 <mrow><mover>
111 <mrow><mi>γ</mi></mrow><mo>^</mo></mover></mrow></math> <tt class="docutils literal"><span class="pre">\hat{\gamma}</span></tt></td>
112 </tr>
113 <tr><td><math xmlns="http://www.w3.org/1998/Math/MathML">
114 <mrow><mover>
115 <mrow><mi>a</mi></mrow><mo>`</mo></mover></mrow></math> <tt class="docutils literal">\grave{a}</tt></td>
116 <td><math xmlns="http://www.w3.org/1998/Math/MathML">
117 <mrow><mover>
118 <mrow><mi>t</mi></mrow><mo>¨</mo></mover></mrow></math> <tt class="docutils literal">\ddot{t}</tt></td>
119 <td><math xmlns="http://www.w3.org/1998/Math/MathML">
120 <mrow><mover>
121 <mrow><mi>α</mi></mrow><mo>˜</mo></mover></mrow></math> <tt class="docutils literal"><span class="pre">\tilde{\alpha}</span></tt></td>
122 </tr>
123 <tr><td><math xmlns="http://www.w3.org/1998/Math/MathML">
124 <mrow><mover>
125 <mrow><mi>x</mi></mrow><mo>˘</mo></mover></mrow></math> <tt class="docutils literal">\breve{x}</tt></td>
126 <td><math xmlns="http://www.w3.org/1998/Math/MathML">
127 <mrow><mover>
128 <mrow><mi>t</mi></mrow><mo></mo></mover></mrow></math> <tt class="docutils literal">\dddot{t}</tt></td>
129 <td><math xmlns="http://www.w3.org/1998/Math/MathML">
130 <mrow><mover>
131 <mrow><mi>ı</mi></mrow><mo></mo></mover></mrow></math> <tt class="docutils literal"><span class="pre">\vec{\imath}</span></tt></td>
132 </tr>
133 <tr><td><math xmlns="http://www.w3.org/1998/Math/MathML">
134 <mrow><mover>
135 <mrow><mi>a</mi></mrow><mo>ˇ</mo></mover></mrow></math> <tt class="docutils literal">\check{a}</tt></td>
136 <td><math xmlns="http://www.w3.org/1998/Math/MathML">
137 <mrow><mover>
138 <mrow><mi>a</mi></mrow><mo>¯</mo></mover></mrow></math> <tt class="docutils literal">\bar{a}</tt></td>
139 <td><math xmlns="http://www.w3.org/1998/Math/MathML">
140 <mrow><mover>
141 <mrow><mi>R</mi></mrow><mo></mo></mover></mrow></math> <tt class="docutils literal">\vec{R}</tt></td>
142 </tr>
143 </tbody>
144 </table>
145 </dd>
146 </dl>
147 <!-- \widetilde{xxx}
148 \widehat{xxx} -->
149 <p>Modulation Transfer Function:</p>
150 <div>
151 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
152 <mtable>
153 <mtr>
154 <mtd><mtext>MTF</mtext><mo>=</mo><mfenced open="|" close="|">
155 <mrow><mfrac>
156 <mrow><mi></mi><mo>{</mo><mi>s</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>}</mo></mrow>
157 <mrow><mi></mi><mo>{</mo><mi>s</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>}</mo><msub><mo>|</mo>
158 <mrow><msub><mi>ω</mi>
159 <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=")">
160 <mrow><mfrac>
161 <mrow><munderover><mo></mo>
162 <mrow><mo>-</mo><mo></mo></mrow>
163 <mrow><mo></mo></mrow></munderover><mi>s</mi><mo>(</mo><mi>x</mi><mo>)</mo><msup><mtext>e</mtext>
164 <mrow><mtext>i</mtext><msub><mi>ω</mi>
165 <mrow><mi>x</mi></mrow></msub><mi>x</mi></mrow></msup><mtext>d</mtext>
166 <mrow><mi>x</mi></mrow></mrow>
167 <mrow><munderover><mo></mo>
168 <mrow><mo>-</mo><mo></mo></mrow>
169 <mrow><mo></mo></mrow></munderover><mi>s</mi><mo>(</mo><mi>x</mi><mo>)</mo><mtext>d</mtext>
170 <mrow><mi>x</mi></mrow></mrow></mfrac></mrow></mfenced><mo>.</mo></mtd></mtr></mtable></math>
171 </div>
172 <p>Math split over two lines: If a double backslash is detected outside a
173 <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>
174 <tt class="docutils literal">align</tt> environment:</p>
175 <div>
176 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
177 <mtable>
178 <mtr>
179 <mtd><msub><mi>s</mi>
180 <mrow><mtext>out</mtext></mrow></msub><mo>(</mo><mi>x</mi><mo>)</mo></mtd>
181 <mtd><mo>=</mo><msub><mi>s</mi>
182 <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>
183 <mtr>
184 <mtd></mtd>
185 <mtd><mo>=</mo><mo></mo><msub><mi>s</mi>
186 <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>
187 </div>
188 <p>Cases (&quot;manually&quot;, with <tt class="docutils literal">matrix</tt> environment):</p>
189 <div>
190 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
191 <mtable>
192 <mtr>
193 <mtd><mtext>sgn</mtext><mo>(</mo><mi>x</mi><mo>)</mo><mo>=</mo><mfenced open="{" close="">
194 <mrow>
195 <mtable>
196 <mtr>
197 <mtd><mo>-</mo><mn>1</mn></mtd>
198 <mtd><mi>x</mi><mo>&lt;</mo><mn>0</mn></mtd></mtr>
199 <mtr>
200 <mtd><mn>1</mn></mtd>
201 <mtd><mi>x</mi><mo>&gt;</mo><mn>0</mn></mtd></mtr></mtable></mrow></mfenced></mtd></mtr></mtable></math>
202 </div>
203 <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
204 HTML writers with <tt class="docutils literal"><span class="pre">--math-output=MathML</span></tt>):</p>
205 <div class="system-message">
206 <p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">functional/input/data/math.txt</tt>, line 102)</p>
208 Environment not supported! Supported environment: "matrix".</p>
209 <pre class="literal-block">
210 \mathrm{sgn}(x) = \begin{cases}
211 -1 &amp; x&lt;0\\
212 1 &amp; x&gt;0
213 \end{cases}
214 </pre>
215 </div>
216 </div>
217 </body>
218 </html>