source: stylesheets/pdf/lfs-mixed.xsl@ 3523830

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 3523830 was 3523830, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Removed blank pages on PDF output.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@4964 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 10.2 KB
Line 
1<?xml version='1.0' encoding='ISO-8859-1'?>
2
3<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:fo="http://www.w3.org/1999/XSL/Format"
5 version="1.0">
6
7
8 <!-- This is a hack and isn't correct semantically. Theoretically, the beginpage
9 tags should be placed in the XML source only to render the PDF output and
10 should be removed after it. But there is no a better way and we need this.-->
11 <xsl:template match="beginpage">
12 <fo:block break-after="page"/>
13 </xsl:template>
14
15 <!-- Allow forced line breaks inside paragraphs emulating literallayout. -->
16 <xsl:template match="para">
17 <xsl:choose>
18 <xsl:when test="./@remap='verbatim'">
19 <fo:block wrap-option="no-wrap"
20 white-space-collapse="false"
21 white-space-treatment="preserve"
22 text-align="start"
23 linefeed-treatment="preserve">
24 <xsl:call-template name="anchor"/>
25 <xsl:apply-templates/>
26 </fo:block>
27 </xsl:when>
28 <xsl:otherwise>
29 <xsl:apply-imports/>
30 </xsl:otherwise>
31 </xsl:choose>
32 </xsl:template>
33
34 <!-- Show URLs in italic font -->
35 <!--<xsl:template match="ulink" name="ulink">
36 <fo:inline font-style="italic">
37 <fo:basic-link xsl:use-attribute-sets="xref.properties">
38 <xsl:attribute name="external-destination">
39 <xsl:call-template name="fo-external-image">
40 <xsl:with-param name="filename" select="@url"/>
41 </xsl:call-template>
42 </xsl:attribute>
43 <xsl:choose>
44 <xsl:when test="count(child::node())=0">
45 <xsl:call-template name="hyphenate-url">
46 <xsl:with-param name="url" select="@url"/>
47 </xsl:call-template>
48 </xsl:when>
49 <xsl:otherwise>
50 <xsl:apply-templates/>
51 </xsl:otherwise>
52 </xsl:choose>
53 </fo:basic-link>
54 </fo:inline>
55 <xsl:if test="count(child::node()) != 0
56 and string(.) != @url
57 and $ulink.show != 0">-->
58 <!-- yes, show the URI -->
59 <!-- <xsl:choose>
60 <xsl:when test="$ulink.footnotes != 0 and not(ancestor::footnote)">
61 <xsl:text>&#xA0;</xsl:text>
62 <fo:footnote>
63 <xsl:call-template name="ulink.footnote.number"/>
64 <fo:footnote-body font-family="{$body.fontset}"
65 font-size="{$footnote.font.size}">
66 <fo:block>
67 <xsl:call-template name="ulink.footnote.number"/>
68 <xsl:text> </xsl:text>
69 <fo:inline>
70 <xsl:value-of select="@url"/>
71 </fo:inline>
72 </fo:block>
73 </fo:footnote-body>
74 </fo:footnote>
75 </xsl:when>
76 <xsl:otherwise>
77 <fo:inline hyphenate="false">
78 <xsl:text> [</xsl:text>
79 <xsl:call-template name="hyphenate-url">
80 <xsl:with-param name="url" select="@url"/>
81 </xsl:call-template>
82 <xsl:text>]</xsl:text>
83 </fo:inline>
84 </xsl:otherwise>
85 </xsl:choose>
86 </xsl:if>
87 </xsl:template>-->
88
89 <!-- Split URLs (obsolete, keeped as reference) -->
90 <!--<xsl:template name="hyphenate-url">
91 <xsl:param name="url" select="''"/>
92 <xsl:choose>
93 <xsl:when test="ancestor::varlistentry">
94 <xsl:choose>
95 <xsl:when test="string-length($url) > 90">
96 <xsl:value-of select="substring($url, 1, 50)"/>
97 <xsl:param name="rest" select="substring($url, 51)"/>
98 <xsl:value-of select="substring-before($rest, '/')"/>
99 <xsl:text> /</xsl:text>
100 <xsl:value-of select="substring-after($rest, '/')"/>
101 </xsl:when>
102 <xsl:otherwise>
103 <xsl:value-of select="$url"/>
104 </xsl:otherwise>
105 </xsl:choose>
106 </xsl:when>
107 <xsl:otherwise>
108 <xsl:value-of select="$url"/>-->
109 <!-- <xsl:value-of select="substring-before($url, '//')"/>
110 <xsl:text>// </xsl:text>
111 <xsl:call-template name="split-url">
112 <xsl:with-param name="url2" select="substring-after($url, '//')"/>
113 </xsl:call-template>-->
114 <!-- </xsl:otherwise>
115 </xsl:choose>
116 </xsl:template>-->
117
118 <!--<xsl:template name="split-url">
119 <xsl:choose>
120 <xsl:when test="contains($url2, '/')">
121 <xsl:param name="url2" select="''"/>
122 <xsl:value-of select="substring-before($url2, '/')"/>
123 <xsl:text> /</xsl:text>
124 <xsl:call-template name="split-url">
125 <xsl:with-param name="url2" select="substring-after($url2, '/')"/>
126 </xsl:call-template>
127 </xsl:when>
128 <xsl:otherwise>
129 <xsl:value-of select="$url2"/>
130 </xsl:otherwise>
131 </xsl:choose>
132 </xsl:template>-->
133
134 <!-- Shade screen -->
135 <xsl:param name="shade.verbatim" select="1"/>
136
137 <!-- How is rendered by default a variablelist -->
138 <xsl:param name="variablelist.as.blocks" select="1"/>
139 <xsl:param name="variablelist.max.termlength">32</xsl:param>
140
141 <!-- Making the same look that in the XHTML output. -->
142 <xsl:template match="segmentedlist">
143 <!--<xsl:variable name="presentation">
144 <xsl:call-template name="pi-attribute">
145 <xsl:with-param name="pis"
146 select="processing-instruction('dbfo')"/>
147 <xsl:with-param name="attribute" select="'list-presentation'"/>
148 </xsl:call-template>
149 </xsl:variable>
150 <xsl:choose>
151 <xsl:when test="$presentation = 'table'">
152 <xsl:apply-templates select="." mode="seglist-table"/>
153 </xsl:when>
154 <xsl:when test="$presentation = 'list'">
155 <fo:block space-before.minimum="0.4em" space-before.optimum="0.6em"
156 space-before.maximum="0.8em">
157 <xsl:apply-templates/>
158 </fo:block>
159 </xsl:when>
160 <xsl:when test="$segmentedlist.as.table != 0">
161 <xsl:apply-templates select="." mode="seglist-table"/>
162 </xsl:when>
163 <xsl:otherwise>-->
164 <fo:list-block provisional-distance-between-starts="11em"
165 provisional-label-separation="1em"
166 xsl:use-attribute-sets="list.block.spacing">
167 <xsl:apply-templates/>
168 </fo:list-block>
169 <!--</xsl:otherwise>
170 </xsl:choose>-->
171 </xsl:template>
172
173 <xsl:template match="seglistitem">
174 <xsl:apply-templates/>
175 </xsl:template>
176
177 <xsl:template match="seg">
178 <xsl:variable name="segnum" select="count(preceding-sibling::seg)+1"/>
179 <xsl:variable name="seglist" select="ancestor::segmentedlist"/>
180 <xsl:variable name="segtitles" select="$seglist/segtitle"/>
181 <!-- Note: segtitle is only going to be the right thing in a well formed
182 SegmentedList. If there are too many Segs or too few SegTitles,
183 you'll get something odd...maybe an error -->
184 <fo:list-item xsl:use-attribute-sets="list.item.spacing">
185 <fo:list-item-label end-indent="label-end()" text-align="start">
186 <fo:block>
187 <fo:inline font-weight="bold">
188 <xsl:apply-templates select="$segtitles[$segnum=position()]"
189 mode="segtitle-in-seg"/>
190 <xsl:text>: </xsl:text>
191 </fo:inline>
192 </fo:block>
193 </fo:list-item-label>
194 <fo:list-item-body start-indent="body-start()">
195 <fo:block text-align="left">
196 <xsl:apply-templates/>
197 </fo:block>
198 </fo:list-item-body>
199 </fo:list-item>
200 </xsl:template>
201
202 <!-- Presentation of literal tag -->
203 <xsl:template match="literal">
204 <fo:inline font-weight="normal">
205 <xsl:call-template name="inline.monoseq"/>
206 </fo:inline>
207 </xsl:template>
208
209 <!-- Left alingnament for itemizedlist -->
210 <xsl:template match="itemizedlist">
211 <xsl:variable name="id">
212 <xsl:call-template name="object.id"/>
213 </xsl:variable>
214 <xsl:variable name="label-width">
215 <xsl:call-template name="dbfo-attribute">
216 <xsl:with-param name="pis"
217 select="processing-instruction('dbfo')"/>
218 <xsl:with-param name="attribute" select="'label-width'"/>
219 </xsl:call-template>
220 </xsl:variable>
221 <xsl:if test="title">
222 <xsl:apply-templates select="title" mode="list.title.mode"/>
223 </xsl:if>
224 <!-- Preserve order of PIs and comments -->
225 <xsl:apply-templates
226 select="*[not(self::listitem
227 or self::title
228 or self::titleabbrev)]
229 |comment()[not(preceding-sibling::listitem)]
230 |processing-instruction()[not(preceding-sibling::listitem)]"/>
231 <fo:list-block id="{$id}" xsl:use-attribute-sets="list.block.spacing"
232 provisional-label-separation="0.2em" text-align="left">
233 <xsl:attribute name="provisional-distance-between-starts">
234 <xsl:choose>
235 <xsl:when test="$label-width != ''">
236 <xsl:value-of select="$label-width"/>
237 </xsl:when>
238 <xsl:otherwise>1.5em</xsl:otherwise>
239 </xsl:choose>
240 </xsl:attribute>
241 <xsl:apply-templates
242 select="listitem
243 |comment()[preceding-sibling::listitem]
244 |processing-instruction()[preceding-sibling::listitem]"/>
245 </fo:list-block>
246 </xsl:template>
247
248 <!-- Addibg a bullet, and left alignament, for packages and paches list. -->
249
250<xsl:template match="varlistentry" mode="vl.as.blocks">
251 <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
252 <xsl:choose>
253 <xsl:when test="ancestor::variablelist/@role = 'materials'">
254 <fo:block id="{$id}" xsl:use-attribute-sets="list.item.spacing"
255 keep-together.within-column="always"
256 keep-with-next.within-column="always" text-align="left">
257 <xsl:text>&#x2022; </xsl:text>
258 <xsl:apply-templates select="term"/>
259 </fo:block>
260 <fo:block margin-left="1.4pc" text-align="left">
261 <xsl:apply-templates select="listitem"/>
262 </fo:block>
263 </xsl:when>
264 <xsl:otherwise>
265 <fo:block id="{$id}" xsl:use-attribute-sets="list.item.spacing"
266 keep-together.within-column="always"
267 keep-with-next.within-column="always">
268 <xsl:apply-templates select="term"/>
269 </fo:block>
270 <fo:block margin-left="0.25in">
271 <xsl:apply-templates select="listitem"/>
272 </fo:block>
273 </xsl:otherwise>
274 </xsl:choose>
275</xsl:template>
276
277</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.