Math Sample

An example how to use mathematics in the literature markup language by Dr. Olaf Hoffmann, 2008-10-26.

report sample neutral
Dr. Olaf Hoffmann Appelstraße 2 30167 Hannover Deutschland/Germany email: dr.o.hoffmann@gmx.de
Samples for the usage of Mathematical Markup LanguageMathML in Literature Markup LanguageLML General remarks

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

Simple eq samples

Simple formulas, equations and expression can be expressed in LML directly:

Albert Einstein found a relation between energy E, mass m and the velocity of light c:
E = m c2

The same using MathML:

Albert Einstein found a relation between energy E, mass m and the velocity of light c:
$E=m{c}^{2}$
beq and MathML sample

MathML 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 MathML 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.

One general problem can be, that the predefined entities of MathML are ignored. Authors can look into the MathML recommendation to identify the related unicode as a replacement. Alternatively the entity definitions can be added to a doctype declaration of the document.

Sample:

$\text{Let}\phantom{\rule{0ex}{0ex}}\left(x\left(t\right),y\left(t\right)\right)\phantom{\rule{0ex}{0ex}}\text{be a path in a plane with the parameter t from 0 to 1, then the path length is:}\phantom{\rule{0ex}{0ex}}L={\int }_{0}^{1}\sqrt{{\left(\frac{\mathrm{dx}}{\mathrm{dt}}\right)}^{2}+{\left(\frac{\mathrm{dy}}{\mathrm{dt}}\right)}^{2}}\mathrm{dt}$