XML technologies / MathML / Converting between TEX and MathML / Converting XML+MathML to TeX / XSLT stylesheets

(Excerpt from "The MathML Handbook" by Pavi Sandhu)

As discussed under XSLT primer, XSLT transformations provide a flexible and powerful method for converting arbitrary XML data into other formats. In particular, you can use XSLT for transforming MathML equations into LaTeX. Vasil Yaroshevich has implemented this approach in the form of an XSLT MathML Library. This is a collection of six XSLT stylesheets that together specify how to translate any arbitrary presentation MathML expression into LaTeX. Currently, the stylesheets handle conversion from presentation MathML only, but support for content MathML is likely to be added in the future.

The XSLT MathML library consists of the following six stylesheets:

The templates for transforming token elements, layout schemata, scripts, tables, and entities are placed in separate stylesheets for the sake of modularity. However, for transforming a given MathML document, you only need to refer to a top-level stylesheet called mmltex.xsl. This contains commands for importing the template definitions from all the other stylesheets.

To use the XSLT MathML Library for translating MathML into LaTeX, you have two options. You can do interactive trials on the Web page set up by the author of the library (see the following figure). You can enter any MathML expression in the text area provided and then click a button to view the corresponding LaTeX markup in the same page. This is useful for translating individual equations and experimenting with how the stylesheets work.

Converting presentation MathML into LaTeX using XSLT transformations

Figure: Converting presentation MathML into LaTeX using XSLT transformations. © 2002 Vasil Yaroshevich. All rights reserved.

   

 

 

 

 

back to top