<?xml version='1.0' encoding=“UTF-8”?> <xsl:stylesheet xmlns:xsl=“www.w3.org/1999/XSL/Transform

xmlns:m="http://www.w3.org/1998/Math/MathML"
version='1.0'>
<xsl:template match="m:mstyle">
  <xsl:if test="@background">
    <xsl:text>\colorbox[rgb]{</xsl:text>
    <xsl:call-template name="color">
      <xsl:with-param name="color" select="@background"/>
    </xsl:call-template>
    <xsl:text>}{$</xsl:text>
  </xsl:if>
  <xsl:if test="@color">
    <xsl:text>\textcolor[rgb]{</xsl:text>
    <xsl:call-template name="color">
      <xsl:with-param name="color" select="@color"/>
    </xsl:call-template>
    <xsl:text>}{</xsl:text>
  </xsl:if>
  <xsl:choose>
    <xsl:when test="@displaystyle='true'">
    <xsl:text>{\displaystyle</xsl:text>
    </xsl:when>
    <xsl:when test="@displaystyle='false'">
    <xsl:text>{\textstyle</xsl:text>
    </xsl:when>
  </xsl:choose>
  <xsl:apply-templates/>
  <xsl:if test="@displaystyle = 'true' or @displaystyle = 'false'">
    <xsl:text>}</xsl:text>
  </xsl:if>
  <xsl:if test="@color">
    <xsl:text>}</xsl:text>
  </xsl:if>
  <xsl:if test="@background">
    <xsl:text>$}</xsl:text>
  </xsl:if>
</xsl:template>

</xsl:stylesheet>