概要
分数を表示
利用方法
<frac> <num>分子</num> <denom>分母</denom> </frac>
サンプル
<frac><num>f(b)−f(a)</num><denom>b−a</denom></frac> = f'(c)
| f(b)−f(a) |
| b−a |
XSL template
<xsl:template match="ufcpp:frac">
<table class="frac" summary="fraction">
<tr><td class="num"><xsl:choose><xsl:when test="@num != ''"><xsl:value-of select="@num"/></xsl:when><xsl:when test="@n != ''"><xsl:value-of select="@n"/></xsl:when><xsl:otherwise><xsl:apply-templates select="ufcpp:num"/></xsl:otherwise></xsl:choose></td></tr>
<tr><td><xsl:choose><xsl:when test="@denom != ''"><xsl:value-of select="@denom"/></xsl:when><xsl:when test="@d != ''"><xsl:value-of select="@d"/></xsl:when><xsl:otherwise><xsl:apply-templates select="ufcpp:denom"/></xsl:otherwise></xsl:choose></td></tr>
</table>
</xsl:template>
<xsl:template match="ufcpp:frac/ufcpp:num">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="ufcpp:frac/ufcpp:denom">
<xsl:apply-templates/>
</xsl:template>
style sheet
table.frac
{
display:inline;
vertical-align:middle;
font-style:italic;
font-size:90%;
text-align:center;
}
td.num
{
border-bottom:#000000 1pt solid;
}
