]> pere.pagekite.me Git - text-madewithcc.git/blob - extra/pdf.xsl
Added a colophon for Spanish
[text-madewithcc.git] / extra / pdf.xsl
1 <?xml version='1.0' encoding="UTF-8"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
3
4 <xsl:param name="latex.class.book">myclass</xsl:param>
5
6 <!-- Layout for printing on US Letter paper -->
7 <!-- -->
8 <!-- Should be equivalent to next (commented) line, and should match the -->
9 <!-- default behaviour, but it didn't work... -->
10 <!-- -->
11 <!-- <xsl:param name="paper.type">USletter</xsl:param> -->
12 <xsl:param name="page.width">8.5in</xsl:param>
13 <xsl:param name="page.height">11in</xsl:param>
14
15 <xsl:param name="page.margin.inner">1.5in</xsl:param>
16 <xsl:param name="page.margin.outer">1.5in</xsl:param>
17
18 <xsl:param name="page.margin.top">1in</xsl:param>
19 <xsl:param name="page.margin.bottom">1in</xsl:param>
20
21 <xsl:param name="double.sided">1</xsl:param>
22 <xsl:param name="latex.class.options">openright,twoside</xsl:param>
23
24 <xsl:param name="latex.encoding">utf8</xsl:param>
25
26 <xsl:param name="preface.tocdepth">1</xsl:param>
27
28 <xsl:param name="toc.section.depth">0</xsl:param>
29
30 <!-- do not list figures -->
31 <xsl:param name="doc.lot.show">example</xsl:param>
32 <!--
33 Make final page blank, which is required for PDFs inteneded for
34 extended distribution with LuLu.
35 -->
36
37 <xsl:param name="latex.enddocument">
38 <xsl:text>\pagebreak
39 \thispagestyle{empty}
40 ~
41 \end{document}
42 </xsl:text>
43 </xsl:param>
44
45 <!-- Attributions should be italicized, right-aligned -->
46 <xsl:template match="attribution">
47 <xsl:param name="content">
48 <xsl:apply-templates/>
49 </xsl:param>
50 <xsl:text>\begin{flushright}
51 \textit{ </xsl:text>
52 <xsl:copy-of select="$content"/>
53 <xsl:text>}
54 \end{flushright}</xsl:text>
55 </xsl:template>
56
57 <!-- An attribution's citetitle should be rendered after a line
58 break -->
59 <xsl:template match="citetitle">
60 <xsl:param name="content">
61 <xsl:apply-templates/>
62 </xsl:param>
63 <xsl:text>\\ \quad \hfill </xsl:text>
64 <xsl:copy-of select="$content"/>
65 </xsl:template>
66
67 <!-- Bibliography and acknowledgements are formatted as numberless
68 chapters — And the easiest way to achieve it was abusing the
69 "Appendix" definition. -->
70 <xsl:template match="appendix">
71 <xsl:param name="content">
72 <xsl:apply-templates/>
73 </xsl:param>
74 <xsl:param name="title">
75 <xsl:apply-templates/>
76 </xsl:param>
77 <xsl:text>\chapter*{</xsl:text>
78 <xsl:copy-of select="title"/>
79 <xsl:text>}</xsl:text>
80 <xsl:text>\addcontentsline{toc}{chapter}{</xsl:text>
81 <xsl:copy-of select="title"/>
82 <xsl:text>}</xsl:text>
83 <xsl:copy-of select="$content"/>
84 </xsl:template>
85
86 <!-- Place title verso page behind the title page the hard way: put
87 colophon content in a file loaded by \maketitle -->
88 <xsl:template match="colophon">
89 <xsl:variable name="titlepage.verso">
90 <xsl:text>\begin{colophon}&#10;</xsl:text>
91 <xsl:apply-templates/>
92 <xsl:text>\end{colophon}&#10;</xsl:text>
93 </xsl:variable>
94 <xsl:call-template name="write.text.chunk">
95 <!-- The filename must end with 'input.rtex' to be parsed by dblatex -->
96 <xsl:with-param name="filename">
97 <xsl:text>titlepg.input.rtex</xsl:text>
98 </xsl:with-param>
99 <xsl:with-param name="method" select="'text'"/>
100 <xsl:with-param name="content">
101 <xsl:value-of select="$titlepage.verso"/>
102 </xsl:with-param>
103 <xsl:with-param name="encoding" select="$chunker.output.encoding"/>
104 </xsl:call-template>
105 </xsl:template>
106
107 </xsl:stylesheet>