</xsl:template>
<xsl:template match="m:ci|m:csymbol" mode="charcount">
-<xsl:param name="incurrent_length" select="0"/>
-<xsl:param name="nosibling" select="0"/>
+ <xsl:param name="incurrent_length" select="0"/>
+ <xsl:param name="nosibling" select="0"/>
+ <xsl:variable name="mylength">
+ <xsl:choose>
+ <!-- special notation -->
+ <xsl:when test="text()='append'">3</xsl:when>
+ <!-- no notation -->
+ <xsl:otherwise>
+ <xsl:value-of select="string-length()"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
<xsl:choose>
- <xsl:when test="$framewidth > ($incurrent_length + string-length()) and ($nosibling = 0)">
- <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/></xsl:apply-templates></xsl:variable>
+ <xsl:when test="$framewidth > ($incurrent_length + $mylength) and ($nosibling = 0)">
+ <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length + $mylength"/></xsl:apply-templates></xsl:variable>
<xsl:choose>
<xsl:when test="string($siblength) = """>
- <xsl:value-of select="$incurrent_length + string-length()"/>
+ <xsl:value-of select="$incurrent_length + $mylength"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="number($siblength)"/>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
- <xsl:value-of select="$incurrent_length + string-length()"/>
+ <xsl:value-of select="$incurrent_length + $mylength"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>