Next in thread → Next in month →

Re: [docbook-apps] Custom Chapter Numbering

From
Bob Stayton <>
Date
2006-07-25T15:32:35+00:00
ID
00e801c6afff$893808f0$6400a8c0@totoro
Thread
Re: [docbook-apps] Custom Chapter Numbering
Hi Ray,

Changing the chapter numbering is easier than 
eliminating it for the first chapter.  That's because often the word 
"Chapter" is added to the chapter number, and all those instances need to be 
handled if you eliminate it for one chapter.

 

Chapter numbers are generated by processing a 
chapter in mode="label.markup" (true of most element numbering as well).  
Something like this would work to start on zero:

 

<xsl:template match="chapter" 
mode="label.markup">
  <xsl:value-of 
select="count(preceding::chapter)"/>
</xsl:template>

It just counts the number of preceding 
chapters.  The first one will have a count of zero.

 

The original template in this mode is in 
common/labels.xsl, and you will see that it is a bit more complex because it 
handles many options that come from parameter settings.  If you don't need 
to accomodate those variations, then this simple template would work.  
Otherwise customize the original.

 

Bob Stayton
Sagehill Enterprises
DocBook Consulting


 

 

  
----- Original Message ----- 

  
From: 
  Miller, Ray 
  (Centech) 

  
To: DocBook Apps 

  
Sent: Sunday, July 23, 2006 1:37 PM

  
Subject: [docbook-apps] Custom Chapter 
  Numbering

  

  

  
Docbook-5.0.b6 rng and 
  xsl-1.70.1

  
 

  
Wish to either start chapter 
  numbering at 0 or suppress first chapter numbering and start the second 
  chapter at 1.

  
 

  
How can I accomplish 
  this?

  
 

  
Ray
Next in thread → Next in month →