1 <!-- $Cambridge: exim/doc/doc-docbook/MyStyle-fo.xsl,v 1.2 2005/11/10 12:30:13 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}"/>
84 Adjust the sizes of the fonts for titles; the defaults are too gross.
87 <!-- Level 1 is sect1 level -->
89 <xsl:attribute-set name="section.title.level1.properties">
90 <xsl:attribute name="font-size">
91 <xsl:value-of select="$body.font.master * 1.2"></xsl:value-of>
92 <xsl:text>pt</xsl:text>
97 <!-- Fiddling with chapter titles is more messy -->
99 <xsl:template match="title" mode="chapter.titlepage.recto.auto.mode">
100 <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format"
101 xsl:use-attribute-sets="chapter.titlepage.recto.style"
102 margin-left="{$title.margin.left}"
105 font-family="{$title.font.family}">
106 <xsl:call-template name="component.title">
107 <xsl:with-param name="node" select="ancestor-or-self::chapter[1]"/>
112 <xsl:template match="title" mode="chapter.titlepage.verso.auto.mode">
113 <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format"
114 xsl:use-attribute-sets="chapter.titlepage.recto.style"
115 margin-left="{$title.margin.left}"
118 font-family="{$title.font.family}">
119 <xsl:call-template name="component.title">
120 <xsl:with-param name="node" select="ancestor-or-self::chapter[1]"/>
126 <!-- This provides a hard pagebreak mechanism as a get-out -->
128 <xsl:template match="processing-instruction('hard-pagebreak')">
129 <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" break-before='page'>
134 <!-- Sort out the footer. Useful information is available at
135 http://www.sagehill.net/docbookxsl/PrintHeaders.html
139 <xsl:attribute-set name="footer.content.properties">
140 <!-- <xsl:attribute name="font-family">serif</xsl:attribute> -->
141 <!-- <xsl:attribute name="font-size">9pt</xsl:attribute> -->
142 <xsl:attribute name="font-style">italic</xsl:attribute>
146 <!-- Things that can be inserted into the footer are:
149 Inserts the current page number.
151 <xsl:apply-templates select="." mode="title.markup"/>
152 Inserts the title of the current chapter, appendix, or other component.
154 <xsl:apply-templates select="." mode="titleabbrev.markup"/>
155 Inserts the titleabbrev of the current chapter, appendix, or other component,
156 if it is available. Otherwise it inserts the regular title.
158 <xsl:apply-templates select="." mode="object.title.markup"/>
159 Inserts the chapter title with chapter number label. Likewise for appendices.
161 <fo:retrieve-marker ... /> Used to retrieve the current section name.
163 <xsl:apply-templates select="//corpauthor[1]"/>
164 Inserts the value of the first corpauthor element found anywhere in the
167 <xsl:call-template name="datetime.format">
169 Inserts a date timestamp.
171 <xsl:call-template name="draft.text"/>
172 Inserts the Draft message if draft.mode is currently on.
174 <fo:external-graphic ... />
175 Inserts a graphical image.
176 See the section Graphic in header or footer for details.
180 <xsl:template name="footer.content">
181 <xsl:param name="pageclass" select="''"/>
182 <xsl:param name="sequence" select="''"/>
183 <xsl:param name="position" select="''"/>
184 <xsl:param name="gentext-key" select="''"/>
187 <!-- pageclass can be front, body, back -->
188 <!-- sequence can be odd, even, first, blank -->
189 <!-- position can be left, center, right -->
191 <xsl:when test="$pageclass = 'titlepage'">
192 <!-- nop; no footer on title pages -->
195 <xsl:when test="$double.sided != 0 and $sequence = 'even'
196 and $position='left'">
200 <xsl:when test="$double.sided != 0 and ($sequence = 'odd' or $sequence = 'first')
201 and $position='right'">
205 <xsl:when test="$double.sided = 0 and $position='center'">
209 <xsl:when test="$double.sided = 0 and $position='right'">
210 <xsl:apply-templates select="." mode="titleabbrev.markup"/>
213 <xsl:when test="$sequence='blank'">
215 <xsl:when test="$double.sided != 0 and $position = 'left'">
218 <xsl:when test="$double.sided = 0 and $position = 'center'">