File: math_output_latex.html

package info (click to toggle)
python-docutils 0.8.1-8
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 7,604 kB
  • sloc: python: 38,189; lisp: 7,807; sh: 142; makefile: 136; xml: 6
file content (144 lines) | stat: -rw-r--r-- 5,415 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.8.1: http://docutils.sourceforge.net/" />
<title>Mathematics</title>
<link rel="stylesheet" href="../../../docutils/writers/html4css1/html4css1.css" type="text/css" />
</head>
<body>
<div class="document" id="mathematics">
<h1 class="title">Mathematics</h1>

<p>Docutils supports inline math with the prefix or postfix <tt class="docutils literal">:math:</tt>
role specificator, <tt class="math">
n! + \sin(x_n^2)</tt>
 and <tt class="math">
A_\text{c} =
\frac{\pi}{4} d^2</tt>
, as well as displayed math via the
<cite>math</cite> directive:</p>
<pre class="math">
f(\epsilon) = \frac{1}{1 + \exp\left(\frac{\varepsilon}{k_\text{B}T}\right)}
</pre>
<p>Content may start on the first line of the directive, e.g.</p>
<pre class="math">
N = \frac{\text{number of apples}}{7}
</pre>
<p>Equations can be labeled with a reference name using the <tt class="docutils literal">:name:</tt> option.
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>
<p>The determinant of the matrix</p>
<pre class="math" id="eq-m">
\mathbf{M} = \left(\begin{matrix}a&amp;b\\c&amp;d\end{matrix}\right)
</pre>
<p>is <tt class="math">
|\mathbf{M}| = ad - bc</tt>
.</p>
<p>More than one display math block can be put in one math directive.
For example, the following sum and integral with limits:</p>
<pre class="math">
\int_0^1 x^n dx = \frac{1}{n + 1}
</pre>
<pre class="math">
\sum_{n=1}^m n = \frac{m(m+1)}{2}
</pre>
<p>LaTeX-supported Unicode math symbols can be used in math roles and
directives:</p>
<p>The Schrödinger equation</p>
<pre class="math" id="eq-schrodinger">
i\hbar \frac{\partial }{\partial t}\Psi  = \hat{H}\Psi ,
</pre>
<p>with the <em>wave function</em> <tt class="math">
\Psi </tt>
, describes how the quantum state of a
physical system changes in time.</p>
<dl class="docutils">
<dt>Math-Accents:</dt>
<dd><table border="1" class="borderless first last docutils">
<colgroup>
<col width="33%" />
<col width="33%" />
<col width="33%" />
</colgroup>
<tbody valign="top">
<tr><td><tt class="math">
\acute{a}</tt>
      <tt class="docutils literal">\acute{a}</tt></td>
<td><tt class="math">
\dot{t}</tt>
        <tt class="docutils literal">\dot{t}</tt></td>
<td><tt class="math">
\hat{\gamma}</tt>
   <tt class="docutils literal"><span class="pre">\hat{\gamma}</span></tt></td>
</tr>
<tr><td><tt class="math">
\grave{a}</tt>
      <tt class="docutils literal">\grave{a}</tt></td>
<td><tt class="math">
\ddot{t}</tt>
       <tt class="docutils literal">\ddot{t}</tt></td>
<td><tt class="math">
\tilde{\alpha}</tt>
 <tt class="docutils literal"><span class="pre">\tilde{\alpha}</span></tt></td>
</tr>
<tr><td><tt class="math">
\breve{x}</tt>
      <tt class="docutils literal">\breve{x}</tt></td>
<td><tt class="math">
\dddot{t}</tt>
      <tt class="docutils literal">\dddot{t}</tt></td>
<td><tt class="math">
\vec{\imath}</tt>
   <tt class="docutils literal"><span class="pre">\vec{\imath}</span></tt></td>
</tr>
<tr><td><tt class="math">
\check{a}</tt>
      <tt class="docutils literal">\check{a}</tt></td>
<td><tt class="math">
\bar{a}</tt>
        <tt class="docutils literal">\bar{a}</tt></td>
<td><tt class="math">
\vec{R}</tt>
        <tt class="docutils literal">\vec{R}</tt></td>
</tr>
</tbody>
</table>
</dd>
</dl>
<!-- \widetilde{xxx}
\widehat{xxx} -->
<p>Modulation Transfer Function:</p>
<pre class="math">
\text{MTF} = \left|\frac{\mathcal{F}\{s(x)\}}
                        {\mathcal{F}\{ s(x)\} |_{\omega _{x}=0}}\right|
           = \mathrm{abs}\left(\frac
                 {\int _{-\infty }^{\infty }s(x) \mathrm{e}^{\mathrm{i}\omega _{x}x}\mathrm{d}{x}}
                 {\int _{-\infty }^{\infty }s(x)\mathrm{d}{x}}
             \right).
</pre>
<p>Math split over two lines: If a double backslash is detected outside a
<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>
<tt class="docutils literal">align</tt> environment:</p>
<pre class="math">
s_{\mathrm{out}}(x) &amp; = s_{\mathrm{in}}(x') * s_\delta (x-x') \\
                    &amp; = \int  s_{\mathrm{in}}(x')s_\delta (x-x')\mathrm{d}x'
</pre>
<p>Cases (&quot;manually&quot;, with <tt class="docutils literal">matrix</tt> environment):</p>
<pre class="math">
\mathrm{sgn}(x) = \left\{\begin{matrix}
                    -1 &amp; x&lt;0\\
                    1 &amp; x&gt;0
                  \end{matrix}\right.
</pre>
<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
HTML writers with <tt class="docutils literal"><span class="pre">--math-output=MathML</span></tt>):</p>
<pre class="math">
\mathrm{sgn}(x) = \begin{cases}
                    -1 &amp; x&lt;0\\
                     1 &amp; x&gt;0
                  \end{cases}
</pre>
</div>
</body>
</html>