]> pere.pagekite.me Git - text-madewithcc.git/commitdiff
Format acknowledgement and bibliography as unnumbered chapters
authorGunnar Wolf <gwolf@gwolf.org>
Fri, 30 Aug 2019 22:03:59 +0000 (17:03 -0500)
committerGunnar Wolf <gwolf@gwolf.org>
Fri, 30 Aug 2019 22:03:59 +0000 (17:03 -0500)
extra/pdf.xsl
fixup-docbook.rb

index dad297edd0763eb3d65667855a79dd5864916a30..f1029d620d213f94651829dc5cfb98c62f5993f7 100644 (file)
@@ -52,6 +52,25 @@ extended distribution with LuLu.
     <xsl:text>}</xsl:text>
   </xsl:template>
 
     <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">
   <!-- Place title verso page behind the title page the hard way: put
        colophon content in a file loaded by \maketitle -->
   <xsl:template match="colophon">
index 329d59935e27d4fa403682f0578c2d2519e1590f..a0504965cb92f5b91a8e6059f2aebef8d2ddd662 100755 (executable)
@@ -53,8 +53,8 @@ partreplace(xml, 'colophon', 'colophon')
 partreplace(xml, 'dedication', 'dedication')
 partreplace(xml, 'foreword', 'preface')
 partreplace(xml, 'introduction', 'preface')
 partreplace(xml, 'dedication', 'dedication')
 partreplace(xml, 'foreword', 'preface')
 partreplace(xml, 'introduction', 'preface')
-partreplace(xml, 'bibliography', 'chapter')
-partreplace(xml, 'acknowledgments', 'chapter')
+partreplace(xml, 'bibliography', 'appendix')
+partreplace(xml, 'acknowledgments', 'appendix')
 
 log 0, 'place part introduction into <partintro>'
 s = xml.xpath("//part/title[text()='The Case Studies']")[0]
 
 log 0, 'place part introduction into <partintro>'
 s = xml.xpath("//part/title[text()='The Case Studies']")[0]