← Prev in month ← Prev in thread

Re: [docbook-apps] section title customization

From
Bob Stayton <>
Date
2006-04-07T03:39:10+00:00
ID
00b401c659f5$2c266090$6400a8c0@totoro
Thread
Re: [docbook-apps] section title customization
Hi,

Sorry for the delay in answering, but I couldn't 
find my example.  It turns out it is in a stylesheet I created for a 
client, so I can't reproduce it here, but I can describe what I 
did.

 

I merged the template named 'section.heading' 
with the template that calls it, which starts with:

 

<xsl:template 
match="section/title
                     
|simplesect/title
                     
|sect1/title
                     
|sect2/title
                     
|sect3/title
                     
|sect4/title
                     
|sect5/title"
              
mode="titlepage.mode"
              
priority="2">

 

Those are the final templates in the sequence of 
section title templates.

 

Instead of creating in that template a variable 
named 'title' whose content was the result of using mode="object.title.markup" 
(which generates a combined number label and title), I created a fo:list-block 
with a single fo:list-item child to format the label and title.  The 
section number goes in the fo:list-item-label, with the text-align property set 
to "right", and the section title goes in fo:list-item-body, left-aligned.  
On the list-block set the provisional-label-separation equal to the space you 
want between the label and title, and set the provisional-distance-between 
starts equal to the width of the area for the label (including the separation 
space).  

 

To generate the title, process the section in 
mode="title.markup".  To generate the label, process the section in 
mode="label.markup".  Since the above template's context element is the 
title itself, to get the section parent you need to use a select=".." when you 
apply templates in those modes.  

 

Hope this is enough to get you 
started.

 

Bob Stayton
Sagehill Enterprises
DocBook Consulting


 

 

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

  
From: 
  Skopik 
  Pavel 

  
To:  
  

  
Sent: Thursday, March 30, 2006 6:27 
  AM

  
Subject: [docbook-apps] section title 
  customization

  

  

  
Hello,

  
 

  
I would 
  like to customize section titles in more advanced way than by means of section.title.properties attributes. But in comparison to chapter title templates this seems to be a much more complicated task. I had a look at section.heading template, but I am not quite sure where to start. 

  
 

  
My idea of customizing section titles is like this:

  
 

  
1         
     Title

  
   Text of section

  
         1.2       Title

  
            
        
     Text of section     
  

  
      1.2.3       Title

  
            
          Text of 
  section

  
 

  
I would 
  like to indent the body text and wrap section numer label and title into two separate fo:inline elements so that the number label is aligned to the right and the title starts at the beginning of body text indentation. The problem is I was not able to find out proper parts of template which generate this content. The structure of section templates is much different from chapter templates.

  
 

  
Has anyone tried such a bit more 
  complicated layout? I 
  would be very grateful for any response and experience.

  
 

  
Best regards

  
 

  
Pavel 
  Skopik
← Prev in month ← Prev in thread