<!DOCTYPE section SYSTEM "xml2lms.dtd">
<section id="formula">
<title>Mathematical formulas</title>
<demo>
<p>
This section shows the use of mathematical formulas.
</p>
</demo>
<subsection>
<title>Prime numbers</title>
<p>
We start with a definition. There is no extra element for it, we
use the <term>remark</term> element with class <term>definition</term>:
</p>
<slide id="slide:defprime">
<title>Defintion of prime numbers</title>
<remark class="definition">
<title>Prime number</title>
<p>
A positive integer is <term>prime</term>, if it has exactly two dividors:
</p>
<eq>
<![CDATA[
\text{$p$ is prime}\, \Leftrightarrow\,\forall i = 2\ldots p-1:\, i\not|p
]]>
</eq>
</remark>
</slide>
<p>
For a theorem, we use a <term>remark</term> element with class 
<term>theorem</term>. We put it also on a slide:
</p>
<slide id="slide:primenumthm">
<title>Amount of Prime Numbers</title>
<remark class="theorem">
<title>Prime number theorem</title>
<p>
The amount of prime numbers <m>\Pi(n)</m> up to a number <m>n</m> is
approximately:
</p>
<eq id="primeNumberThm">
\Pi(n) \approx \frac{n}{\ln n}
</eq>
</remark>
</slide>
<p>
For inline formula use the element <term>m</term> (see slide
<ref id="slide:primenumthm"/>). The element <term>eq</term> is used
for block formulas. With class <term>align</term> multiline formulas
are possible:
</p>
<eq class="align" id="m:fibonacci">
<![CDATA[
x_0 &= 1\\
x_1 &= 1\\
x_{n} &= x_{n-1}+x_{n-2} & n &= 2,\ldots
]]>
</eq>
<p>
The <term>CDATA</term> declaration is necessary to protect the &amp; signs.
If you add the <term>id</term> attribute, you can set a reference to this
formula <ref id="m:fibonacci"/>.
</p>
</subsection>
</section>
