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