source: stylesheets/pdf/lfs-mixed.xsl@ 8c33312

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

Renamed the print stylesheets to pdf.

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

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