diff options
author | Pierre Labastie <pierre.labastie@neuf.fr> | 2023-10-18 23:54:57 +0200 |
---|---|---|
committer | Pierre Labastie <pierre.labastie@neuf.fr> | 2023-10-18 23:54:57 +0200 |
commit | 6f090ad2b7ed6f4bdaef100157c33b3c8a46a47c (patch) | |
tree | 8b956bff35fe14906d48b88778e61f8088de371c | |
parent | 2c3487d37de87f0ef499aa69b79ef319efddf083 (diff) |
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
-rw-r--r-- | stylesheets/lfs-xsl/pdf/lfs-pagesetup.xsl | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/stylesheets/lfs-xsl/pdf/lfs-pagesetup.xsl b/stylesheets/lfs-xsl/pdf/lfs-pagesetup.xsl index 49337d0ef..787a0e8c1 100644 --- a/stylesheets/lfs-xsl/pdf/lfs-pagesetup.xsl +++ b/stylesheets/lfs-xsl/pdf/lfs-pagesetup.xsl @@ -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> |