aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2016-05-15 23:19:57 +0200
committerAdrian Kummerlaender2016-05-15 23:19:57 +0200
commit72efdf6d42a71a9ac02d1cc2ec4bc21f190447ca (patch)
tree7720ba61546ae0037f96d319a866f2e01a43cd36
parentbb4b5ef78b8070662b65749ffb7284e8e2350d62 (diff)
downloadblog.kummerlaender.eu-72efdf6d42a71a9ac02d1cc2ec4bc21f190447ca.tar
blog.kummerlaender.eu-72efdf6d42a71a9ac02d1cc2ec4bc21f190447ca.tar.gz
blog.kummerlaender.eu-72efdf6d42a71a9ac02d1cc2ec4bc21f190447ca.tar.bz2
blog.kummerlaender.eu-72efdf6d42a71a9ac02d1cc2ec4bc21f190447ca.tar.lz
blog.kummerlaender.eu-72efdf6d42a71a9ac02d1cc2ec4bc21f190447ca.tar.xz
blog.kummerlaender.eu-72efdf6d42a71a9ac02d1cc2ec4bc21f190447ca.tar.zst
blog.kummerlaender.eu-72efdf6d42a71a9ac02d1cc2ec4bc21f190447ca.zip
Implement support for inline math expressions
-rw-r--r--source/99_result/main.css3
-rw-r--r--utility/formatter.xsl23
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">