diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/x-om2cml.xsl')
-rw-r--r-- | Master/texmf-dist/tex/context/base/x-om2cml.xsl | 67 |
1 files changed, 56 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/context/base/x-om2cml.xsl b/Master/texmf-dist/tex/context/base/x-om2cml.xsl index 4bc1818078b..4070d94dcc7 100644 --- a/Master/texmf-dist/tex/context/base/x-om2cml.xsl +++ b/Master/texmf-dist/tex/context/base/x-om2cml.xsl @@ -78,12 +78,27 @@ <!-- ****************** Basic Elements ****************** --> <!-- **************************************************** --> - <!-- OMOBJ (D. Carlisle) --> - <xsl:template match="om:OMOBJ"> - <math> - <xsl:apply-templates/> - </math> - </xsl:template> + <!-- OMOBJ (D. Carlisle) / adapted by HH --> + +<xsl:template match="om:OMOBJ"> + <xsl:choose> + <xsl:when test="@style='inline'"> + <imath> + <xsl:apply-templates/> + </imath> + </xsl:when> + <xsl:when test="@style='display'"> + <dmath> + <xsl:apply-templates/> + </dmath> + </xsl:when> + <xsl:otherwise> + <math> + <xsl:apply-templates/> + </math> + </xsl:otherwise> + </xsl:choose> +</xsl:template> <!-- OMI (D. Carlisle) --> <xsl:template match="om:OMI"> @@ -195,6 +210,20 @@ </xsl:otherwise> </xsl:choose> </xsl:when> + <xsl:when test="@name='divide'"> + <xsl:choose> + <xsl:when test="../@style='inline'"> + <xsl:attribute name='alternative'>b</xsl:attribute> + </xsl:when> + </xsl:choose> + </xsl:when> + <xsl:when test="@name='plus'"> + <xsl:choose> + <xsl:when test="../@style='empty'"> + <xsl:attribute name='alternative'>b</xsl:attribute> + </xsl:when> + </xsl:choose> + </xsl:when> <xsl:otherwise> <!-- forget about it --> </xsl:otherwise> @@ -823,7 +852,11 @@ <!-- Trivial cases: all --> <xsl:template match="om:OMS[@cd='relation1']"> - <xsl:element name="{@name}"/> + <xsl:element name="{@name}"> + <xsl:if test="../@style!=''"> + <xsl:attribute name='align'><xsl:value-of select="../@style"/></xsl:attribute> + </xsl:if> + </xsl:element> </xsl:template> <!-- Content Dictionary: setname1 --> @@ -1045,7 +1078,7 @@ <!-- Content Dictionary: altenc --> <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ --> - <!-- This CD contains: LaTeX_encoding, MathML_encoding --> + <!-- This CD contains: TeX_encoding, MathML_encoding --> <!-- Trivial cases: none --> @@ -1064,9 +1097,9 @@ </annotation-xml> </xsl:template> - <!-- LaTeX_encoding --> - <xsl:template match="om:OMS[@cd='altenc' and @name='LaTeX_encoding']"> - <annotation encoding="LaTeX"> + <!-- TeX_encoding --> + <xsl:template match="om:OMS[@cd='altenc' and @name='TeX_encoding']"> + <annotation encoding="TeX"> <xsl:value-of select="normalize-space(following::om:OMSTR)"/> </annotation> </xsl:template> @@ -1294,4 +1327,16 @@ </matrix> </xsl:template> + <!-- <OMS cd="units_siprefix1" name="centi" cdbase="mathadore"/> --> + <!-- <OMS cd="units_metric1" name="metre" cdbase="mathadore"/> --> + + <xsl:template match="om:OMS[contains(@cd,'units_')]"> + <csymbol> + <xsl:attribute name="definitionURL"> + <xsl:value-of select="concat(concat(concat(concat( + 'http://www.openmath.org/cd/mathadore','#'),@cd),'@'),@name)"/> + </xsl:attribute> + </csymbol> + </xsl:template> + </xsl:stylesheet> |