[Om] OpenMath pmml2tex.xsl bugs

David Carlisle davidc at nag.co.uk
Thu Sep 22 12:03:13 CEST 2011

On 20/09/2011 08:49, Nathaniel Dosé wrote:
> Hello,
> I was just trying out the Presentation MathML-to-TeX XSLT sheets at
> http://svn.openmath.org/OpenMath/OpenMath2++/.
> The sheets are of excellent quality, but I ran into these 2 bugs on
> my system:
> 1) at the end of pmml2tex.xsl there is a rule matching
> MathML's<math> nodes. Then, at the top of pmml2texfrag.xsl, there is
> a duplicate rule that tries to match the same. This second rule,
> which looks rather important (as it starts TeX math mode), never
> fires.
The rule is not duplicate, the one on pmml2tex is in the default mode, 
just to kick things off, then it re-applies templates to the math 
element but in the pmml2tex mode. The template matching math in 
pmml2texfrag is in the pmml2tex mode (like all other templates in that 
file) which does the actual processing.

Ah but you arr right there is a bug that \[ is being inserted by 
template matching match in pmml2tex mode but that is never being called.

> This fixed things for me:
> % diff pmml2tex.xsl~ pmml2tex.xsl 98c98 <    <xsl:apply-templates
> mode="pmml2tex"/> ---
>> <xsl:apply-templates mode="pmml2tex" select="."/>

yes that would fix it, the version at google code fixes it a different 
way, making the initial template add \[ and do some additional 
post-processing and cleanup)

> 2) pmml2texfrag.xsl generates an "\msup" in TeX everytime an<msup>
> is encountered in the MathML input.
> This leads to an 'undefined control sequence' error when processing
> the TeX output. There is no '\msup' defined anywhere - at least on my
> TeX installation.
> Using \sp (similar to how \sb is used for subscripts) solves the
> problem:
> % diff pmml2texfrag.xsl~ pmml2texfrag.xsl 333c333 <
> <xsl:text>{\msup{</xsl:text> ---
>> <xsl:text>{{</xsl:text>
> 335c335 <  <xsl:text>}{</xsl:text> ---
>> <xsl:text>}\sp{</xsl:text>
> 623c623
> Thanks and best regards,
> Nathaniel Dosé
thanks for comments.

It's probably not really announced yet (unless you count this as an
announcement) but there is a slightly newer version of that file (and
other mathml related xslt) moved to a google code repository at


Some of the code there was originally at the w3c site, some at
openmath.org, and some is new.

\msup is supposed to be defined in pmml-new.sty that is loaded by a 
\usepackage inserted by pmml2tex.xsl, this is fixed in the google code 
version, i see the old version on openmath.org (which loads pmml.sty 
rather than pmml-new.sty) appears to be missing the definition.


google plus: https:/profiles.google.com/d.p.carlisle

The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 

More information about the Om mailing list