<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">
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]