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