括弧の表示。
(a), {a}, <a>, [a], |a|, ||a|| など、全て bracket にまとめました。
(短縮形 bra)
(type: paren (round), brace (curl), angle, square(sq), abs, norm, ceil, floor)
<bracket size="括弧の大きさ" type="type">括弧内の式</bracket>
<bracket>x</bracket> = <inv>N</inv><Sigma><sub>i</sub><sup>N</sup></Sigma>x<sub>i</sub>
<xsl:template match="ufcpp:math//ufcpp:bracket|ufcpp:math//ufcpp:bra|ufcpp:Math//ufcpp:bracket|ufcpp:Math//ufcpp:bra">
<xsl:variable name="t"><xsl:choose><xsl:when test="@type != ''"><xsl:value-of select="@type"/></xsl:when><xsl:otherwise><xsl:value-of select="@t"/></xsl:otherwise></xsl:choose></xsl:variable>
<xsl:variable name="l">
<xsl:choose>
<xsl:when test="$t = 'p'">(</xsl:when>
<xsl:when test="$t = 'paren'">(</xsl:when>
<xsl:when test="$t = 'r'">(</xsl:when>
<xsl:when test="$t = 'round'">(</xsl:when>
<xsl:when test="$t = 'c'">{</xsl:when>
<xsl:when test="$t = 'curl'">{</xsl:when>
<xsl:when test="$t = 'b'">{</xsl:when>
<xsl:when test="$t = 'brace'">{</xsl:when>
<xsl:when test="$t = 'angle'">〈</xsl:when>
<xsl:when test="$t = 'square'">[</xsl:when>
<xsl:when test="$t = 'sq'">[</xsl:when>
<xsl:when test="$t = 'abs'">|</xsl:when>
<xsl:when test="$t = 'norm'">||</xsl:when>
<xsl:when test="$t = 'ceil'">⌈</xsl:when>
<xsl:when test="$t = 'floor'">⌊</xsl:when>
<xsl:otherwise>〈</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="r">
<xsl:choose>
<xsl:when test="$t = 'p'">)</xsl:when>
<xsl:when test="$t = 'paren'">)</xsl:when>
<xsl:when test="$t = 'r'">)</xsl:when>
<xsl:when test="$t = 'round'">)</xsl:when>
<xsl:when test="$t = 'c'">}</xsl:when>
<xsl:when test="$t = 'curl'">}</xsl:when>
<xsl:when test="$t = 'b'">}</xsl:when>
<xsl:when test="$t = 'brace'">}</xsl:when>
<xsl:when test="$t = 'angle'">〉</xsl:when>
<xsl:when test="$t = 'square'">]</xsl:when>
<xsl:when test="$t = 'sq'">]</xsl:when>
<xsl:when test="$t = 'abs'">|</xsl:when>
<xsl:when test="$t = 'norm'">||</xsl:when>
<xsl:when test="$t = 'ceil'">⌉</xsl:when>
<xsl:when test="$t = 'floor'">⌋</xsl:when>
<xsl:otherwise>〉</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<span class="paren">
<xsl:attribute name="style">font-size:<xsl:value-of select="@size"/>em;</xsl:attribute>
<xsl:value-of select="$l"/>
</span>
<xsl:apply-templates/>
<span class="paren">
<xsl:attribute name="style">font-size:<xsl:value-of select="@size"/>em;</xsl:attribute>
<xsl:value-of select="$r"/>
</span>
</xsl:template>
span.paren
{
font-style:normal;
vertical-align:middle;
}