aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2016-05-21 21:39:15 +0200
committerAdrian Kummerlaender2016-05-21 21:39:15 +0200
commit3f9fb69c072e50a533b52408410cf71302206d16 (patch)
tree2a702694de9089685aee2f71d975ac52d360c31c
parent72efdf6d42a71a9ac02d1cc2ec4bc21f190447ca (diff)
downloadblog.kummerlaender.eu-3f9fb69c072e50a533b52408410cf71302206d16.tar
blog.kummerlaender.eu-3f9fb69c072e50a533b52408410cf71302206d16.tar.gz
blog.kummerlaender.eu-3f9fb69c072e50a533b52408410cf71302206d16.tar.bz2
blog.kummerlaender.eu-3f9fb69c072e50a533b52408410cf71302206d16.tar.lz
blog.kummerlaender.eu-3f9fb69c072e50a533b52408410cf71302206d16.tar.xz
blog.kummerlaender.eu-3f9fb69c072e50a533b52408410cf71302206d16.tar.zst
blog.kummerlaender.eu-3f9fb69c072e50a533b52408410cf71302206d16.zip
Forward math expression type (block/inline) to formatter
Add support for header elements with inline math expressions
-rw-r--r--source/99_result/main.css2
-rw-r--r--utility/formatter.xsl14
2 files changed, 10 insertions, 6 deletions
diff --git a/source/99_result/main.css b/source/99_result/main.css
index 5fd7b65..ef4d5f0 100644
--- a/source/99_result/main.css
+++ b/source/99_result/main.css
@@ -36,7 +36,7 @@ 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 p.math{padding:0.5em;font-size:1.25em;line-height:0;text-align:center}
+#content p.math{padding:0.5em;font-size:1.20em;line-height:0;text-align:center}
#content span.math{line-height:0}
#pagination{height:1.5em;margin-top:.5em}
#pagination span.disabled{display:none}
diff --git a/utility/formatter.xsl b/utility/formatter.xsl
index 7b9292c..d346190 100644
--- a/utility/formatter.xsl
+++ b/utility/formatter.xsl
@@ -19,18 +19,21 @@
<xsl:template name="math_highlighter">
<xsl:param name="source"/>
+ <xsl:param name="arguments"/>
<xsl:variable name="formatted_expression">
<xsl:call-template name="plain_formatter">
<xsl:with-param name="format">
- <xsl:text>tex2html --inline '</xsl:text>
+ <xsl:text>tex2html </xsl:text>
+ <xsl:value-of select="$arguments"/>
+ <xsl:text> '</xsl:text>
<xsl:value-of select="$source"/>
<xsl:text>'</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
- <xsl:copy-of select="xalan:nodeset($formatted_expression)/*"/>
+ <xsl:copy-of select="xalan:nodeset($formatted_expression)/node()"/>
</xsl:template>
<xsl:template name="code_highlighter">
@@ -60,13 +63,13 @@
<xsl:template match="h2" mode="embellish">
<h3>
- <xsl:copy-of select="node()"/>
+ <xsl:apply-templates select="node()" mode="embellish"/>
</h3>
</xsl:template>
<xsl:template match="h3" mode="embellish">
<h4>
- <xsl:copy-of select="node()"/>
+ <xsl:apply-templates select="node()" mode="embellish"/>
</h4>
</xsl:template>
@@ -98,7 +101,8 @@
<xsl:otherwise>
<span class="math">
<xsl:call-template name="math_highlighter">
- <xsl:with-param name="source" select="text()"/>
+ <xsl:with-param name="source" select="text()"/>
+ <xsl:with-param name="arguments" select="'--inline'"/>
</xsl:call-template>
</span>
</xsl:otherwise>