The structure of MathDox documents

In MathDox, we use Docbook to define the structure of a document. This is explained in the following examples.

Example 1. 


<book>
  <title>MathDox</title>
</book>

A small MathDox document is shown above. It is just a DocBook <book/> tag containing an empty <title/> tag and nothing more. This document can be made more meaningful by adding DocBook,OpenMath, XForms, Jelly, Monet or XInclude tags. This is shown in the next few steps. Feel free to experiment with any of the tags of the included, and previously named, XML-formats.


Example 2. 


<article>
  <title>MathDox</title>
  <subtitle>A tutorial</subtitle>
  <chapter>
    <title>Examples</title>
    <para>This is a small MathDox example.</para>
  </chapter>
</article>

In this example some more DocBook tags have been added. The title, subtitle and chapter are self-explanatory. The para tag is a tag for paragraphs.


Docbook offers a whole range of tags to be used. We refer the reader to "DocBook 5.0: The Definitive Guide" .

As DocBook does not support mathematics, we have extended DocBook with some structure elements for mathematical text like <assertion/> and <proof/>.

Furthermore, we allow various other formats to be included in the DocBook structure, which take care of the interactivity inside our MathDox documents. Each of these formats appears in its own name space.

These name spaces include:

  • http://www.mathdox.org/MathBook/Macro

  • http://www.mathdox.org/MathBook/Query

  • http://www.mathdox.org/MathDox/Functions

  • http://www.mathdox.org/MathBook/Context

  • http://www.openmath.org/OpenMath

  • http://monet.nag.co.uk/monet/ns

  • jelly:core

  • jelly:xml

  • jelly:org.mathdox.util.UtilLibrary

  • http://www.w3.org/2002/xforms

  • http://www.w3.org/1999/xhtml

The name spaces used in a document are usually declared in the root of the document.

Example 3. 


<book xmlns:c="jelly:core"
      xmlns:x="jelly:xml"
      xmlns:cont="http://www.mathdox.org/MathBook/Context"
      xmlns:monet="http://monet.nag.co.uk/monet/ns"
      xmlns:om="http://www.openmath.org/OpenMath"
      xmlns:xforms="http://www.w3.org/2002/xforms"
      xmlns:xhtml="http://www.w3.org/2002/xhtml"
      xmlns:mdu="jelly:org.mathdox.util.UtilLibrary">

  <title>Example with name spaces</title>
  <mdu:random var="r" minimum="1" maximum="4"/>   

  <para>
    OpenMath elements are in the OpneMath name space
    <om:OMI><c:out var=""/></om:OMI>.   
  </para>

  <para>

  </para>
</book>

Some examples

In this section we give some examples of how certain things can be entered using DocBook.

Example 4. Adding images

In DocBook images are entered using mediaobject and imageobject tags (or using inlinemediaobject for an inline image).

Below is an example of a jpg-image.

        
  <mediaobject>
    <alt>Example picture</alt>
    <imageobject>
      <imagedata fileref='manual-images/Whitehead.jpg' format='JPG'/>
    </imageobject>
    <textobject>
      <phrase>Seifert surface of Whitehead link</phrase>
    </textobject>
  </mediaobject>
	
      

The result is shown below:

Seifert surface of Whitehead link

For more information (including adding captions) see the DocBook 5.0: The Definitive Guide section on imageobject.