<?xml version="1.0" encoding="UTF-8"?>
<text>
    <author>Thomas Zastrow</author>
    <maintitle>Using MathML in st stylesheets</maintitle>
    <basefont>sans-serif</basefont>
    <basefontsize>12pt</basefontsize>
    <titlepage/>
    <toc/>
    <pagenumber/>
    
    <maketitle/>
    <content>
        <h1>Introduction</h1>
        <p>
            With the help of the jEuclid<fn>http://jeuclid.sourceforge.net/usage.html</fn> library, the Apache FOP can render MathML formulas directly from XML code. 
            Unfortunately, at the moment this doesn't works. There were 
            some changes in the jEuclid library which make it incompatible with the Apache FOP. But stay tuned, I'm working on it :-).
        </p>
        <p>
            Meanwhile, you can transform MathML code with jEuclid directly on the commandline and embedd the resulting image in 
            your XML files.
        </p>
        
        <p>
        In any case, it is also a little bit complicated to write MathML-equations  manualy. To simplify this task, there are a lot of 
        MathML editors outside which can be used to create MathML code. 
        </p>        
        
        <p>
        Once you have created MathML-code, it is simple to transfer it to SVG with jEuclid 
            into an image format. It is recommended that you use the SVG format: this is the only vector based format jEuclid can 
            produce. Vector based formats has the advantage that they can scaled without loss of quality .
            This SVG can then used in the <i>st</i> stylesheets like any graphic.
        </p>
        
    </content>
    
    <content>
        <h1>OpenOffice as MathML Editor</h1>
        <p>
            OpenOffice has a very comfortable equation editor on board. You can invoke it via the <i>Insert / Object / Formel</i><fn>
                The screenshots are showing the german version of OpenOffice</fn> menu:
            <img scale="50%">ooscreenshot1.jpg</img>
            <pagebreak/>
                Once the formula is is complete, you can export into the MathML format with a right click on it, using the point <i>"Save as"</i>
            in the content menu:
                <img scale ="80%">ooscreenshot.jpg</img>
            With the <i>mml2xxx</i> command in the <i>bin</i>-directory of the jEuclid distribution, the MathML code can converted 
            to SVG<fn>The mml2xxx command seems to have some problems with paths, for me it just works when I put the input file in 
            the same directory where the script resists</fn>:
            <np/>
            <code>mml2xxx entropy.mml entropy.svg image/svg+xml</code>
            <np/>
            where <i>entropy.mml</i> is the with OpenOffice produced MathML file and <i>entropy.svg</i> the output file in SVG. 
            The parameter <i>image/svg+xml</i> tells jEuclid that the output should be in SVG format<fn>jEuclid can produce some 
            more image formats: PNG, JPEG, X-PNG VND.WAP.WBMP and BMP </fn>.
            The result can be embedded in an <i>st</i> XML file:
            <np/>
            <code>
            &lt;img&gt;entropy.svg&lt;/img&gt;
            </code>
            
        </p>        
    </content>    
    <content>
        <h1>Examples</h1>
        <p>
            The one showed above<fn>Additional, the attributes caption="Claude Elwood Shannons Entropy" and align="center" are added 
                to the img-tag</fn>:
            <img caption="Claude Elwood Shannons Entropy" align="center">entropy.svg</img>
            
            <pagebreak/>
            
            Some more example:
            <np/>
            <img caption="This has something to do with vectors ..." align="center">vector.svg</img>
            <np/>
            <img caption="Certainly, Einstein" align="center">emc.svg</img>
        </p>        
    </content>
    
</text>
