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

6.0
Last change on this file since ed5f52d was ed5f52d, checked in by Manuel Canales Esparcia <manuel@…>, 20 years ago

PDF output: Changed body font size to 12pt and master font size to 10pt.
Adapted the vertical blank space to the new font sizes.
Added code to split URLs.

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

  • Property mode set to 100644
File size: 6.6 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 <!-- Split URLs -->
8 <xsl:template name="hyphenate-url">
9 <xsl:param name="url" select="''"/>
10 <xsl:choose>
11 <xsl:when test="ancestor::varlistentry">
12 <xsl:choose>
13 <xsl:when test="string-length($url) > 88">
14 <xsl:value-of select="substring($url, 1, 50)"/>
15 <xsl:param name="rest" select="substring($url, 51)"/>
16 <xsl:value-of select="substring-before($rest, '/')"/>
17 <xsl:text> /</xsl:text>
18 <xsl:value-of select="substring-after($rest, '/')"/>
19 </xsl:when>
20 <xsl:otherwise>
21 <xsl:value-of select="$url"/>
22 </xsl:otherwise>
23 </xsl:choose>
24 </xsl:when>
25 <xsl:otherwise>
26 <xsl:value-of select="substring-before($url, '//')"/>
27 <xsl:text>// </xsl:text>
28 <xsl:call-template name="split-url">
29 <xsl:with-param name="url2" select="substring-after($url, '//')"/>
30 </xsl:call-template>
31 </xsl:otherwise>
32 </xsl:choose>
33 </xsl:template>
34
35 <xsl:template name="split-url">
36 <xsl:choose>
37 <xsl:when test="contains($url2, '/')">
38 <xsl:param name="url2" select="''"/>
39 <xsl:value-of select="substring-before($url2, '/')"/>
40 <xsl:text> /</xsl:text>
41 <xsl:call-template name="split-url">
42 <xsl:with-param name="url2" select="substring-after($url2, '/')"/>
43 </xsl:call-template>
44 </xsl:when>
45 <xsl:otherwise>
46 <xsl:value-of select="$url2"/>
47 </xsl:otherwise>
48 </xsl:choose>
49 </xsl:template>
50
51 <!-- Shade screen -->
52 <xsl:param name="shade.verbatim" select="1"/>
53
54 <!-- Graphics in admonitions -->
55 <xsl:param name="admon.graphics" select="1"/>
56 <xsl:param name="admon.graphics.path"
57 select="'/usr/share/xml/docbook/xsl-stylesheets-1.65.1/images/'"/>
58
59 <!-- Admonition block properties -->
60 <xsl:template match="important|warning|caution">
61 <xsl:choose>
62 <xsl:when test="$admon.graphics != 0">
63 <fo:block space-before.minimum="0.4em" space-before.optimum="0.6em"
64 space-before.maximum="0.8em" border-style="solid" border-width="1pt"
65 border-color="#500" background-color="#FFFFE6">
66 <xsl:call-template name="graphical.admonition"/>
67 </fo:block>
68 </xsl:when>
69 <xsl:otherwise>
70 <xsl:call-template name="nongraphical.admonition"/>
71 </xsl:otherwise>
72 </xsl:choose>
73 </xsl:template>
74
75 <xsl:template match="note|tip">
76 <xsl:choose>
77 <xsl:when test="$admon.graphics != 0">
78 <fo:block space-before.minimum="0.4em" space-before.optimum="0.6em"
79 space-before.maximum="0.8em" border-style="solid" border-width="1pt"
80 border-color="#E0E0E0" background-color="#FFFFE6">
81 <xsl:call-template name="graphical.admonition"/>
82 </fo:block>
83 </xsl:when>
84 <xsl:otherwise>
85 <xsl:call-template name="nongraphical.admonition"/>
86 </xsl:otherwise>
87 </xsl:choose>
88 </xsl:template>
89
90 <!-- Admonitions text properties -->
91 <xsl:attribute-set name="admonition.properties">
92 <xsl:attribute name="margin-right">6pt</xsl:attribute>
93 </xsl:attribute-set>
94
95 <!-- Adding left space to the graphics and color to the titles -->
96 <xsl:template name="graphical.admonition">
97 <xsl:variable name="id">
98 <xsl:call-template name="object.id"/>
99 </xsl:variable>
100 <xsl:variable name="graphic.width">
101 <xsl:call-template name="admon.graphic.width"/>
102 </xsl:variable>
103 <fo:block id="{$id}">
104 <fo:list-block provisional-distance-between-starts="{$graphic.width} + 18pt"
105 provisional-label-separation="18pt" xsl:use-attribute-sets="list.block.spacing">
106 <fo:list-item>
107 <fo:list-item-label end-indent="label-end()">
108 <fo:block margin-left="4pt">
109 <fo:external-graphic width="auto" height="auto"
110 content-width="{$graphic.width}" >
111 <xsl:attribute name="src">
112 <xsl:call-template name="admon.graphic"/>
113 </xsl:attribute>
114 </fo:external-graphic>
115 </fo:block>
116 </fo:list-item-label>
117 <fo:list-item-body start-indent="body-start()">
118 <xsl:if test="$admon.textlabel != 0 or title">
119 <fo:block xsl:use-attribute-sets="admonition.title.properties">
120 <xsl:if test="ancestor-or-self::important">
121 <xsl:attribute name="color">#500</xsl:attribute>
122 </xsl:if>
123 <xsl:if test="ancestor-or-self::warning">
124 <xsl:attribute name="color">#500</xsl:attribute>
125 </xsl:if>
126 <xsl:if test="ancestor-or-self::caution">
127 <xsl:attribute name="color">#500</xsl:attribute>
128 </xsl:if>
129 <xsl:apply-templates select="." mode="object.title.markup"/>
130 </fo:block>
131 </xsl:if>
132 <fo:block xsl:use-attribute-sets="admonition.properties">
133 <xsl:apply-templates/>
134 </fo:block>
135 </fo:list-item-body>
136 </fo:list-item>
137 </fo:list-block>
138 </fo:block>
139 </xsl:template>
140
141 <!-- How is rendered by default a variablelist -->
142 <xsl:param name="variablelist.as.blocks" select="1"/>
143
144 <!-- Adding space before segmentedlist -->
145 <xsl:template match="segmentedlist">
146 <!--<xsl:variable name="presentation">
147 <xsl:call-template name="pi-attribute">
148 <xsl:with-param name="pis"
149 select="processing-instruction('dbfo')"/>
150 <xsl:with-param name="attribute" select="'list-presentation'"/>
151 </xsl:call-template>
152 </xsl:variable>
153 <xsl:choose>
154 <xsl:when test="$presentation = 'table'">
155 <xsl:apply-templates select="." mode="seglist-table"/>
156 </xsl:when>
157 <xsl:when test="$presentation = 'list'">
158 <fo:block space-before.minimum="0.4em" space-before.optimum="0.6em"
159 space-before.maximum="0.8em">
160 <xsl:apply-templates/>
161 </fo:block>
162 </xsl:when>
163 <xsl:when test="$segmentedlist.as.table != 0">
164 <xsl:apply-templates select="." mode="seglist-table"/>
165 </xsl:when>
166 <xsl:otherwise>-->
167 <fo:block space-before.minimum="0.4em" space-before.optimum="0.6em"
168 space-before.maximum="0.8em">
169 <xsl:apply-templates/>
170 </fo:block>
171 <!--</xsl:otherwise>
172 </xsl:choose>-->
173 </xsl:template>
174
175</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.