Add sub-module to convert Unicode math symbols to LaTeX commands.
[docutils.git] / test / functional / expected / mathml_math.xhtml
blob3deb12dde083f7c65295c0659ec9b3cea5991fa2
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 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
22 <mtable>
23 <mtr>
24 <mtd><mi>f</mi><mo>(</mo><mi>ϵ</mi><mo>)</mo><mo>=</mo><mfrac>
25 <mrow><mn>1</mn></mrow>
26 <mrow><mn>1</mn><mo>+</mo><mo>exp</mo><mfenced open="(" close=")">
27 <mrow><mfrac>
28 <mrow><mi>ε</mi></mrow>
29 <mrow><msub><mi>k</mi><mtext>B</mtext></msub><mi>T</mi></mrow></mfrac></mrow></mfenced></mrow></mfrac></mtd></mtr></mtable></math>
30 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
31 <mtable>
32 <mtr>
33 <mtd><mi>N</mi><mo>=</mo><mfrac>
34 <mrow><mtext>number of apples</mtext></mrow>
35 <mrow><mn>7</mn></mrow></mfrac></mtd></mtr></mtable></math>
36 <p>The determinant of the matrix</p>
37 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
38 <mtable>
39 <mtr>
40 <mtd><mstyle fontweight="bold">
41 <mrow><mi>M</mi></mrow></mstyle><mo>=</mo><mfenced open="(" close=")">
42 <mrow>
43 <mtable>
44 <mtr>
45 <mtd><mi>a</mi></mtd>
46 <mtd><mi>b</mi></mtd></mtr>
47 <mtr>
48 <mtd><mi>c</mi></mtd>
49 <mtd><mi>d</mi></mtd></mtr></mtable></mrow></mfenced></mtd></mtr></mtable></math>
50 <p>is <math xmlns="http://www.w3.org/1998/Math/MathML">
51 <mrow><mo>|</mo><mstyle fontweight="bold">
52 <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>
53 <p>Sum and Integral with limits:</p>
54 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
55 <mtable>
56 <mtr>
57 <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>
58 <mrow><mn>1</mn></mrow>
59 <mrow><mi>n</mi><mo>+</mo><mn>1</mn></mrow></mfrac></mtd></mtr></mtable></math>
60 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
61 <mtable>
62 <mtr>
63 <mtd><munderover><mo></mo>
64 <mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><mi>m</mi></munderover><mi>n</mi><mo>=</mo><mfrac>
65 <mrow><mi>m</mi><mo>(</mo><mi>m</mi><mo>+</mo><mn>1</mn><mo>)</mo></mrow>
66 <mrow><mn>2</mn></mrow></mfrac></mtd></mtr></mtable></math>
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 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
71 <mtable>
72 <mtr>
73 <mtd><mi>i</mi><mo></mo><mfrac>
74 <mrow><mo></mo></mrow>
75 <mrow><mo></mo><mi>t</mi></mrow></mfrac><mo>Ψ</mo><mo>=</mo><mover>
76 <mrow><mi>H</mi></mrow><mo>^</mo></mover><mo>Ψ</mo><mo>,</mo></mtd></mtr></mtable></math>
77 <p>with the <em>wave function</em> <math xmlns="http://www.w3.org/1998/Math/MathML">
78 <mrow><mo>Ψ</mo></mrow></math>, describes how the quantum state of a
79 physical system changes in time.</p>
80 <dl class="docutils">
81 <dt>Math-Accents:</dt>
82 <dd><table border="1" class="borderless first last docutils">
83 <colgroup>
84 <col width="33%" />
85 <col width="33%" />
86 <col width="33%" />
87 </colgroup>
88 <tbody valign="top">
89 <tr><td><math xmlns="http://www.w3.org/1998/Math/MathML">
90 <mrow><mover>
91 <mrow><mi>a</mi></mrow><mo>´</mo></mover></mrow></math> <tt class="docutils literal">\acute{a}</tt></td>
92 <td><math xmlns="http://www.w3.org/1998/Math/MathML">
93 <mrow><mover>
94 <mrow><mi>t</mi></mrow><mo>˙</mo></mover></mrow></math> <tt class="docutils literal">\dot{t}</tt></td>
95 <td><math xmlns="http://www.w3.org/1998/Math/MathML">
96 <mrow><mover>
97 <mrow><mi>γ</mi></mrow><mo>^</mo></mover></mrow></math> <tt class="docutils literal"><span class="pre">\hat{\gamma}</span></tt></td>
98 </tr>
99 <tr><td><math xmlns="http://www.w3.org/1998/Math/MathML">
100 <mrow><mover>
101 <mrow><mi>a</mi></mrow><mo>`</mo></mover></mrow></math> <tt class="docutils literal">\grave{a}</tt></td>
102 <td><math xmlns="http://www.w3.org/1998/Math/MathML">
103 <mrow><mover>
104 <mrow><mi>t</mi></mrow><mo>¨</mo></mover></mrow></math> <tt class="docutils literal">\ddot{t}</tt></td>
105 <td><math xmlns="http://www.w3.org/1998/Math/MathML">
106 <mrow><mover>
107 <mrow><mi>α</mi></mrow><mo>˜</mo></mover></mrow></math> <tt class="docutils literal"><span class="pre">\tilde{\alpha}</span></tt></td>
108 </tr>
109 <tr><td><math xmlns="http://www.w3.org/1998/Math/MathML">
110 <mrow><mover>
111 <mrow><mi>x</mi></mrow><mo>˘</mo></mover></mrow></math> <tt class="docutils literal">\breve{x}</tt></td>
112 <td><math xmlns="http://www.w3.org/1998/Math/MathML">
113 <mrow><mover>
114 <mrow><mi>t</mi></mrow><mo></mo></mover></mrow></math> <tt class="docutils literal">\dddot{t}</tt></td>
115 <td><math xmlns="http://www.w3.org/1998/Math/MathML">
116 <mrow><mover>
117 <mrow><mi>ı</mi></mrow><mo></mo></mover></mrow></math> <tt class="docutils literal"><span class="pre">\vec{\imath}</span></tt></td>
118 </tr>
119 <tr><td><math xmlns="http://www.w3.org/1998/Math/MathML">
120 <mrow><mover>
121 <mrow><mi>a</mi></mrow><mo>ˇ</mo></mover></mrow></math> <tt class="docutils literal">\check{a}</tt></td>
122 <td><math xmlns="http://www.w3.org/1998/Math/MathML">
123 <mrow><mover>
124 <mrow><mi>a</mi></mrow><mo>¯</mo></mover></mrow></math> <tt class="docutils literal">\bar{a}</tt></td>
125 <td><math xmlns="http://www.w3.org/1998/Math/MathML">
126 <mrow><mover>
127 <mrow><mi>R</mi></mrow><mo></mo></mover></mrow></math> <tt class="docutils literal">\vec{R}</tt></td>
128 </tr>
129 </tbody>
130 </table>
131 </dd>
132 </dl>
133 <!-- \widetilde{xxx}
134 \widehat{xxx} -->
135 <p>Modulation Transfer Function:</p>
136 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
137 <mtable>
138 <mtr>
139 <mtd><mtext>MTF</mtext><mo>=</mo><mfenced open="|" close="|">
140 <mrow><mfrac>
141 <mrow><mi></mi><mo>{</mo><mi>s</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>}</mo></mrow>
142 <mrow><mi></mi><mo>{</mo><mi>s</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>}</mo><msub><mo>|</mo>
143 <mrow><msub><mi>ω</mi>
144 <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=")">
145 <mrow><mfrac>
146 <mrow><munderover><mo></mo>
147 <mrow><mo>-</mo><mo></mo></mrow>
148 <mrow><mo></mo></mrow></munderover><mi>s</mi><mo>(</mo><mi>x</mi><mo>)</mo><msup><mtext>e</mtext>
149 <mrow><mtext>i</mtext><msub><mi>ω</mi>
150 <mrow><mi>x</mi></mrow></msub><mi>x</mi></mrow></msup><mtext>d</mtext>
151 <mrow><mi>x</mi></mrow></mrow>
152 <mrow><munderover><mo></mo>
153 <mrow><mo>-</mo><mo></mo></mrow>
154 <mrow><mo></mo></mrow></munderover><mi>s</mi><mo>(</mo><mi>x</mi><mo>)</mo><mtext>d</mtext>
155 <mrow><mi>x</mi></mrow></mrow></mfrac></mrow></mfenced><mo>.</mo></mtd></mtr></mtable></math>
156 <p>Math split over two lines:</p>
157 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
158 <mtable>
159 <mtr>
160 <mtd><msub><mi>s</mi>
161 <mrow><mtext>out</mtext></mrow></msub><mo>(</mo><mi>x</mi><mo>)</mo></mtd>
162 <mtd><mo>=</mo><msub><mi>s</mi>
163 <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>
164 <mtr>
165 <mtd></mtd>
166 <mtd><mo>=</mo><mo></mo><msub><mi>s</mi>
167 <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>
168 <p>Cases (&quot;manually&quot;, with <tt class="docutils literal">matrix</tt> environment):</p>
169 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
170 <mtable>
171 <mtr>
172 <mtd><mtext>sgn</mtext><mo>(</mo><mi>x</mi><mo>)</mo><mo>=</mo><mfenced open="{" close="">
173 <mrow>
174 <mtable>
175 <mtr>
176 <mtd><mo>-</mo><mn>1</mn></mtd>
177 <mtd><mi>x</mi><mo>&lt;</mo><mn>0</mn></mtd></mtr>
178 <mtr>
179 <mtd><mn>1</mn></mtd>
180 <mtd><mi>x</mi><mo>&gt;</mo><mn>0</mn></mtd></mtr></mtable></mrow></mfenced></mtd></mtr></mtable></math>
181 <p>Cases with the AMSmath <tt class="docutils literal">cases</tt> environment (not (yet)
182 supported by latex2MathML):</p>
183 <div class="system-message">
184 <p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">functional/input/data/math.txt</tt>, line 103)</p>
186 Environment not supported! Supported environment: "matrix".</p>
187 <pre class="literal-block">
188 \mathrm{sgn}(x) = \begin{cases}
189 -1 &amp; x&lt;0\\
190 1 &amp; x&gt;0
191 \end{cases}
192 </pre>
193 </div>
194 </div>
195 </body>
196 </html>