annotate xsl/fo.xsl @ 723:3c5e1c03cc3e

Add XSL stylesheets for DocBook
author Dongsheng Song <dongsheng.song@gmail.com>
date Thu, 12 Mar 2009 15:47:15 +0800
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
723
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
1 <?xml version="1.0"?>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
3
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
4 <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
5
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
6 <xsl:param name="draft.mode" select="no"/>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
7
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
8 <!-- These extensions are required for table printing and other stuff -->
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
9 <xsl:param name="use.extensions">1</xsl:param>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
10 <xsl:param name="callouts.extension">1</xsl:param>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
11 <xsl:param name="linenumbering.extension">1</xsl:param>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
12 <xsl:param name="tablecolumns.extension">1</xsl:param>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
13 <xsl:param name="textinsert.extension">1</xsl:param>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
14
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
15 <xsl:param name="admon.graphics" select="1" />
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
16 <xsl:param name="admon.graphics.extension">.png</xsl:param>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
17 <xsl:param name="callout.graphics" select="1" />
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
18 <xsl:param name="callout.graphics.extension">.png</xsl:param>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
19
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
20 <xsl:param name="section.autolabel" select="1" />
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
21 <xsl:param name="section.label.includes.component.label">1</xsl:param>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
22
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
23 <xsl:param name="variablelist.as.blocks" select="1" /> <!-- fo only -->
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
24 <xsl:param name="hyphenate">false</xsl:param> <!-- fo only -->
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
25 <xsl:param name="paper.type" select="'A4'"></xsl:param> <!-- fo only -->
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
26
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
27 <!-- Default font settings -->
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
28 <!--
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
29 <xsl:param name="title.font.family">sans-serif</xsl:param>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
30 <xsl:param name="body.font.family">serif</xsl:param>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
31 <xsl:param name="sans.font.family">sans-serif</xsl:param>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
32 <xsl:param name="dingbat.font.family">serif</xsl:param>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
33 <xsl:param name="monospace.font.family">monospace</xsl:param>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
34 <xsl:param name="symbol.font.family">Symbol,ZapfDingbats</xsl:param>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
35 -->
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
36
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
37 <!-- Custom font settings - preferred truetype font -->
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
38 <xsl:param name="title.font.family">Calibri,sans-serif,SimHei</xsl:param>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
39 <xsl:param name="body.font.family">Cambria,Cambria Math,serif,SimSun</xsl:param>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
40 <xsl:param name="sans.font.family">Calibri,sans-serif,SimHei</xsl:param>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
41 <xsl:param name="dingbat.font.family">Cambria,Cambria Math,serif,SimSun</xsl:param>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
42 <xsl:param name="monospace.font.family">Courier New,monospace,FangSong</xsl:param>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
43
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
44 <!-- Page related Settings -->
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
45 <xsl:param name="page.margin.inner">1.5cm</xsl:param>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
46 <xsl:param name="page.margin.outer">1.5cm</xsl:param>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
47 <xsl:param name="title.margin.left">0pt</xsl:param>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
48 <xsl:param name="body.start.indent">24pt</xsl:param>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
49 <xsl:param name="body.end.indent">0pt</xsl:param>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
50
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
51 <!-- Breaking long lines -->
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
52 <xsl:param name="hyphenate.verbatim">1</xsl:param>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
53 <xsl:attribute-set name="monospace.verbatim.properties"
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
54 use-attribute-sets="verbatim.properties monospace.properties">
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
55 <xsl:attribute name="wrap-option">wrap</xsl:attribute>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
56 <xsl:attribute name="hyphenation-character">&#x25BA;</xsl:attribute>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
57 </xsl:attribute-set>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
58
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
59 <!-- Prevent blank pages in output -->
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
60 <xsl:template name="book.titlepage.before.verso">
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
61 </xsl:template>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
62 <xsl:template name="book.titlepage.verso">
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
63 </xsl:template>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
64 <xsl:template name="book.titlepage.separator">
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
65 </xsl:template>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
66
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
67 <!-- Colourize links in output -->
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
68 <xsl:attribute-set name="xref.properties">
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
69 <xsl:attribute name="color">
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
70 <xsl:choose>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
71 <xsl:when test="self::ulink">blue</xsl:when>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
72 <xsl:when test="self::xref">blue</xsl:when>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
73 <xsl:when test="self::uri">blue</xsl:when>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
74 <xsl:otherwise>red</xsl:otherwise>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
75 </xsl:choose>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
76 </xsl:attribute>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
77 </xsl:attribute-set>
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
78
3c5e1c03cc3e Add XSL stylesheets for DocBook
Dongsheng Song <dongsheng.song@gmail.com>
parents:
diff changeset
79 </xsl:stylesheet>