]> pere.pagekite.me Git - text-madewithcc.git/blobdiff - extra/pdf.xsl
Format acknowledgement and bibliography as unnumbered chapters
[text-madewithcc.git] / extra / pdf.xsl
index dad297edd0763eb3d65667855a79dd5864916a30..f1029d620d213f94651829dc5cfb98c62f5993f7 100644 (file)
@@ -52,6 +52,25 @@ extended distribution with LuLu.
     <xsl:text>}</xsl:text>
   </xsl:template>
 
+  <!-- Bibliography and acknowledgements are formatted as numberless
+       chapters — And the easiest way to achieve it was abusing the
+       "Appendix" definition. -->
+  <xsl:template match="appendix">
+     <xsl:param name="content">
+      <xsl:apply-templates/>
+     </xsl:param>
+     <xsl:param name="title">
+      <xsl:apply-templates/>
+     </xsl:param>
+     <xsl:text>\chapter*{</xsl:text>
+     <xsl:copy-of select="title"/>
+     <xsl:text>}</xsl:text>
+     <xsl:text>\addcontentsline{toc}{chapter}{</xsl:text>
+     <xsl:copy-of select="title"/>
+     <xsl:text>}</xsl:text>
+     <xsl:copy-of select="$content"/>
+  </xsl:template>
+
   <!-- Place title verso page behind the title page the hard way: put
        colophon content in a file loaded by \maketitle -->
   <xsl:template match="colophon">