hgbook

view stylesheets/fo.xsl @ 1085:b71b3f734904

2.4.2 first para unfinished
author Zhaoping Sun <zhaopingsun@gmail.com>
date Fri Nov 20 23:21:46 2009 -0500 (2009-11-20)
parents a79fb712fe20
children
line source
1 <?xml version="1.0"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:fo="http://www.w3.org/1999/XSL/Format"
4 version='1.0'>
6 <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
8 <xsl:param name="l10n.gentext.language" select="'en'"/>
9 <xsl:param name="paper.type" select="'A4'"></xsl:param>
10 <xsl:param name="draft.mode" select="no"/>
12 <!-- These extensions are required for table printing and other stuff -->
13 <xsl:param name="use.extensions">1</xsl:param>
14 <xsl:param name="callouts.extension">1</xsl:param>
15 <xsl:param name="linenumbering.extension">1</xsl:param>
16 <xsl:param name="tablecolumns.extension">1</xsl:param>
17 <xsl:param name="textinsert.extension">1</xsl:param>
19 <xsl:param name="admon.graphics" select="1" />
20 <xsl:param name="admon.graphics.extension">.png</xsl:param>
21 <xsl:param name="admon.graphics.path">figs/</xsl:param>
22 <xsl:param name="callout.graphics" select="1" />
23 <xsl:param name="callout.graphics.extension">.png</xsl:param>
24 <xsl:param name="callout.graphics.path">images/callouts/</xsl:param>
26 <xsl:param name="section.autolabel" select="1" />
27 <xsl:param name="section.label.includes.component.label">1</xsl:param>
29 <xsl:param name="variablelist.as.blocks" select="1" />
30 <xsl:param name="hyphenate">false</xsl:param>
32 <!-- Font settings, we use characters out of base14 even for english -->
33 <xsl:param name="title.font.family">sans-serif,Arial</xsl:param>
34 <xsl:param name="body.font.family">serif,Times New Roman</xsl:param>
35 <xsl:param name="sans.font.family">sans-serif,Arial</xsl:param>
36 <xsl:param name="dingbat.font.family">serif,Times New Roman</xsl:param>
37 <xsl:param name="monospace.font.family">monospace,Courier New</xsl:param>
38 <xsl:param name="symbol.font.family">Symbol,ZapfDingbats</xsl:param>
40 <!-- Page related settings -->
41 <xsl:param name="page.margin.inner">1.5cm</xsl:param>
42 <xsl:param name="page.margin.outer">1.5cm</xsl:param>
43 <xsl:param name="title.margin.left">0pt</xsl:param>
44 <xsl:param name="body.start.indent">24pt</xsl:param>
45 <xsl:param name="body.end.indent">0pt</xsl:param>
47 <!-- Prevent blank pages in output -->
48 <xsl:template name="book.titlepage.before.verso">
49 </xsl:template>
50 <xsl:template name="book.titlepage.verso">
51 </xsl:template>
52 <xsl:template name="book.titlepage.separator">
53 </xsl:template>
55 <!-- titlepage settings -->
56 <xsl:template name="book.titlepage">
57 <fo:block>
58 <fo:table table-layout="fixed" space-after.optimum="10pt" width="100%">
59 <fo:table-body>
60 <fo:table-row>
61 <fo:table-cell>
62 <fo:block text-align="center">
63 <!--fo:external-graphic src="url(figs/cover-logo.png)"
64 width="90%" height="auto" content-width="scale-to-fit" content-height="scale-to-fit" /-->
65 </fo:block>
66 </fo:table-cell>
67 </fo:table-row>
68 </fo:table-body>
69 </fo:table>
70 </fo:block>
72 <fo:block text-align="center" color="#000000" margin-left="1cm" margin-right="1cm"
73 space-before.optimum="3cm" space-after.optimum="5.0cm"
74 font-weight="900" font-size="32pt">
75 <xsl:attribute name="font-family"><xsl:value-of select="$title.font.family" /></xsl:attribute>
77 <xsl:value-of select="/book/title"/>
78 </fo:block>
80 <fo:block text-align="center" color="#000080" margin-left="1cm" margin-right="1cm"
81 space-before.optimum="2cm" space-after.optimum="8.0cm"
82 font-weight="900" font-size="16pt">
83 <xsl:attribute name="font-family"><xsl:value-of select="$title.font.family" /></xsl:attribute>
85 <xsl:value-of select="/book/subtitle"/>
86 </fo:block>
88 <fo:block text-align="center" color="#000000" margin-left="1cm" margin-right="1cm"
89 space-before.optimum="8cm" space-after.optimum="10cm"
90 font-weight="600" font-size="24pt">
91 <xsl:attribute name="font-family"><xsl:value-of select="$title.font.family" /></xsl:attribute>
93 <xsl:call-template name="person.name.list">
94 <xsl:with-param name="person.list" select="bookinfo/authorgroup/author"/>
95 </xsl:call-template>
96 </fo:block>
98 <!--fo:block text-align="end" color="#666D70" margin-left="1cm" margin-right="1cm"
99 font-family="sans-serif" font-weight="normal" font-size="10pt" >
100 <xsl:value-of select="/book/subtitle"/>
101 </fo:block-->
102 </xsl:template>
104 <!-- title settings -->
105 <xsl:attribute-set name="preface.titlepage.recto.style">
106 <xsl:attribute name="color">#7C1C51</xsl:attribute>
107 </xsl:attribute-set>
108 <xsl:attribute-set name="chapter.titlepage.recto.style">
109 <xsl:attribute name="color">#7C1C51</xsl:attribute>
110 </xsl:attribute-set>
111 <xsl:attribute-set name="section.titlepage.recto.style">
112 <xsl:attribute name="color">#7C1C51</xsl:attribute>
113 </xsl:attribute-set>
114 <xsl:attribute-set name="appendix.titlepage.recto.style">
115 <xsl:attribute name="color">#7C1C51</xsl:attribute>
116 </xsl:attribute-set>
118 <!-- Verbatim related settings -->
119 <xsl:param name="hyphenate.verbatim">0</xsl:param>
121 <xsl:attribute-set name="monospace.properties">
122 <xsl:attribute name="font-family">
123 <xsl:value-of select="$monospace.font.family"/>
124 </xsl:attribute>
125 <xsl:attribute name="color">#000080</xsl:attribute>
126 </xsl:attribute-set>
128 <xsl:attribute-set name="monospace.verbatim.properties"
129 use-attribute-sets="verbatim.properties monospace.properties">
130 <xsl:attribute name="border-color">blue</xsl:attribute>
131 <xsl:attribute name="border-width">thin</xsl:attribute>
132 <xsl:attribute name="border-style">solid</xsl:attribute>
133 <xsl:attribute name="font-size">8pt</xsl:attribute>
134 <xsl:attribute name="wrap-option">wrap</xsl:attribute>
135 <xsl:attribute name="hyphenation-character">&#x25BA;</xsl:attribute>
136 <!--xsl:attribute name="hyphenation-character">&#x27A4;</xsl:attribute-->
137 </xsl:attribute-set>
139 <!-- emphasis settings -->
140 <xsl:template match="emphasis">
141 <xsl:param name="content">
142 <xsl:call-template name="simple.xlink">
143 <xsl:with-param name="content">
144 <xsl:apply-templates/>
145 </xsl:with-param>
146 </xsl:call-template>
147 </xsl:param>
149 <fo:inline color="#7C1C51" font-weight="bold">
150 <xsl:copy-of select="$content"/>
151 </fo:inline>
152 </xsl:template>
154 <!-- Colourize links in output -->
155 <xsl:attribute-set name="xref.properties">
156 <xsl:attribute name="color">
157 <xsl:choose>
158 <xsl:when test="self::ulink">blue</xsl:when>
159 <xsl:when test="self::xref">blue</xsl:when>
160 <xsl:when test="self::uri">blue</xsl:when>
161 <xsl:otherwise>red</xsl:otherwise>
162 </xsl:choose>
163 </xsl:attribute>
164 </xsl:attribute-set>
166 </xsl:stylesheet>