]> pere.pagekite.me Git - text-free-culture-lessig.git/commitdiff
Add several font setups + group the index font in the setup + add french template.
authorben <ben@saturne.(none)>
Fri, 8 Jan 2016 00:37:08 +0000 (01:37 +0100)
committerben <ben@saturne.(none)>
Fri, 8 Jan 2016 00:37:08 +0000 (01:37 +0100)
data/xetex_param.xsl
myclass.cls

index 9142d3db73680c0f6320483b5b655825cd56e8b2..83110418a40b56ccd83c2c9d852f2f39b1c60131 100644 (file)
@@ -1,14 +1,63 @@
 <?xml version='1.0'?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
-<xsl:param name="xetex.font">
+
+<xsl:param name="book.font" select="'crimson'"/>
+
+<xsl:param name="xetex.font.crimson">
   <xsl:text>\setmainfont{Crimson Text}&#10;</xsl:text>
   <xsl:text>\setsansfont{Crimson Text}&#10;</xsl:text>
   <xsl:text>\setmonofont{Latin Modern Mono}&#10;</xsl:text>
 
   <!-- Force <emphasis role='strong'> to be bold, not semibold -->
   <xsl:text>\setmainfont[BoldFont={CrimsonText-Bold}]{Crimson Text}&#10;</xsl:text>
+
+  <!-- Use a font that has smallcaps -->
+  <xsl:text>\newfontinstance\scshape[Letters=SmallCaps,Scale=1.15]{Crimson}&#10;</xsl:text>
+
+  <!-- Use a smaller font except for the letter heading which is bold -->
+  <xsl:text>\newfontfamily\indexfont[Scale=0.7,
+                           BoldFeatures={Scale=1}]{Crimson Text}&#10;</xsl:text>
 </xsl:param>
 
+<xsl:param name="xetex.font.alegreya">
+  <xsl:text>\setmainfont[SmallCapsFont={Alegreya SC}]{Alegreya}&#10;</xsl:text>
+  <xsl:text>\setsansfont{Alegreya Sans}&#10;</xsl:text>
+  <xsl:text>\setmonofont{DejaVu Sans Mono}&#10;</xsl:text>
+
+  <!-- Use a smaller font except for the letter heading which is bold -->
+  <xsl:text>\newfontfamily\indexfont[Scale=0.7,
+                           BoldFeatures={Scale=1}]{Alegreya}&#10;</xsl:text>
+</xsl:param>
+
+<xsl:param name="xetex.font.gandhi">
+  <xsl:text>\setmainfont[SmallCapsFont={Alegreya SC}]{Gandhi Serif}&#10;</xsl:text>
+  <xsl:text>\setsansfont{Gandhi Sans}&#10;</xsl:text>
+  <xsl:text>\setmonofont{DejaVu Sans Mono}&#10;</xsl:text>
+
+  <!-- Use a smaller font except for the letter heading which is bold -->
+  <xsl:text>\newfontfamily\indexfont[Scale=0.7,
+                           BoldFeatures={Scale=1}]{Gandhi Serif}&#10;</xsl:text>
+</xsl:param>
+
+<xsl:param name="xetex.font">
+  <xsl:choose>
+  <xsl:when test="$book.font = 'crimson'">
+    <xsl:value-of select="$xetex.font.crimson"/>
+  </xsl:when>
+  <xsl:when test="$book.font = 'gandhi'">
+    <xsl:value-of select="$xetex.font.gandhi"/>
+  </xsl:when>
+  <xsl:when test="$book.font = 'alegreya'">
+    <xsl:value-of select="$xetex.font.alegreya"/>
+  </xsl:when>
+  <xsl:otherwise>
+    <!-- Fallback to the default Crimson font -->
+    <xsl:value-of select="$xetex.font.crimson"/>
+  </xsl:otherwise>
+  </xsl:choose>
+</xsl:param>
+
+
 <!-- Do it the hard way: put this content in a file loaded by \maketitle -->
 <xsl:template match="colophon">
   <xsl:variable name="titlepage.verso">
   </xsl:call-template>
 </xsl:template>
 
+<!-- French typography requises the surname of the cited authors being in
+     Small Capitals -->
+<xsl:template match="footnote//personname">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="footnote//surname">
+  <xsl:text>\textsc{</xsl:text>
+  <xsl:apply-templates/>
+  <xsl:text>}</xsl:text>
+</xsl:template>
+
 </xsl:stylesheet>
index 1218bda987baa7a56e13e1160e00eb2af7edc24a..73d08698f7d30afcb55b35c0b9f5cb7abbf7577d 100644 (file)
@@ -52,9 +52,6 @@
 \let\endstdindex=\endtheindex
 \renewenvironment{theindex}{
   \begin{stdindex}
-  % Use a smaller font except for the letter heading which is bold
-  \newfontfamily\indexfont[Scale=0.7,
-                           BoldFeatures={Scale=1}]{Crimson Text}
   \@ifundefined{chapter}{}{
     % To not have the number, replace by:
     % \addcontentsline{toc}{chapter}{\numberline{}\indexname}