| 1 |
<?xml version='1.0' encoding="iso-8859-1"?> |
| 2 |
<xsl:stylesheet |
| 3 |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
| 4 |
xmlns:m="http://www.w3.org/1998/Math/MathML" |
| 5 |
version='1.0'> |
| 6 |
|
| 7 |
<xsl:import href="mmltex.xsl"/> |
| 8 |
|
| 9 |
<!-- because xsltproc cannot strip "m:*" elements --> |
| 10 |
<xsl:strip-space elements="m:math m:mrow m:mstyle m:mtd m:mphantom |
| 11 |
m:mi m:mo m:ms m:mn m:mtext m:maction"/> |
| 12 |
|
| 13 |
<!-- hook for mml text template --> |
| 14 |
<xsl:template name="mmltext"> |
| 15 |
<xsl:call-template name="replaceEntities"> |
| 16 |
<xsl:with-param name="content" select="normalize-space()"/> |
| 17 |
</xsl:call-template> |
| 18 |
</xsl:template> |
| 19 |
|
| 20 |
<!-- ==================================== |
| 21 |
MML TeX patches or missing templates |
| 22 |
==================================== --> |
| 23 |
|
| 24 |
<!-- to put mathml in a latex (informal) equation environment --> |
| 25 |
<xsl:template match="m:math"> |
| 26 |
<xsl:choose> |
| 27 |
<xsl:when test="ancestor::equation[not(child::title)]"> |
| 28 |
<xsl:apply-templates/> |
| 29 |
</xsl:when> |
| 30 |
<xsl:when test="ancestor::informalequation"> |
| 31 |
<xsl:text> \[ </xsl:text> |
| 32 |
<xsl:apply-templates/> |
| 33 |
<xsl:text> \] </xsl:text> |
| 34 |
</xsl:when> |
| 35 |
<xsl:otherwise> |
| 36 |
<xsl:apply-imports/> |
| 37 |
</xsl:otherwise> |
| 38 |
</xsl:choose> |
| 39 |
</xsl:template> |
| 40 |
|
| 41 |
<!-- don't know how to render this --> |
| 42 |
<xsl:template match="m:maligngroup"/> |
| 43 |
|
| 44 |
<!-- 3.3.6 --> |
| 45 |
<!-- don't know how to render this --> |
| 46 |
<xsl:template match="m:mpadded"> |
| 47 |
<xsl:apply-templates/> |
| 48 |
</xsl:template> |
| 49 |
|
| 50 |
<!-- 4.4.2.3 fn --> |
| 51 |
<xsl:template match="m:fn"> <!-- for m:fn alone --> |
| 52 |
<xsl:apply-templates/> |
| 53 |
</xsl:template> |
| 54 |
|
| 55 |
<xsl:template match="m:malignmark|m:maction"> |
| 56 |
<xsl:apply-templates/> |
| 57 |
</xsl:template> |
| 58 |
|
| 59 |
</xsl:stylesheet> |