pdf book: fix page numbering in part III

By default page numbering in <preface> is in roman numeral. This
is ok for the book preface, but not for the part III preface.
So copy the page.number.format template from docbook stylesheets
to stylesheets/lfs-xsl/pdf/lfs-pagesetup.xsl, and modify it.

Reported by: Vladimir Pertsev on lfs-dev list
This commit is contained in:
Pierre Labastie 2023-10-18 23:54:57 +02:00
parent 2c3487d37d
commit 6f090ad2b7

View File

@ -241,4 +241,22 @@
</fo:block>
</xsl:template>
<!-- page.number.format
We want roman numerals only in book's preface, not parts prefaces
(if any). The original template is in {docbook-xsl}/fo/pagesetup.xsl -->
<xsl:template name="page.number.format">
<xsl:param name="element" select="local-name(.)"/>
<xsl:param name="master-reference" select="''"/>
<xsl:choose>
<xsl:when test="$element = 'toc' and self::book">i</xsl:when>
<xsl:when test="$element = 'set'">i</xsl:when>
<xsl:when test="$element = 'book'">i</xsl:when>
<xsl:when test="$element = 'preface' and not(ancestor::part)">i</xsl:when>
<xsl:when test="$element = 'dedication'">i</xsl:when>
<xsl:when test="$element = 'acknowledgements'">i</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>