OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] Initial page numbering for book chapter?


Replying to myself, not sure though if there is not a better way to  
do this.


Le 5 juin 2006 à 11:50, Michèle Garoche a écrit :

> While in docbook-xsl stylesheet 1.69.1 the page numbering was  
> reinitialized to 1 for the first chapter in a book, it is no more  
> in docbook-xsl stylesheet 1.70.1.
>
> Is it the intended behaviour or does a parameter exist to change it  
> back to the 1.69.1 behaviour?
> Or should I just reinsert the contents of 1.69.1 stylesheets for  
> this part?
>
> Ideally, the sequence would be like this:
>
> book titlepages: no numbering
> toc: numbering i beginning with i, ending with say viii
> preface: beginning with ix ending with say xii
> (other pre-contents pages such as introduction same as preface  
> continuing the numbering)
> chapter: numbering 1 beginning with 1 (as it was with 1.69.1) and  
> not 13 (as it is with 1.70.1)
>
> Thanks in advance for any help.

I've customized like this:

<!-- Restart the numbering of first chapter to 1 -->
<xsl:template name="initial.page.number">
   <xsl:param name="element" select="local-name(.)"/>
   <xsl:param name="master-reference" select="''"/>

   <!-- Select the first content that the stylesheet places
        after the TOC -->
   <xsl:variable name="first.book.content"
                 select="ancestor::book/*[
                           not(self::title or
                               self::subtitle or
                               self::titleabbrev or
                               self::bookinfo or
                               self::info or
                               self::dedication or
                               self::toc or
                               self::lot)][1]"/>
   <xsl:choose>
     <!-- double-sided output -->
     <xsl:when test="$double.sided != 0">
       <xsl:choose>
         <xsl:when test="$element = 'toc'">auto-odd</xsl:when>
         <xsl:when test="$element = 'book'">1</xsl:when>
         <!-- preface typically continues TOC roman numerals -->
         <!-- Change page.number.format if not -->
         <xsl:when test="$element = 'preface'">auto-odd</xsl:when>
         <xsl:when test="($element = 'dedication' or $element =  
'article')
                     and not(preceding::chapter
                             or preceding::preface
                             or preceding::appendix
                             or preceding::article
                             or preceding::dedication
                             or parent::part
                             or parent::reference)">1</xsl:when>
         <xsl:when test="$element = 'chapter' and not  
(preceding::chapter)">1</xsl:when>       <!-- Addition -->
         <xsl:when test="generate-id($first.book.content) =
                         generate-id(.)">1</xsl:when>
         <xsl:otherwise>auto-odd</xsl:otherwise>
       </xsl:choose>
     </xsl:when>

     <!-- single-sided output -->
....
</xsl:template>

Amicalement,
Michèle
<http://micmacfr.homeunix.org>



=?ISO-8859-1?Q?Ceci_est_une_signature_=E9lectronique_PGP?=



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]