1 <!-- $Cambridge: exim/doc/doc-docbook/MyStyle-fo.xsl,v 1.1 2005/06/16 10:32:31 ph10 Exp $ -->
3 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:fo="http://www.w3.org/1999/XSL/Format"
7 <!-- This stylesheet driver contains changes that I want to apply to the
8 printed output form of both the filter document and the main Exim
9 specification. It is imported by MyStyle-filter-fo.xsl and MyStyle-spec-fo.xsl.
12 <xsl:import href="MyTitleStyle.xsl"/>
16 <!-- Set A4 paper, double sided -->
18 <xsl:param name="paper.type" select="'A4'"></xsl:param>
20 <!-- This currently causes errors
21 <xsl:param name="double.sided" select="1"></xsl:param>
24 <!-- Allow for typed index entries. The "role" setting works with DocBook
25 version 4.2 or earlier. Later versions (which we are not currently using)
28 <xsl:param name="index.on.type" select="1"></xsl:param>
29 <xsl:param name="index.on.role" select="1"></xsl:param>
32 <!-- The default uses short chapter titles in the TOC! I want them only for
33 use in footer lines. So we have to modify this template. I changed
34 "titleabbrev.markup" to "title.markup". While I'm here, I also made chapter
35 entries print in bold. -->
37 <xsl:template name="toc.line">
38 <xsl:variable name="id">
39 <xsl:call-template name="object.id"/>
42 <xsl:variable name="label">
43 <xsl:apply-templates select="." mode="label.markup"/>
46 <fo:block text-align-last="justify"
47 end-indent="{$toc.indent.width}pt"
48 last-line-end-indent="-{$toc.indent.width}pt">
49 <fo:inline keep-with-next.within-line="always">
50 <!-- Added lines for bold -->
52 <xsl:when test="self::chapter">
53 <xsl:attribute name="font-weight">bold</xsl:attribute>
55 <xsl:when test="self::index">
56 <xsl:attribute name="font-weight">bold</xsl:attribute>
59 <!-- .................. -->
60 <fo:basic-link internal-destination="{$id}">
61 <xsl:if test="$label != ''">
62 <xsl:copy-of select="$label"/>
63 <xsl:value-of select="$autotoc.label.separator"/>
65 <xsl:apply-templates select="." mode="title.markup"/>
68 <fo:inline keep-together.within-line="always">
69 <xsl:text> </xsl:text>
70 <fo:leader leader-pattern="dots"
71 leader-pattern-width="3pt"
72 leader-alignment="reference-area"
73 keep-with-next.within-line="always"/>
74 <xsl:text> </xsl:text>
75 <fo:basic-link internal-destination="{$id}">
76 <fo:page-number-citation ref-id="{$id}"/>
89 Adjust the sizes of the fonts for titles; the defaults are too gross.
92 <!-- Level 1 is sect1 level -->
94 <xsl:attribute-set name="section.title.level1.properties">
95 <xsl:attribute name="font-size">
96 <xsl:value-of select="$body.font.master * 1.2"></xsl:value-of>
97 <xsl:text>pt</xsl:text>
102 <!-- Fiddling with chapter titles is more messy -->
104 <xsl:template match="title" mode="chapter.titlepage.recto.auto.mode">
105 <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format"
106 xsl:use-attribute-sets="chapter.titlepage.recto.style"
107 margin-left="{$title.margin.left}"
110 font-family="{$title.font.family}">
111 <xsl:call-template name="component.title">
112 <xsl:with-param name="node" select="ancestor-or-self::chapter[1]"/>
117 <xsl:template match="title" mode="chapter.titlepage.verso.auto.mode">
118 <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format"
119 xsl:use-attribute-sets="chapter.titlepage.recto.style"
120 margin-left="{$title.margin.left}"
123 font-family="{$title.font.family}">
124 <xsl:call-template name="component.title">
125 <xsl:with-param name="node" select="ancestor-or-self::chapter[1]"/>
131 <!-- This provides a hard pagebreak mechanism as a get-out -->
133 <xsl:template match="processing-instruction('hard-pagebreak')">
134 <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" break-before='page'>
139 <!-- Sort out the footer. Useful information is available at
140 http://www.sagehill.net/docbookxsl/PrintHeaders.html
144 <xsl:attribute-set name="footer.content.properties">
145 <!-- <xsl:attribute name="font-family">serif</xsl:attribute> -->
146 <!-- <xsl:attribute name="font-size">9pt</xsl:attribute> -->
147 <xsl:attribute name="font-style">italic</xsl:attribute>
153 <!-- Things that can be inserted into the footer are:
156 Inserts the current page number.
158 <xsl:apply-templates select="." mode="title.markup"/>
159 Inserts the title of the current chapter, appendix, or other component.
161 <xsl:apply-templates select="." mode="titleabbrev.markup"/>
162 Inserts the titleabbrev of the current chapter, appendix, or other component,
163 if it is available. Otherwise it inserts the regular title.
165 <xsl:apply-templates select="." mode="object.title.markup"/>
166 Inserts the chapter title with chapter number label. Likewise for appendices.
168 <fo:retrieve-marker ... /> Used to retrieve the current section name.
170 <xsl:apply-templates select="//corpauthor[1]"/>
171 Inserts the value of the first corpauthor element found anywhere in the
174 <xsl:call-template name="datetime.format">
176 Inserts a date timestamp.
178 <xsl:call-template name="draft.text"/>
179 Inserts the Draft message if draft.mode is currently on.
181 <fo:external-graphic ... />
182 Inserts a graphical image.
183 See the section Graphic in header or footer for details.
187 <xsl:template name="footer.content">
188 <xsl:param name="pageclass" select="''"/>
189 <xsl:param name="sequence" select="''"/>
190 <xsl:param name="position" select="''"/>
191 <xsl:param name="gentext-key" select="''"/>
194 <!-- pageclass can be front, body, back -->
195 <!-- sequence can be odd, even, first, blank -->
196 <!-- position can be left, center, right -->
198 <xsl:when test="$pageclass = 'titlepage'">
199 <!-- nop; no footer on title pages -->
202 <xsl:when test="$double.sided != 0 and $sequence = 'even'
203 and $position='left'">
207 <xsl:when test="$double.sided != 0 and ($sequence = 'odd' or $sequence = 'first')
208 and $position='right'">
212 <xsl:when test="$double.sided = 0 and $position='center'">
216 <xsl:when test="$double.sided = 0 and $position='right'">
217 <xsl:apply-templates select="." mode="titleabbrev.markup"/>
220 <xsl:when test="$sequence='blank'">
222 <xsl:when test="$double.sided != 0 and $position = 'left'">
225 <xsl:when test="$double.sided = 0 and $position = 'center'">