]> pere.pagekite.me Git - text-madewithcc.git/blobdiff - extra/pdf.xsl
Merge remote-tracking branch 'weblate/master'
[text-madewithcc.git] / extra / pdf.xsl
index c7d5268d369b300dbbbb969644ae16c5a7512ee1..714f06dfc812697a70b5e9ef48bfd6d75105e84c 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding="iso-8859-1"?>
+<?xml version='1.0' encoding="UTF-8"?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
 
   <xsl:param name="latex.class.book">myclass</xsl:param>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
 
   <xsl:param name="latex.class.book">myclass</xsl:param>
@@ -47,9 +47,40 @@ extended distribution with LuLu.
     <xsl:param name="content">
       <xsl:apply-templates/>
     </xsl:param>
     <xsl:param name="content">
       <xsl:apply-templates/>
     </xsl:param>
-    <xsl:text>\vskip 0.5cm \hfill \textit{ </xsl:text>
+    <xsl:text>\begin{flushright}
+    \textit{ </xsl:text>
     <xsl:copy-of select="$content"/>
     <xsl:copy-of select="$content"/>
-    <xsl:text>}</xsl:text>
+    <xsl:text>}
+    \end{flushright}</xsl:text>
+  </xsl:template>
+
+  <!-- An  attribution's citetitle should be rendered after a line
+       break -->
+  <xsl:template match="citetitle">
+    <xsl:param name="content">
+      <xsl:apply-templates/>
+    </xsl:param>
+    <xsl:text>\\ \quad \hfill </xsl:text>
+    <xsl:copy-of select="$content"/>
+  </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
   </xsl:template>
 
   <!-- Place title verso page behind the title page the hard way: put