source: stylesheets/blfs-pdf.xsl@ eff3826

10.0 10.1 6.0 6.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 krejzi/svn nosym perl-modules qt5new systemd-11177 systemd-13485 trunk v5_1 v5_1-pre1 xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since eff3826 was eff3826, checked in by Larry Lawrence <larry@…>, 17 years ago

Added stylesheets for xsltproc processing

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

  • Property mode set to 100644
File size: 5.0 KB
Line 
1<?xml version='1.0'?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:fo="http://www.w3.org/1999/XSL/Format"
4 xmlns="http://www.w3.org/1999/xhtml"
5 version="1.0">
6
7 <!-- We use FO and FOP as the processor -->
8 <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
9 <xsl:param name="fop.extensions" select="1"/>
10 <xsl:param name="draft.mode" select="'no'"/>
11 <!-- Probably want to make the paper size configurable -->
12 <xsl:param name="paper.type" select="'Letter'"/>
13
14
15 <!-- Font size -->
16 <xsl:param name="body.font.master">8</xsl:param>
17 <xsl:param name="body.font.size">10pt</xsl:param>
18
19 <!-- Margins -->
20 <xsl:param name="page.margin.inner">1in</xsl:param>
21 <xsl:param name="page.margin.outer">0.5in</xsl:param>
22 <xsl:param name="title.margin.left">-1pc</xsl:param>
23
24 <!-- TOC stuff -->
25 <xsl:param name="generate.toc">
26 book toc
27 part nop
28 </xsl:param>
29 <xsl:param name="toc.section.depth">1</xsl:param>
30 <xsl:param name="generate.section.toc.level" select="-1"></xsl:param>
31 <xsl:param name="toc.indent.width" select="18"></xsl:param>
32
33 <!-- Force section1's onto a new page -->
34 <xsl:attribute-set name="section.level1.properties">
35 <xsl:attribute name="break-after">page</xsl:attribute>
36 </xsl:attribute-set>
37
38 <!-- Columns in appendix -->
39 <xsl:param name="column.count.back" select="2"/>
40
41 <!-- Don't hyphenate -->
42 <xsl:param name="hyphenate">false</xsl:param>
43 <xsl:param name="alignment">left</xsl:param>
44
45 <!-- Page number in Xref-->
46 <xsl:param name="insert.xref.page.number">yes</xsl:param>
47 <xsl:template match="xref" name="xref">
48 <xsl:variable name="targets" select="key('id',@linkend)"/>
49 <xsl:variable name="target" select="$targets[1]"/>
50 <xsl:variable name="refelem" select="local-name($target)"/>
51 <xsl:call-template name="check.id.unique">
52 <xsl:with-param name="linkend" select="@linkend"/>
53 </xsl:call-template>
54 <xsl:choose>
55 <xsl:when test="$refelem=''">
56 <xsl:message>
57 <xsl:text>XRef to nonexistent id: </xsl:text>
58 <xsl:value-of select="@linkend"/>
59 </xsl:message>
60 <xsl:text>???</xsl:text>
61 </xsl:when>
62 <xsl:when test="@endterm">
63 <fo:basic-link internal-destination="{@linkend}"
64 xsl:use-attribute-sets="xref.properties">
65 <xsl:variable name="etargets" select="key('id',@endterm)"/>
66 <xsl:variable name="etarget" select="$etargets[1]"/>
67 <xsl:choose>
68 <xsl:when test="count($etarget) = 0">
69 <xsl:message>
70 <xsl:value-of select="count($etargets)"/>
71 <xsl:text>Endterm points to nonexistent ID: </xsl:text>
72 <xsl:value-of select="@endterm"/>
73 </xsl:message>
74 <xsl:text>???</xsl:text>
75 </xsl:when>
76 <xsl:otherwise>
77 <xsl:apply-templates select="$etarget" mode="endterm"/>
78 </xsl:otherwise>
79 </xsl:choose>
80 </fo:basic-link>
81 </xsl:when>
82 <xsl:when test="$target/@xreflabel">
83 <fo:basic-link internal-destination="{@linkend}"
84 xsl:use-attribute-sets="xref.properties">
85 <xsl:call-template name="xref.xreflabel">
86 <xsl:with-param name="target" select="$target"/>
87 </xsl:call-template>
88 </fo:basic-link>
89 </xsl:when>
90 <xsl:otherwise>
91 <fo:basic-link internal-destination="{@linkend}"
92 xsl:use-attribute-sets="xref.properties">
93 <xsl:apply-templates select="$target" mode="xref-to">
94 <xsl:with-param name="referrer" select="."/>
95 <xsl:with-param name="xrefstyle">
96 <xsl:choose>
97 <xsl:when test="@role and not(@xrefstyle) and $use.role.as.xrefstyle != 0">
98 <xsl:value-of select="@role"/>
99 </xsl:when>
100 <xsl:otherwise>
101 <xsl:value-of select="@xrefstyle"/>
102 </xsl:otherwise>
103 </xsl:choose>
104 </xsl:with-param>
105 </xsl:apply-templates>
106 </fo:basic-link>
107 </xsl:otherwise>
108 </xsl:choose>
109 <xsl:if test="not(starts-with(normalize-space(@xrefstyle), 'select:') != ''
110 and (contains(@xrefstyle, 'page')
111 or contains(@xrefstyle, 'Page')))
112 and ( $insert.xref.page.number = 'yes'
113 or $insert.xref.page.number = '1')
114 or local-name($target) = 'para'">
115 <fo:basic-link internal-destination="{@linkend}"
116 xsl:use-attribute-sets="xref.properties">
117 <xsl:text>, p. </xsl:text>
118 <xsl:apply-templates select="$target" mode="page.citation">
119 <xsl:with-param name="id" select="@linkend"/>
120 </xsl:apply-templates>
121 </fo:basic-link>
122 </xsl:if>
123 </xsl:template>
124
125 <!-- Prevent duplicate e-mails in the Acknowledgments pages-->
126 <xsl:param name="ulink.show" select="0"/>
127
128</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.