[65b2904] | 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 | <!-- This stylesheet controls page margins, sections page break,
|
---|
| 8 | header content and titles size. -->
|
---|
| 9 |
|
---|
| 10 | <!-- The inner page margin. -->
|
---|
| 11 | <xsl:param name="page.margin.inner" select="'0.32in'"/>
|
---|
| 12 |
|
---|
| 13 | <!-- The outer page margin. -->
|
---|
| 14 | <xsl:param name="page.margin.outer" select="'0.32in'"/>
|
---|
| 15 |
|
---|
| 16 | <!-- The bottom margin of the page. -->
|
---|
| 17 | <xsl:param name="page.margin.bottom" select="'0.35in'"/>
|
---|
| 18 |
|
---|
| 19 | <!-- The top margin of the page. -->
|
---|
| 20 | <xsl:param name="page.margin.top" select="'0.35in'"/>
|
---|
| 21 |
|
---|
| 22 | <!-- The bottom margin of the body text. -->
|
---|
| 23 | <xsl:param name="body.margin.bottom" select="'0.4in'"/>
|
---|
| 24 |
|
---|
| 25 | <!-- The top margin of the body text. -->
|
---|
| 26 | <xsl:param name="body.margin.top" select="'0.4in'"/>
|
---|
| 27 |
|
---|
| 28 | <!-- Specifies the height of the header. -->
|
---|
| 29 | <xsl:param name="region.before.extent" select="'0.25in'"/>
|
---|
| 30 |
|
---|
| 31 | <!-- Specifies the height of the footer. -->
|
---|
| 32 | <xsl:param name="region.after.extent" select="'0.25in'"/>
|
---|
| 33 |
|
---|
| 34 | <!-- The start-indent for the body text. -->
|
---|
| 35 | <xsl:param name="body.start.indent" select="'0pc'"/>
|
---|
| 36 |
|
---|
| 37 | <!-- Adjust the left margin for titles. -->
|
---|
| 38 | <xsl:param name="title.margin.left">-0.8pc</xsl:param>
|
---|
| 39 |
|
---|
| 40 | <!-- Default table width on tables that do not specify an alternate
|
---|
| 41 | width using the dbfo processing instruction.
|
---|
| 42 | This value is used also on bookinfo/revhistory table. -->
|
---|
| 43 | <xsl:param name="default.table.width" select="'70%'"/>
|
---|
| 44 |
|
---|
| 45 | <!-- Properties for component titles -->
|
---|
| 46 | <xsl:attribute-set name="component.title.properties">
|
---|
| 47 | <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
|
---|
| 48 | <xsl:attribute name="space-before.optimum">
|
---|
| 49 | <xsl:value-of select="concat($body.font.master, 'pt')"/>
|
---|
| 50 | </xsl:attribute>
|
---|
| 51 | <xsl:attribute name="space-before.minimum">
|
---|
| 52 | <xsl:value-of select="concat($body.font.master, 'pt * 0.8')"/>
|
---|
| 53 | </xsl:attribute>
|
---|
| 54 | <xsl:attribute name="space-before.maximum">
|
---|
| 55 | <xsl:value-of select="concat($body.font.master, 'pt * 1.2')"/>
|
---|
| 56 | </xsl:attribute>
|
---|
| 57 | <xsl:attribute name="hyphenate">false</xsl:attribute>
|
---|
| 58 | <xsl:attribute name="text-align">
|
---|
| 59 | <xsl:choose>
|
---|
| 60 | <xsl:when test="((parent::article | parent::articleinfo |
|
---|
| 61 | parent::info/parent::article)
|
---|
| 62 | and not(ancestor::book) and not(self::bibliography))
|
---|
| 63 | or (parent::slides | parent::slidesinfo)
|
---|
| 64 | or self::index">center</xsl:when>
|
---|
| 65 | <xsl:otherwise>left</xsl:otherwise>
|
---|
| 66 | </xsl:choose>
|
---|
| 67 | </xsl:attribute>
|
---|
| 68 | <xsl:attribute name="start-indent">
|
---|
| 69 | <xsl:value-of select="$title.margin.left"/>
|
---|
| 70 | </xsl:attribute>
|
---|
| 71 | </xsl:attribute-set>
|
---|
| 72 |
|
---|
| 73 | <!-- Rule under headers? 1 =yes, 0 = no -->
|
---|
| 74 | <xsl:param name="header.rule" select="0"/>
|
---|
| 75 |
|
---|
| 76 | <!-- Rule over footers? 1 =yes, 0 = no -->
|
---|
| 77 | <xsl:param name="footer.rule" select="0"></xsl:param>
|
---|
| 78 |
|
---|
| 79 | <!-- Control depth of sections shown in running headers or footers.
|
---|
| 80 | Be sure that no unneeded fo:marker are generated. -->
|
---|
| 81 | <xsl:param name="marker.section.level" select="-1"></xsl:param>
|
---|
| 82 |
|
---|
| 83 | <!-- Force package's sect1 onto a new page -->
|
---|
| 84 | <xsl:attribute-set name="section.level1.properties">
|
---|
| 85 | <xsl:attribute name="break-before">
|
---|
| 86 | <xsl:choose>
|
---|
| 87 | <!--<xsl:when test="not(. = //*/sect1[1])">
|
---|
| 88 | <xsl:text>page</xsl:text>
|
---|
| 89 | </xsl:when>-->
|
---|
| 90 | <xsl:when test="preceding-sibling::sect1[position()=1]/sect2/@role='package'
|
---|
| 91 | or self::sect1/sect2/@role='package'">page</xsl:when>
|
---|
| 92 | <xsl:otherwise>
|
---|
| 93 | <xsl:text>auto</xsl:text>
|
---|
| 94 | </xsl:otherwise>
|
---|
| 95 | </xsl:choose>
|
---|
| 96 | </xsl:attribute>
|
---|
| 97 | </xsl:attribute-set>
|
---|
| 98 |
|
---|
| 99 | <!-- part/partintro:
|
---|
| 100 | Be sure that partintro is on a new page. -->
|
---|
| 101 | <!-- The original template is in {docbook-xsl}/fo/divisions.xsl -->
|
---|
| 102 | <xsl:template match="part/partintro">
|
---|
| 103 | <xsl:apply-templates select=".." mode="part.titlepage.mode">
|
---|
| 104 | <xsl:with-param name="additional.content">
|
---|
| 105 | <fo:block break-before="page"/>
|
---|
| 106 | <xsl:if test="title">
|
---|
| 107 | <xsl:call-template name="partintro.titlepage"/>
|
---|
| 108 | </xsl:if>
|
---|
| 109 | <xsl:apply-templates/>
|
---|
| 110 | </xsl:with-param>
|
---|
| 111 | </xsl:apply-templates>
|
---|
| 112 | <xsl:call-template name="generate.part.toc">
|
---|
| 113 | <xsl:with-param name="part" select=".."/>
|
---|
| 114 | </xsl:call-template>
|
---|
| 115 | </xsl:template>
|
---|
| 116 |
|
---|
| 117 | <!-- book title:
|
---|
| 118 | Centered the title and removed unused code.
|
---|
| 119 | Removed book.titlepage.separator. -->
|
---|
| 120 | <!-- The original template is in {docbook-xsl}/fo/titlepage.templates.xsl -->
|
---|
| 121 | <xsl:template name="book.titlepage">
|
---|
| 122 | <fo:block margin-top="3in">
|
---|
| 123 | <fo:block>
|
---|
| 124 | <xsl:call-template name="book.titlepage.before.recto"/>
|
---|
| 125 | <xsl:call-template name="book.titlepage.recto"/>
|
---|
| 126 | </fo:block>
|
---|
| 127 | <fo:block>
|
---|
| 128 | <xsl:call-template name="book.titlepage.before.verso"/>
|
---|
| 129 | <xsl:call-template name="book.titlepage.verso"/>
|
---|
| 130 | </fo:block>
|
---|
| 131 | </fo:block>
|
---|
| 132 | </xsl:template>
|
---|
| 133 |
|
---|
| 134 | <!-- book titlepage verso:
|
---|
| 135 | Added missing bibliosource and revhistory support.
|
---|
| 136 | Removed unused code. -->
|
---|
| 137 | <!-- The original template is in {docbook-xsl}/fo/titlepage.templates.xsl -->
|
---|
| 138 | <xsl:template name="book.titlepage.verso">
|
---|
| 139 | <xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="bookinfo/title"/>
|
---|
| 140 | <xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="bookinfo/corpauthor"/>
|
---|
| 141 | <xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="bookinfo/authorgroup"/>
|
---|
| 142 | <xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="bookinfo/author"/>
|
---|
| 143 | <xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="bookinfo/othercredit"/>
|
---|
| 144 | <xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="bookinfo/releaseinfo"/>
|
---|
| 145 | <xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="bookinfo/pubdate"/>
|
---|
| 146 | <xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="bookinfo/copyright"/>
|
---|
| 147 | <xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="bookinfo/bibliosource"/>
|
---|
| 148 | <xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="bookinfo/abstract"/>
|
---|
| 149 | <xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="bookinfo/revhistory"/>
|
---|
| 150 | <xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="bookinfo/legalnotice"/>
|
---|
| 151 | </xsl:template>
|
---|
| 152 |
|
---|
| 153 | <!-- bibliosource:
|
---|
| 154 | Self-made template to handle bibliosource when inside bookinfo. -->
|
---|
| 155 | <xsl:template match="bibliosource" mode="book.titlepage.verso.auto.mode">
|
---|
| 156 | <fo:block font-size="8pt">
|
---|
| 157 | <xsl:apply-templates/>
|
---|
| 158 | </fo:block>
|
---|
| 159 | </xsl:template>
|
---|
| 160 |
|
---|
| 161 | <!-- part title:
|
---|
| 162 | Centered the title and removed unused code. -->
|
---|
| 163 | <!-- The original template is in {docbook-xsl}/fo/titlepage.templates.xsl -->
|
---|
| 164 | <xsl:template name="part.titlepage">
|
---|
| 165 | <fo:block>
|
---|
| 166 | <fo:block margin-top="3.5in">
|
---|
| 167 | <xsl:call-template name="part.titlepage.before.recto"/>
|
---|
| 168 | <xsl:call-template name="part.titlepage.recto"/>
|
---|
| 169 | </fo:block>
|
---|
| 170 | <fo:block>
|
---|
| 171 | <xsl:call-template name="part.titlepage.before.verso"/>
|
---|
| 172 | <xsl:call-template name="part.titlepage.verso"/>
|
---|
| 173 | </fo:block>
|
---|
| 174 | <xsl:call-template name="part.titlepage.separator"/>
|
---|
| 175 | </fo:block>
|
---|
| 176 | </xsl:template>
|
---|
| 177 |
|
---|
| 178 | <!-- chapter title:
|
---|
| 179 | Small font size and left alignament. -->
|
---|
| 180 | <!-- The original template is in {docbook-xsl}/fo/titlepage.templates.xsl -->
|
---|
| 181 | <xsl:template match="title" mode="chapter.titlepage.recto.auto.mode">
|
---|
| 182 | <fo:block xsl:use-attribute-sets="chapter.titlepage.recto.style"
|
---|
| 183 | font-size="21pt" font-weight="bold" text-align="left">
|
---|
| 184 | <xsl:call-template name="component.title">
|
---|
| 185 | <xsl:with-param name="node" select="ancestor-or-self::chapter[1]"/>
|
---|
| 186 | </xsl:call-template>
|
---|
| 187 | </fo:block>
|
---|
| 188 | </xsl:template>
|
---|
| 189 |
|
---|
| 190 | <!-- sect2 title:
|
---|
| 191 | Skip sect2.titlepage run when title is empty.
|
---|
| 192 | Removed unused code. -->
|
---|
| 193 | <!-- The original template is in {docbook-xsl}/fo/sections.xsl -->
|
---|
| 194 | <xsl:template match="sect2">
|
---|
| 195 | <xsl:variable name="id">
|
---|
| 196 | <xsl:call-template name="object.id"/>
|
---|
| 197 | </xsl:variable>
|
---|
| 198 | <fo:block xsl:use-attribute-sets="section.level2.properties">
|
---|
| 199 | <xsl:attribute name="id">
|
---|
| 200 | <xsl:value-of select="$id"/>
|
---|
| 201 | </xsl:attribute>
|
---|
| 202 | <xsl:if test="not(string-length(title)=0)">
|
---|
| 203 | <xsl:call-template name="sect2.titlepage"/>
|
---|
| 204 | </xsl:if>
|
---|
| 205 | <xsl:apply-templates/>
|
---|
| 206 | </fo:block>
|
---|
| 207 | </xsl:template>
|
---|
| 208 |
|
---|
| 209 | <!-- header.table:
|
---|
| 210 | Re-made template to not generate a fo:table in the header,
|
---|
| 211 | allowing a more simple header.content customization. -->
|
---|
| 212 | <!-- The original template is in {docbook-xsl}/fo/pagesetup.xsl -->
|
---|
| 213 | <xsl:template name="header.table">
|
---|
| 214 | <xsl:param name="sequence" select="''"/>
|
---|
| 215 | <xsl:param name="gentext-key" select="''"/>
|
---|
| 216 | <xsl:choose>
|
---|
| 217 | <xsl:when test="$gentext-key = 'book' or $sequence = 'blank'"/>
|
---|
| 218 | <xsl:otherwise>
|
---|
| 219 | <xsl:call-template name="header.content">
|
---|
| 220 | <xsl:with-param name="sequence" select="$sequence"/>
|
---|
| 221 | </xsl:call-template>
|
---|
| 222 | </xsl:otherwise>
|
---|
| 223 | </xsl:choose>
|
---|
| 224 | </xsl:template>
|
---|
| 225 |
|
---|
| 226 | <!-- header.content
|
---|
| 227 | Re-made template to show the book title and version on all pages. -->
|
---|
| 228 | <!-- The original template is in {docbook-xsl}/fo/pagesetup.xsl -->
|
---|
| 229 | <xsl:template name="header.content">
|
---|
| 230 | <xsl:param name="sequence" select="''"/>
|
---|
| 231 | <fo:block>
|
---|
| 232 | <xsl:attribute name="text-align">
|
---|
| 233 | <xsl:choose>
|
---|
| 234 | <xsl:when test="$sequence = 'first' or $sequence = 'odd'">right</xsl:when>
|
---|
| 235 | <xsl:otherwise>left</xsl:otherwise>
|
---|
| 236 | </xsl:choose>
|
---|
| 237 | </xsl:attribute>
|
---|
| 238 | <xsl:value-of select="/book/bookinfo/title"/>
|
---|
| 239 | <xsl:text> - </xsl:text>
|
---|
| 240 | <xsl:value-of select="/book/bookinfo/subtitle"/>
|
---|
| 241 | </fo:block>
|
---|
| 242 | </xsl:template>
|
---|
| 243 |
|
---|
| 244 | </xsl:stylesheet>
|
---|