source: stylesheets/lfs-xsl/pdf/lfs-mixed.xsl@ 4c0c012

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 4c0c012 was 4c0c012, checked in by Bruce Dubbs <bdubbs@…>, 15 years ago

Reformatted several pages so pdf is properly generated.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@8781 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 14.3 KB
Line 
1<?xml version='1.0' encoding='ISO-8859-1'?>
2
3<!--
4$LastChangedBy$
5$Date$
6-->
7
8<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
9 xmlns:fo="http://www.w3.org/1999/XSL/Format"
10 version="1.0">
11
12 <!-- This stylesheet contains misc params, attribute sets and templates
13 for output formating.
14 This file is for that templates that don't fit in other files. -->
15
16 <!-- What space do you want between normal paragraphs. -->
17 <xsl:attribute-set name="normal.para.spacing">
18 <xsl:attribute name="space-before.optimum">0.6em</xsl:attribute>
19 <xsl:attribute name="space-before.minimum">0.4em</xsl:attribute>
20 <xsl:attribute name="space-before.maximum">0.8em</xsl:attribute>
21 <xsl:attribute name="orphans">3</xsl:attribute>
22 <xsl:attribute name="widows">3</xsl:attribute>
23 </xsl:attribute-set>
24
25 <!-- Properties associated with verbatim text. -->
26 <xsl:attribute-set name="verbatim.properties">
27 <xsl:attribute name="keep-with-previous.within-column">always</xsl:attribute>
28 <xsl:attribute name="space-before.optimum">0.6em</xsl:attribute>
29 <xsl:attribute name="space-before.minimum">0.4em</xsl:attribute>
30 <xsl:attribute name="space-before.maximum">0.8em</xsl:attribute>
31 <xsl:attribute name="space-after.optimum">0.6em</xsl:attribute>
32 <xsl:attribute name="space-after.minimum">0.4em</xsl:attribute>
33 <xsl:attribute name="space-after.maximum">0.8em</xsl:attribute>
34 <xsl:attribute name="hyphenate">false</xsl:attribute>
35 <xsl:attribute name="wrap-option">no-wrap</xsl:attribute>
36 <xsl:attribute name="white-space-collapse">false</xsl:attribute>
37 <xsl:attribute name="white-space-treatment">preserve</xsl:attribute>
38 <xsl:attribute name="linefeed-treatment">preserve</xsl:attribute>
39 <xsl:attribute name="text-align">start</xsl:attribute>
40 </xsl:attribute-set>
41
42 <!-- Should verbatim environments be shaded? 1 =yes, 0 = no -->
43 <xsl:param name="shade.verbatim" select="1"/>
44
45 <!-- Properties that specify the style of shaded verbatim listings -->
46 <xsl:attribute-set name="shade.verbatim.style">
47 <xsl:attribute name="background-color">#E9E9E9</xsl:attribute>
48 <xsl:attribute name="border-style">solid</xsl:attribute>
49 <xsl:attribute name="border-width">0.5pt</xsl:attribute>
50 <xsl:attribute name="border-color">#888</xsl:attribute>
51 <xsl:attribute name="padding-start">5pt</xsl:attribute>
52 <xsl:attribute name="padding-top">2pt</xsl:attribute>
53 <xsl:attribute name="padding-bottom">2pt</xsl:attribute>
54 </xsl:attribute-set>
55
56 <!-- para:
57 Skip empty "Home page" in packages.xml.
58 Allow forced line breaks inside paragraphs emulating literallayout.
59 Removed vertical space in variablelist. -->
60 <!-- The original template is in {docbook-xsl}/fo/block.xsl -->
61 <xsl:template match="para">
62 <xsl:choose>
63 <xsl:when test="child::ulink[@url=' ']"/>
64 <xsl:when test="./@remap='verbatim'">
65 <fo:block xsl:use-attribute-sets="verbatim.properties">
66 <xsl:call-template name="anchor"/>
67 <xsl:apply-templates/>
68 </fo:block>
69 </xsl:when>
70 <xsl:when test="ancestor::variablelist">
71 <fo:block>
72 <xsl:attribute name="space-before.optimum">0.1em</xsl:attribute>
73 <xsl:attribute name="space-before.minimum">0em</xsl:attribute>
74 <xsl:attribute name="space-before.maximum">0.2em</xsl:attribute>
75 <xsl:call-template name="anchor"/>
76 <xsl:apply-templates/>
77 </fo:block>
78 </xsl:when>
79 <xsl:otherwise>
80 <fo:block xsl:use-attribute-sets="normal.para.spacing">
81 <xsl:call-template name="anchor"/>
82 <xsl:apply-templates/>
83 </fo:block>
84 </xsl:otherwise>
85 </xsl:choose>
86 </xsl:template>
87
88 <!-- screen, literallayout:
89 Self-made template that creates a fo:block wrapper with keep-together
90 processing instruction support around the output generated by
91 original screen templates. -->
92 <xsl:template match="screen|literallayout">
93 <xsl:variable name="keep.together">
94 <xsl:call-template name="pi.dbfo_keep-together"/>
95 </xsl:variable>
96 <fo:block>
97 <xsl:attribute name="keep-together.within-column">
98 <xsl:choose>
99 <xsl:when test="$keep.together != ''">
100 <xsl:value-of select="$keep.together"/>
101 </xsl:when>
102
103<!-- The following section has been modified by Martin Miehe. Page breaks
104 should be allowed within the long script listings in the appendices.
105
106 <xsl:otherwise>always</xsl:otherwise>
107-->
108 <xsl:otherwise>
109 <xsl:choose>
110 <xsl:when test="ancestor::appendix">auto</xsl:when>
111 <xsl:otherwise>always</xsl:otherwise>
112 </xsl:choose>
113 </xsl:otherwise>
114<!-- End of modification -->
115
116 </xsl:choose>
117 </xsl:attribute>
118
119<!-- The following lines were inserted by Martin Miehe. Scripts and rules
120 in the appendices should have a smaller font-size so that at least
121 80 characters fit to one line. -->
122
123 <xsl:if test="ancestor::appendix"> <!-- name(/) != appendix" -->
124 <xsl:attribute name="font-size">10pt</xsl:attribute>
125 </xsl:if>
126<!-- End of insertion. -->
127
128 <xsl:apply-imports/>
129 </fo:block>
130 </xsl:template>
131
132 <!-- literal:
133 Be sure that literal will use allways normal font weight. -->
134 <!-- The original template is in {docbook-xsl}/fo/inline.xsl -->
135 <xsl:template match="literal">
136 <fo:inline font-weight="normal">
137 <xsl:call-template name="inline.monoseq"/>
138 </fo:inline>
139 </xsl:template>
140
141 <!-- inline.monoseq:
142 Added hyphenate-url support to classname, exceptionname, interfacename,
143 methodname, computeroutput, constant, envar, filename, function, code,
144 literal, option, promt, systemitem, varname, sgmltag, tag, and uri -->
145 <!-- The original template is in {docbook-xsl}/fo/inline.xsl -->
146 <xsl:template name="inline.monoseq">
147 <xsl:param name="content">
148 <xsl:call-template name="simple.xlink">
149 <xsl:with-param name="content">
150 <xsl:choose>
151 <xsl:when test="ancestor::para and not(ancestor::screen)
152 and not(descendant::ulink)">
153 <xsl:call-template name="hyphenate-url">
154 <xsl:with-param name="url">
155 <xsl:apply-templates/>
156 </xsl:with-param>
157 </xsl:call-template>
158 </xsl:when>
159 <xsl:otherwise>
160 <xsl:apply-templates/>
161 </xsl:otherwise>
162 </xsl:choose>
163 </xsl:with-param>
164 </xsl:call-template>
165 </xsl:param>
166 <fo:inline xsl:use-attribute-sets="monospace.properties">
167 <xsl:if test="@dir">
168 <xsl:attribute name="direction">
169 <xsl:choose>
170 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
171 <xsl:otherwise>rtl</xsl:otherwise>
172 </xsl:choose>
173 </xsl:attribute>
174 </xsl:if>
175 <xsl:copy-of select="$content"/>
176 </fo:inline>
177 </xsl:template>
178
179 <!-- inline.italicmonoseq:
180 Added hyphenate-url support to parameter, replaceable, structfield,
181 function/parameter, and function/replaceable -->
182 <!-- The original template is in {docbook-xsl}/fo/inline.xsl -->
183 <xsl:template name="inline.italicmonoseq">
184 <xsl:param name="content">
185 <xsl:call-template name="simple.xlink">
186 <xsl:with-param name="content">
187 <xsl:choose>
188 <xsl:when test="ancestor::para and not(ancestor::screen)
189 and not(descendant::ulink)">
190 <xsl:call-template name="hyphenate-url">
191 <xsl:with-param name="url">
192 <xsl:apply-templates/>
193 </xsl:with-param>
194 </xsl:call-template>
195 </xsl:when>
196 <xsl:otherwise>
197 <xsl:apply-templates/>
198 </xsl:otherwise>
199 </xsl:choose>
200 </xsl:with-param>
201 </xsl:call-template>
202 </xsl:param>
203 <fo:inline font-style="italic" xsl:use-attribute-sets="monospace.properties">
204 <xsl:call-template name="anchor"/>
205 <xsl:if test="@dir">
206 <xsl:attribute name="direction">
207 <xsl:choose>
208 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
209 <xsl:otherwise>rtl</xsl:otherwise>
210 </xsl:choose>
211 </xsl:attribute>
212 </xsl:if>
213 <xsl:copy-of select="$content"/>
214 </fo:inline>
215 </xsl:template>
216
217 <!-- Show external URLs in italic font -->
218 <xsl:attribute-set name="xref.properties">
219 <xsl:attribute name="font-style">
220 <xsl:choose>
221 <xsl:when test="self::ulink">italic</xsl:when>
222 <xsl:otherwise>inherit</xsl:otherwise>
223 </xsl:choose>
224 </xsl:attribute>
225 </xsl:attribute-set>
226
227 <!-- Center table title. -->
228 <xsl:attribute-set name="formal.title.properties">
229 <xsl:attribute name="text-align">
230 <xsl:choose>
231 <xsl:when test="local-name(.) = 'table'">center</xsl:when>
232 <xsl:otherwise>left</xsl:otherwise>
233 </xsl:choose>
234 </xsl:attribute>
235 </xsl:attribute-set>
236
237 <!-- table.layout:
238 We want all tables centered. Based on a hack posted
239 by Ellen Juhlin on docbook-apps mailing list. -->
240 <!-- The original template is in {docbook-xsl}/fo/table.xsl -->
241 <xsl:template name="table.layout">
242 <xsl:param name="table.content" select="NOTANODE"/>
243 <fo:table table-layout="fixed" width="100%">
244 <fo:table-column column-width ="proportional-column-width(1)"/>
245 <fo:table-column>
246 <!-- Set center column width equal to table width -->
247 <xsl:attribute name="column-width">
248 <xsl:call-template name="table.width"/>
249 </xsl:attribute>
250 </fo:table-column>
251 <fo:table-column column-width ="proportional-column-width(1)"/>
252 <fo:table-body>
253 <fo:table-row>
254 <fo:table-cell column-number="2">
255 <xsl:copy-of select="$table.content"/>
256 </fo:table-cell>
257 </fo:table-row>
258 </fo:table-body>
259 </fo:table>
260 </xsl:template>
261
262
263 <!-- Revision History -->
264
265 <!-- revhistory titlepage:
266 Self-made template to add missing support on bookinfo. -->
267 <xsl:template match="revhistory" mode="book.titlepage.verso.auto.mode">
268 <fo:block space-before.optimum="2em"
269 space-before.minimum="1.5em"
270 space-before.maximum="2.5em">
271 <xsl:apply-templates select="." mode="book.titlepage.verso.mode"/>
272 </fo:block>
273 </xsl:template>
274
275 <!-- revhitory title properties -->
276 <xsl:attribute-set name="revhistory.title.properties">
277 <xsl:attribute name="text-align">center</xsl:attribute>
278 <xsl:attribute name="font-weight">bold</xsl:attribute>
279 </xsl:attribute-set>
280
281 <!-- revhistory/revision mode titlepage.mode:
282 Removed authorinitials | author support placing
283 revremark | revdescription instead on that table-cell. -->
284 <!-- The original template is in {docbook-xsl}/fo/titlepage.xsl -->
285 <xsl:template match="revhistory/revision" mode="titlepage.mode">
286 <xsl:variable name="revnumber" select="revnumber"/>
287 <xsl:variable name="revdate" select="date"/>
288 <xsl:variable name="revremark" select="revremark|revdescription"/>
289 <fo:table-row>
290 <fo:table-cell xsl:use-attribute-sets="revhistory.table.cell.properties">
291 <fo:block>
292 <xsl:if test="$revnumber">
293 <xsl:call-template name="gentext">
294 <xsl:with-param name="key" select="'Revision'"/>
295 </xsl:call-template>
296 <xsl:call-template name="gentext.space"/>
297 <xsl:apply-templates select="$revnumber[1]" mode="titlepage.mode"/>
298 </xsl:if>
299 </fo:block>
300 </fo:table-cell>
301 <fo:table-cell xsl:use-attribute-sets="revhistory.table.cell.properties">
302 <fo:block>
303 <xsl:apply-templates select="$revdate[1]"/>
304 </fo:block>
305 </fo:table-cell>
306 <fo:table-cell xsl:use-attribute-sets="revhistory.table.cell.properties">
307 <fo:block>
308 <xsl:apply-templates select="$revremark[1]"/>
309 </fo:block>
310 </fo:table-cell>
311 </fo:table-row>
312 </xsl:template>
313
314
315 <!-- Dummy sect1 -->
316
317 <!-- sect1:
318 Self-made template to skip dummy sect1 pages generation. -->
319 <xsl:template match="sect1">
320 <xsl:choose>
321 <xsl:when test="@role = 'dummy'"/>
322 <xsl:otherwise>
323 <xsl:apply-imports/>
324 </xsl:otherwise>
325 </xsl:choose>
326 </xsl:template>
327
328 <!-- sect1 mode fop1.outline:
329 Self-made template to skip dummy sect1 bookmarks generation. -->
330 <xsl:template match="sect1" mode="fop1.outline">
331 <xsl:choose>
332 <xsl:when test="@role = 'dummy'"/>
333 <xsl:otherwise>
334 <xsl:apply-imports/>
335 </xsl:otherwise>
336 </xsl:choose>
337 </xsl:template>
338
339 <!-- toc.line:
340 For dummy sect1 output only the title. -->
341 <!-- The original template is in {docbook-xsl}/fo/autotoc.xsl -->
342 <xsl:template name="toc.line">
343 <xsl:param name="toc-context" select="NOTANODE"/>
344 <xsl:variable name="id">
345 <xsl:call-template name="object.id"/>
346 </xsl:variable>
347 <xsl:variable name="label">
348 <xsl:apply-templates select="." mode="label.markup"/>
349 </xsl:variable>
350 <xsl:choose>
351 <xsl:when test="@role = 'dummy'">
352 <fo:block text-align="left">
353 <xsl:apply-templates select="." mode="titleabbrev.markup"/>
354 </fo:block>
355 </xsl:when>
356 <xsl:otherwise>
357 <fo:block xsl:use-attribute-sets="toc.line.properties">
358 <fo:inline keep-with-next.within-line="always">
359 <fo:basic-link internal-destination="{$id}">
360 <xsl:if test="$label != ''">
361 <xsl:copy-of select="$label"/>
362 <xsl:value-of select="$autotoc.label.separator"/>
363 </xsl:if>
364 <xsl:apply-templates select="." mode="titleabbrev.markup"/>
365 </fo:basic-link>
366 </fo:inline>
367 <fo:inline keep-together.within-line="always">
368 <xsl:text> </xsl:text>
369 <fo:leader leader-pattern="dots"
370 leader-pattern-width="3pt"
371 leader-alignment="reference-area"
372 keep-with-next.within-line="always"/>
373 <xsl:text> </xsl:text>
374 <fo:basic-link internal-destination="{$id}">
375 <fo:page-number-citation ref-id="{$id}"/>
376 </fo:basic-link>
377 </fo:inline>
378 </fo:block>
379 </xsl:otherwise>
380 </xsl:choose>
381 </xsl:template>
382
383</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.