Debian Codegraph @

doc/resources/docbook-xsl/fo.xsl

raw symbols SCIP
1 <!--
2 Generates single FO document from DocBook XML source using DocBook XSL
3 stylesheets.
4
5 See xsl-stylesheets/fo/param.xsl for all parameters.
6
7 NOTE: The URL reference to the current DocBook XSL stylesheets is
8 rewritten to point to the copy on the local disk drive by the XML catalog
9 rewrite directives so it doesn't need to go out to the Internet for the
10 stylesheets. This means you don't need to edit the <xsl:import> elements on
11 a machine by machine basis.
12 -->
13 <xsl:stylesheet version="1.0"
14 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
15 xmlns:fo="http://www.w3.org/1999/XSL/Format">
16 <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
17 <xsl:import href="common.xsl"/>
18
19 <xsl:param name="fop1.extensions" select="1" />
20 <xsl:param name="variablelist.as.blocks" select="1" />
21
22 <xsl:param name="paper.type" select="'A4'"/>
23 <!--
24 <xsl:param name="paper.type" select="'USletter'"/>
25 -->
26 <xsl:param name="hyphenate">false</xsl:param>
27 <!-- justify, left or right -->
28 <xsl:param name="alignment">left</xsl:param>
29
30 <xsl:param name="body.font.family" select="'serif'"/>
31 <xsl:param name="body.font.master">12</xsl:param>
32 <xsl:param name="body.font.size">
33 <xsl:value-of select="$body.font.master"/><xsl:text>pt</xsl:text>
34 </xsl:param>
35
36 <xsl:param name="body.margin.bottom" select="'0.5in'"/>
37 <xsl:param name="body.margin.top" select="'0.5in'"/>
38 <xsl:param name="bridgehead.in.toc" select="0"/>
39
40 <!-- overide setting in common.xsl -->
41 <xsl:param name="table.frame.border.thickness" select="'2px'"/>
42
43 <!-- Default fetches image from Internet (long timeouts) -->
44 <xsl:param name="draft.watermark.image" select="''"/>
45
46 <!-- Line break -->
47 <xsl:template match="processing-instruction('asciidoc-br')">
48 <fo:block/>
49 </xsl:template>
50
51 <!-- Horizontal ruler -->
52 <xsl:template match="processing-instruction('asciidoc-hr')">
53 <fo:block space-after="1em">
54 <fo:leader leader-pattern="rule" rule-thickness="0.5pt" rule-style="solid" leader-length.minimum="100%"/>
55 </fo:block>
56 </xsl:template>
57
58 <!-- Hard page break -->
59 <xsl:template match="processing-instruction('asciidoc-pagebreak')">
60 <fo:block break-after='page'/>
61 </xsl:template>
62
63 <!-- Sets title to body text indent -->
64 <xsl:param name="body.start.indent">
65 <xsl:choose>
66 <xsl:when test="$fop.extensions != 0">0pt</xsl:when>
67 <xsl:when test="$passivetex.extensions != 0">0pt</xsl:when>
68 <xsl:otherwise>0pt</xsl:otherwise>
69 </xsl:choose>
70 </xsl:param>
71 <xsl:param name="title.margin.left">
72 <xsl:choose>
73 <xsl:when test="$fop.extensions != 0">-1pc</xsl:when>
74 <xsl:when test="$passivetex.extensions != 0">0pt</xsl:when>
75 <xsl:otherwise>0pt</xsl:otherwise>
76 </xsl:choose>
77 </xsl:param>
78 <xsl:param name="page.margin.bottom" select="'0.25in'"/>
79 <xsl:param name="page.margin.inner">
80 <xsl:choose>
81 <xsl:when test="$double.sided != 0">0.75in</xsl:when>
82 <xsl:otherwise>0.75in</xsl:otherwise>
83 </xsl:choose>
84 </xsl:param>
85 <xsl:param name="page.margin.outer">
86 <xsl:choose>
87 <xsl:when test="$double.sided != 0">0.5in</xsl:when>
88 <xsl:otherwise>0.5in</xsl:otherwise>
89 </xsl:choose>
90 </xsl:param>
91
92 <xsl:param name="page.margin.top" select="'0.5in'"/>
93 <xsl:param name="page.orientation" select="'portrait'"/>
94 <xsl:param name="page.width">
95 <xsl:choose>
96 <xsl:when test="$page.orientation = 'portrait'">
97 <xsl:value-of select="$page.width.portrait"/>
98 </xsl:when>
99 <xsl:otherwise>
100 <xsl:value-of select="$page.height.portrait"/>
101 </xsl:otherwise>
102 </xsl:choose>
103 </xsl:param>
104
105 <xsl:attribute-set name="monospace.properties">
106 <xsl:attribute name="font-size">10pt</xsl:attribute>
107 </xsl:attribute-set>
108
109 <xsl:attribute-set name="admonition.title.properties">
110 <xsl:attribute name="font-size">14pt</xsl:attribute>
111 <xsl:attribute name="font-weight">bold</xsl:attribute>
112 <xsl:attribute name="hyphenate">false</xsl:attribute>
113 <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
114 </xsl:attribute-set>
115
116 <xsl:attribute-set name="sidebar.properties" use-attribute-sets="formal.object.properties">
117 <xsl:attribute name="border-style">solid</xsl:attribute>
118 <xsl:attribute name="border-width">1pt</xsl:attribute>
119 <xsl:attribute name="border-color">silver</xsl:attribute>
120 <xsl:attribute name="background-color">#ffffee</xsl:attribute>
121 <xsl:attribute name="padding-left">12pt</xsl:attribute>
122 <xsl:attribute name="padding-right">12pt</xsl:attribute>
123 <xsl:attribute name="padding-top">6pt</xsl:attribute>
124 <xsl:attribute name="padding-bottom">6pt</xsl:attribute>
125 <xsl:attribute name="margin-left">0pt</xsl:attribute>
126 <xsl:attribute name="margin-right">12pt</xsl:attribute>
127 <xsl:attribute name="margin-top">6pt</xsl:attribute>
128 <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
129 </xsl:attribute-set>
130
131 <xsl:param name="callout.graphics" select="'1'"/>
132
133 <!-- Only shade programlisting and screen verbatim elements -->
134 <xsl:param name="shade.verbatim" select="1"/>
135 <xsl:attribute-set name="shade.verbatim.style">
136 <xsl:attribute name="background-color">
137 <xsl:choose>
138 <xsl:when test="self::programlisting|self::screen">#f8f8f8</xsl:when>
139 <xsl:otherwise>inherit</xsl:otherwise>
140 </xsl:choose>
141 </xsl:attribute>
142 </xsl:attribute-set>
143 <xsl:attribute-set name="verbatim.properties">
144 <xsl:attribute name="border-left-style">solid</xsl:attribute>
145 <xsl:attribute name="border-left-width">2pt</xsl:attribute>
146 <xsl:attribute name="border-left-color">#CC7777</xsl:attribute>
147 <xsl:attribute name="margin-left">1pt</xsl:attribute>
148 <xsl:attribute name="margin-right">0pt</xsl:attribute>
149 <xsl:attribute name="padding-left">4pt</xsl:attribute>
150 <xsl:attribute name="padding-top">2pt</xsl:attribute>
151 <xsl:attribute name="padding-bottom">2pt</xsl:attribute>
152 </xsl:attribute-set>
153
154 <xsl:attribute-set name="component.title.properties">
155 <xsl:attribute name="font-size">16pt</xsl:attribute>
156 </xsl:attribute-set>
157 <xsl:attribute-set name="section.title.level1.properties">
158 <xsl:attribute name="font-size">14pt</xsl:attribute>
159 </xsl:attribute-set>
160 <xsl:attribute-set name="section.title.level2.properties">
161 <xsl:attribute name="font-size">13pt</xsl:attribute>
162 </xsl:attribute-set>
163 <xsl:attribute-set name="section.title.level3.properties">
164 <xsl:attribute name="font-size">12.2pt</xsl:attribute>
165 </xsl:attribute-set>
166 <xsl:attribute-set name="normal.para.spacing">
167 <xsl:attribute name="space-before.optimum">0.4em</xsl:attribute>
168 <xsl:attribute name="space-before.minimum">0.5em</xsl:attribute>
169 <xsl:attribute name="space-before.maximum">0.6em</xsl:attribute>
170 </xsl:attribute-set>
171
172 <!--
173 Force XSL Stylesheets 1.72 default table breaks to be the same as the current
174 version (1.74) default which (for tables) is keep-together="auto".
175 -->
176 <xsl:attribute-set name="table.properties">
177 <xsl:attribute name="keep-together.within-column">auto</xsl:attribute>
178 </xsl:attribute-set>
179
180 <!-- Give links a colour -->
181 <xsl:attribute-set name="xref.properties">
182 <xsl:attribute name="color">#0000dd</xsl:attribute>
183 </xsl:attribute-set>
184
185 <xsl:template match="fo:inline|fo:block">
186 <xsl:copy-of select=".">
187 </xsl:copy-of>
188 </xsl:template>
189
190 </xsl:stylesheet>