source: stylesheets/pdf/lfs-sections.xsl@ af7b097

10.0 10.1 11.0 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 ken/refactor-virt krejzi/svn lazarus nosym perl-modules qt5new systemd-11177 systemd-13485 trunk xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since af7b097 was af7b097, checked in by Randy McMurchy <randy@…>, 17 years ago

Updated to Manuel's newest PDF stylesheets; updated Glossary

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

  • Property mode set to 100644
File size: 3.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 <!-- Force section1's onto a new page -->
8 <xsl:attribute-set name="section.level1.properties">
9 <xsl:attribute name="break-after">
10 <xsl:choose>
11 <xsl:when test="not(position()=last())">
12 <xsl:text>page</xsl:text>
13 </xsl:when>
14 <xsl:otherwise>
15 <xsl:text>auto</xsl:text>
16 </xsl:otherwise>
17 </xsl:choose>
18 </xsl:attribute>
19 </xsl:attribute-set>
20
21 <!-- Sections numbering -->
22 <xsl:param name="section.autolabel" select="0"/>
23 <xsl:param name="section.label.includes.component.label" select="0"/>
24
25 <!-- Skip numeraration for sections with empty title -->
26 <xsl:template match="sect2|sect3|sect4|sect5" mode="label.markup">
27 <xsl:if test="string-length(title) > 0">
28 <!-- label the parent -->
29 <xsl:variable name="parent.label">
30 <xsl:apply-templates select=".." mode="label.markup"/>
31 </xsl:variable>
32 <xsl:if test="$parent.label != ''">
33 <xsl:apply-templates select=".." mode="label.markup"/>
34 <xsl:apply-templates select=".." mode="intralabel.punctuation"/>
35 </xsl:if>
36 <xsl:choose>
37 <xsl:when test="@label">
38 <xsl:value-of select="@label"/>
39 </xsl:when>
40 <xsl:when test="$section.autolabel != 0">
41 <xsl:choose>
42 <xsl:when test="local-name(.) = 'sect2'">
43 <xsl:choose>
44 <!-- If the first sect2 isn't numbered, renumber the remainig sections -->
45 <xsl:when test="string-length(../sect2[1]/title) = 0">
46 <xsl:variable name="totalsect2">
47 <xsl:number count="sect2"/>
48 </xsl:variable>
49 <xsl:number value="$totalsect2 - 1"/>
50 </xsl:when>
51 <xsl:otherwise>
52 <xsl:number count="sect2"/>
53 </xsl:otherwise>
54 </xsl:choose>
55 </xsl:when>
56 <xsl:when test="local-name(.) = 'sect3'">
57 <xsl:number count="sect3"/>
58 </xsl:when>
59 <xsl:when test="local-name(.) = 'sect4'">
60 <xsl:number count="sect4"/>
61 </xsl:when>
62 <xsl:when test="local-name(.) = 'sect5'">
63 <xsl:number count="sect5"/>
64 </xsl:when>
65 <xsl:otherwise>
66 <xsl:message>label.markup: this can't happen!</xsl:message>
67 </xsl:otherwise>
68 </xsl:choose>
69 </xsl:when>
70 </xsl:choose>
71 </xsl:if>
72 </xsl:template>
73
74 <!-- Drop the trailing punctuation if title is empty -->
75 <xsl:template match="section|sect1|sect2|sect3|sect4|sect5|simplesect
76 |bridgehead"
77 mode="object.title.template">
78 <xsl:choose>
79 <xsl:when test="$section.autolabel != 0">
80 <xsl:if test="string-length(title) > 0">
81 <xsl:call-template name="gentext.template">
82 <xsl:with-param name="context" select="'title-numbered'"/>
83 <xsl:with-param name="name">
84 <xsl:call-template name="xpath.location"/>
85 </xsl:with-param>
86 </xsl:call-template>
87 </xsl:if>
88 </xsl:when>
89 <xsl:otherwise>
90 <xsl:call-template name="gentext.template">
91 <xsl:with-param name="context" select="'title-unnumbered'"/>
92 <xsl:with-param name="name">
93 <xsl:call-template name="xpath.location"/>
94 </xsl:with-param>
95 </xsl:call-template>
96 </xsl:otherwise>
97 </xsl:choose>
98 </xsl:template>
99
100</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.