Skip to content

Instantly share code, notes, and snippets.

@urschrei
Created July 9, 2010 22:00
Show Gist options
  • Save urschrei/470130 to your computer and use it in GitHub Desktop.
Save urschrei/470130 to your computer and use it in GitHub Desktop.
\glossaries modifications for memoir.xslt
<xsl:template match="html:li" mode="glossary">
<xsl:param name="footnoteId"/>
<xsl:if test="parent::html:ol/parent::html:div/@class = 'footnotes'">
<xsl:if test="concat('#',@id) = $footnoteId">
<xsl:apply-templates select="html:span[@class='glossary sort']" mode="glossary"/>
<xsl:apply-templates select="html:span[@class='glossary name']" mode="glossary"/>
<xsl:variable name="glsname">
<xsl:apply-templates select="html:span[@class='glossary name']" mode="glossary"/>
</xsl:variable>
<xsl:text>,</xsl:text>
<xsl:text>description={</xsl:text>
<xsl:apply-templates select="html:p" mode="glossary"/>
<xsl:text>}} </xsl:text>
<xsl:variable name="glsbf">
<xsl:value-of select="substring-after($glsname,'{')"/>
</xsl:variable>
<xsl:variable name="glsclean">
<xsl:value-of select="substring-before($glsbf,'}')"/>
</xsl:variable>
<xsl:text>\glsadd{</xsl:text>
<xsl:value-of select="$glsclean"/>
<xsl:text>}</xsl:text>
</xsl:if>
</xsl:if>
</xsl:template>
@urschrei
Copy link
Author

urschrei commented Jul 9, 2010

l. 1 above refers to ~ l. 413 in the original

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment