aboutsummaryrefslogtreecommitdiff
path: root/utility
diff options
context:
space:
mode:
authorAdrian Kummerlaender2016-05-21 21:39:15 +0200
committerAdrian Kummerlaender2016-05-21 21:39:15 +0200
commit3f9fb69c072e50a533b52408410cf71302206d16 (patch)
tree2a702694de9089685aee2f71d975ac52d360c31c /utility
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
Diffstat (limited to 'utility')
-rw-r--r--utility/formatter.xsl14
1 files changed, 9 insertions, 5 deletions
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>