<!-- CSYMBOL -->
<xsl:template match="m:apply[m:csymbol]">
+<xsl:param name="nopar" select="1"/>
<xsl:variable name="name"><xsl:value-of select="m:csymbol"/></xsl:variable>
<xsl:variable name="charlength"><xsl:apply-templates select="m:csymbol" mode="charcount"/></xsl:variable>
<m:mrow>
<m:mtr>
<m:mtd>
<m:mrow>
- <m:mo stretchy="false">(</m:mo>
- <xsl:apply-templates select="*[position()=2]"/>
+ <xsl:if test="$nopar=0">
+ <m:mo stretchy="false">(</m:mo>
+ </xsl:if>
+ <xsl:apply-templates select="*[position()=2]"><xsl:with-param name="nopar" select="0"/></xsl:apply-templates>
</m:mrow>
</m:mtd>
</m:mtr>
<m:mtd>
<m:mrow>
<m:mo mathmathcolor="Blue">→</m:mo>
- <xsl:apply-templates select="*[position()=3]"/>
+ <xsl:choose>
+ <xsl:when test="*[position()=3]/m:csymbol">
+ <xsl:variable name="nextp"><xsl:value-of select="*[position()=3]/m:csymbol"/></xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$nextp='arrow'">
+ <xsl:apply-templates select="*[position()=3]"><xsl:with-param name="nopar" select="1"/></xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="*[position()=3]"><xsl:with-param name="nopar" select="0"/></xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="*[position()=3]"><xsl:with-param name="nopar" select="0"/></xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
</m:mrow>
</m:mtd>
</m:mtr>
+ <xsl:if test="$nopar=0">
<m:mtr>
<m:mtd>
<m:mrow>
</m:mrow>
</m:mtd>
</m:mtr>
+ </xsl:if>
</m:mtable>
</xsl:when>
<xsl:otherwise>
- <m:mo stretchy="false">(</m:mo>
- <xsl:apply-templates select="*[position()=2]"/>
+ <xsl:if test="$nopar=0">
+ <m:mo stretchy="false">(</m:mo>
+ </xsl:if>
+ <xsl:apply-templates select="*[position()=2]"><xsl:with-param name="nopar" select="0"/></xsl:apply-templates>
<m:mo mathcolor="Blue">→</m:mo>
- <xsl:apply-templates select="*[position()=3]"/>
- <m:mo stretchy="false">)</m:mo>
+ <xsl:choose>
+ <xsl:when test="*[position()=3]/m:csymbol">
+ <xsl:variable name="nextp"><xsl:value-of select="*[position()=3]/m:csymbol"/></xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$nextp='arrow'">
+ <xsl:apply-templates select="*[position()=3]"><xsl:with-param name="nopar" select="1"/></xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="*[position()=3]"><xsl:with-param name="nopar" select="0"/></xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="*[position()=3]"><xsl:with-param name="nopar" select="0"/></xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="$nopar=0">
+ <m:mo stretchy="false">)</m:mo>
+ </xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:stylesheet>
+
</xsl:when>
<xsl:otherwise>
<Param name="{target/@binder}">
- <xsl:apply-templates select="source" mode="noannot"/>
+ <xsl:apply-templates select="source"/>
</Param>
</xsl:otherwise>
</xsl:choose>
<xsl:when test="($target = 1) and ($noparams != 0)">
<m:apply>
<m:csymbol>app</m:csymbol>
- <xsl:apply-templates select="." mode="noannot"/>
+ <xsl:apply-templates select="."/>
<xsl:call-template name="printparam"><xsl:with-param name="noleft" select="$noparams"/></xsl:call-template>
</m:apply>
</xsl:when>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$target = 1">
- <xsl:apply-templates select="." mode="noannot"/>
+ <xsl:apply-templates select="."/>
</xsl:if>
</xsl:otherwise>
</xsl:choose>