<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="lmlmetahover.css" type="text/css" title="LML default" ?>
<?xml-stylesheet href="lmlBase.css" type="text/css" title="LML meta off" alternate="yes" ?>
<?xml-stylesheet href="lmlmetastatic.css" type="text/css" title="LML meta on" alternate="yes" ?>
<literature version="1.0" 
xmlns="http://purl.oclc.org/net/hoffmann/lml/"
xmlns:xlink="http://www.w3.org/1999/xlink" 
xml:lang="en">
<meta>
<title>Math Sample</title>
<desc>
<p> An example how to use mathematics in the literature markup language
by <creator>Dr. Olaf Hoffmann</creator>,
<created>2008-10-26</created>.</p>
</desc>
<genre>report sample</genre>
<tune>neutral</tune>
<impressum>
<address>
<l>Dr. Olaf Hoffmann</l>
<l>Appelstraße 2</l>
<l>30167 Hannover</l>
<l>Deutschland/Germany</l>
<l />
<l>email:
&#100;&#114;&#46;&#111;&#46;&#104;&#111;&#102;&#102;&#109;&#97;&#110;&#110;&#64;&#103;&#109;&#120;&#46;&#100;&#101;
</l>
</address>
</impressum>
</meta>

<prosa>
<h> Samples for the usage of  <abbr><meta><desc>Mathematical Markup Language</desc></meta>MathML</abbr> 
in <abbr><meta><desc>Literature Markup Language</desc></meta>LML</abbr></h>

<s>
<h>General remarks</h>
<p>
The elements <el>eq</el> and <el>beq</el> can be used to contain equations or mathematical
formulas, <el>eq</el> is for simpler inline content, <el>beq</el> for block content.
For simple formulas <abbr>LML</abbr> can be used directly, for more advanced structures <abbr>MathML</abbr>
should be better applicable and if required it can be simpler copied into other contexts without losing some
information and without further transformations.<br />
Note, that the <el>link</el> element can be used as well to reference or to embed other content into 
<el>eq</el> and <el>beq</el>, for example using <code><var>XLink:show</var>="<val>embed</val>"</code> to embed another document containing maths.
</p>
</s>

<s>
<h>Simple <el>eq</el> samples</h>

<p>
Simple formulas, equations and expression can be expressed in <abbr>LML</abbr> directly:
</p>
<s>
<name>Albert Einstein</name> found a relation between energy <var>E</var>, mass <var>m</var>
and the velocity of light <var>c</var>:<br />
<eq><var>E</var> = <var>m</var> <var>c</var><sup>2</sup></eq> 
</s>

<p>
The same using <abbr>MathML</abbr>:
</p>

<s>
<name>Albert Einstein</name> found a relation between energy <var>E</var>, mass <var>m</var>
and the velocity of light <var>c</var>:<br />


<eq><math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow>
  <mi>E</mi>
  <mo>=</mo>
  <mi>m</mi>
  <msup>
    <mi>c</mi>
    <mn>2</mn>
  </msup>
</mrow>
</math>
</eq> 
</s>


</s>

<s>
<h><el>beq</el> and <abbr>MathML</abbr> sample</h>

<p>
<abbr>MathML</abbr> can contain some text as well. If the text belongs directly to the mathematical
expression, it is obviously useful to markup this text fragment with <abbr>MathML</abbr> as well.
Because the text itself can have some semantical meaning too, the attribute role can be used to provide
this functionality. Authors can optimise this mixture depending on each application.
</p>
<p>
One general problem can be, that the predefined entities of <abbr>MathML</abbr> are ignored.
Authors can look into the <abbr>MathML</abbr> recommendation to identify the related unicode as
a replacement. Alternatively the entity definitions can be added to a doctype declaration of the
document.
</p>
<p>
Sample:
</p>

<s>
<beq>
<math xmlns="http://www.w3.org/1998/Math/MathML">

  <mtext>
  Let 
 </mtext>
<mspace linebreak="newline" /> 
<mrow>
<mo> ( </mo>
  <mi> x</mi>
  <mo><!-- &ApplyFunction; --></mo>
  <mrow>
    <mo>(</mo>
      <mi>t</mi>
    <mo>)</mo>
  </mrow> 
  <mo> , </mo>
  <mi> y</mi>
  <mo><!-- &ApplyFunction; --></mo>
  <mrow>
    <mo>(</mo>
      <mi>t</mi>
    <mo>) </mo>
  </mrow>  
<mo> ) </mo>
</mrow>
<mspace linebreak="newline" /> 
<mtext>
  be a path in a plane with the parameter
  <mi> t </mi> from <mn>0</mn> to
  <mn>1</mn>, then the path length is:
  </mtext>

<mspace linebreak="newline" /> 

<mrow>
  <mi>L</mi>
  <mo>=</mo>
  <msubsup>
    <mo>&#8747;<!-- &int; --></mo>
    <mn>0</mn>
    <mn>1</mn>
  </msubsup>
  <msqrt>
    <msup>
      <mrow>
        <mo>(</mo>
        <mfrac>
          <mi>dx</mi>
          <mi>dt</mi>
        </mfrac>
        <mo>)</mo>
      </mrow>
      <mn>2</mn>
    </msup>
    <mo>+</mo>
    <msup>
      <mrow>
        <mo>(</mo>
        <mfrac>
          <mi>dy</mi>
          <mi>dt</mi>
        </mfrac>
        <mo>)</mo>
      </mrow>
      <mn>2</mn>
    </msup>
  </msqrt>
  <mi>dt</mi>
</mrow>
</math>
</beq>
</s>

</s>

</prosa>

</literature>
