]> pere.pagekite.me Git - text-infor-lif-else-laula.git/blob - data/xetex_param.xsl
Correct link notation in README.
[text-infor-lif-else-laula.git] / data / xetex_param.xsl
1 <?xml version='1.0'?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
3
4 <xsl:param name="book.font" select="'crimson'"/>
5
6 <xsl:param name="xetex.font.crimson">
7 <xsl:text>\setmainfont{Crimson Text}&#10;</xsl:text>
8 <xsl:text>\setsansfont{Crimson Text}&#10;</xsl:text>
9 <xsl:text>\setmonofont{Latin Modern Mono}&#10;</xsl:text>
10
11 <!-- Force <emphasis role='strong'> to be bold, not semibold -->
12 <!--
13 <xsl:text>\setmainfont[BoldFont={CrimsonText-Bold}]{Crimson Text}&#10;</xsl:text>
14 -->
15
16 <!-- Use a font that has smallcaps -->
17 <!--
18 <xsl:text>\newfontinstance\scshape[Letters=SmallCaps,Scale=1.15]{Crimson}&#10;</xsl:text>
19 -->
20 <!-- Use a smaller font except for the letter heading which is bold -->
21 <!--
22 <xsl:text>\newfontfamily\indexfont[Scale=0.7,
23 BoldFeatures={Scale=1}]{Crimson Text}&#10;</xsl:text>
24 -->
25 </xsl:param>
26
27 <xsl:param name="xetex.font.alegreya">
28 <xsl:text>\setmainfont[SmallCapsFont={Alegreya SC}]{Alegreya}&#10;</xsl:text>
29 <xsl:text>\setsansfont{Alegreya Sans}&#10;</xsl:text>
30 <xsl:text>\setmonofont{DejaVu Sans Mono}&#10;</xsl:text>
31
32 <!-- Use a smaller font except for the letter heading which is bold -->
33 <xsl:text>\newfontfamily\indexfont[Scale=0.7,
34 BoldFeatures={Scale=1}]{Alegreya}&#10;</xsl:text>
35 </xsl:param>
36
37 <xsl:param name="xetex.font.gandhi">
38 <xsl:text>\setmainfont[SmallCapsFont={Alegreya SC}]{Gandhi Serif}&#10;</xsl:text>
39 <xsl:text>\setsansfont{Gandhi Sans}&#10;</xsl:text>
40 <xsl:text>\setmonofont{DejaVu Sans Mono}&#10;</xsl:text>
41
42 <!-- Use a smaller font except for the letter heading which is bold -->
43 <xsl:text>\newfontfamily\indexfont[Scale=0.7,
44 BoldFeatures={Scale=1}]{Gandhi Serif}&#10;</xsl:text>
45 </xsl:param>
46
47 <xsl:param name="xetex.font">
48 <xsl:choose>
49 <xsl:when test="$book.font = 'crimson'">
50 <xsl:value-of select="$xetex.font.crimson"/>
51 </xsl:when>
52 <xsl:when test="$book.font = 'gandhi'">
53 <xsl:value-of select="$xetex.font.gandhi"/>
54 </xsl:when>
55 <xsl:when test="$book.font = 'alegreya'">
56 <xsl:value-of select="$xetex.font.alegreya"/>
57 </xsl:when>
58 <xsl:otherwise>
59 <!-- Fallback to the default Crimson font -->
60 <xsl:value-of select="$xetex.font.crimson"/>
61 </xsl:otherwise>
62 </xsl:choose>
63 </xsl:param>
64
65
66 <!-- Do it the hard way: put this content in a file loaded by \maketitle -->
67 <xsl:template match="colophon">
68 <xsl:variable name="titlepage.verso">
69 <xsl:text>\begin{colophon}&#10;</xsl:text>
70 <xsl:apply-templates/>
71 <xsl:text>\end{colophon}&#10;</xsl:text>
72 </xsl:variable>
73 <xsl:call-template name="write.text.chunk">
74 <!-- The filename must end with 'input.rtex' to be parsed by dblatex -->
75 <xsl:with-param name="filename">
76 <xsl:text>titlepg.input.rtex</xsl:text>
77 </xsl:with-param>
78 <xsl:with-param name="method" select="'text'"/>
79 <xsl:with-param name="content">
80 <xsl:value-of select="$titlepage.verso"/>
81 </xsl:with-param>
82 <xsl:with-param name="encoding" select="$chunker.output.encoding"/>
83 </xsl:call-template>
84 </xsl:template>
85
86 <!-- French typography requises the surname of the cited authors being in
87 Small Capitals -->
88 <xsl:template match="footnote//personname">
89 <xsl:apply-templates/>
90 </xsl:template>
91
92 <xsl:template match="footnote//surname">
93 <xsl:variable name="lang">
94 <xsl:call-template name="l10n.language"/>
95 </xsl:variable>
96
97 <xsl:choose>
98 <xsl:when test="$lang='fr'">
99 <xsl:text>\textsc{</xsl:text>
100 <xsl:apply-templates/>
101 <xsl:text>}</xsl:text>
102 </xsl:when>
103 <xsl:otherwise>
104 <xsl:apply-templates/>
105 </xsl:otherwise>
106 </xsl:choose>
107 </xsl:template>
108
109 </xsl:stylesheet>