diff options
-rw-r--r-- | source/99_result/main.css | 3 | ||||
-rw-r--r-- | utility/formatter.xsl | 23 |
2 files changed, 19 insertions, 7 deletions
diff --git a/source/99_result/main.css b/source/99_result/main.css index 951a2a4..5fd7b65 100644 --- a/source/99_result/main.css +++ b/source/99_result/main.css @@ -36,7 +36,8 @@ code{margin:0 .1em;padding:0 .5em;border:.1em solid #e3e8e8;background-color:#f8 #content .footnotes {border-top:.3em dotted #e3e8e8} #content img{padding:.2em;border:.1em solid #e3e8e8;display:block;margin-left:auto;margin-right:auto;max-width:95%} #content img.clear{border:0;max-width:100%} -#content .math{padding:0.5em;font-size:1.25em;line-height:0} +#content p.math{padding:0.5em;font-size:1.25em;line-height:0;text-align:center} +#content span.math{line-height:0} #pagination{height:1.5em;margin-top:.5em} #pagination span.disabled{display:none} #pagination span a{text-decoration:none;color:#272828} diff --git a/utility/formatter.xsl b/utility/formatter.xsl index 21cdff4..7b9292c 100644 --- a/utility/formatter.xsl +++ b/utility/formatter.xsl @@ -30,9 +30,7 @@ </xsl:call-template> </xsl:variable> - <p class="math"> - <xsl:copy-of select="xalan:nodeset($formatted_expression)/node()"/> - </p> + <xsl:copy-of select="xalan:nodeset($formatted_expression)/*"/> </xsl:template> <xsl:template name="code_highlighter"> @@ -89,9 +87,22 @@ </xsl:template> <xsl:template match="script" mode="embellish"> - <xsl:call-template name="math_highlighter"> - <xsl:with-param name="source" select="text()"/> - </xsl:call-template> + <xsl:choose> + <xsl:when test="contains(@type, 'mode=display')"> + <p class="math"> + <xsl:call-template name="math_highlighter"> + <xsl:with-param name="source" select="text()"/> + </xsl:call-template> + </p> + </xsl:when> + <xsl:otherwise> + <span class="math"> + <xsl:call-template name="math_highlighter"> + <xsl:with-param name="source" select="text()"/> + </xsl:call-template> + </span> + </xsl:otherwise> + </xsl:choose> </xsl:template> <xsl:template name="formatter"> |