Re: [docbook-apps] Don't break chapter's to recto pages

From
"Cob Rtayton"
Date
2009-10-07T20:01:16+00:00
ID
00ab01ca4788$e34d9fc0$0a00a8c0@pazu
Thread
Re: [docbook-apps] Don't break chapter's to recto pages
Hi,

I'm not clear what you mean by 
"half-double-sided".  Can you provide a short example that illustrates 
the problem, and complete examples of your two customized 
templates?

  

Bob Stayton
Sagehill Enterprises


 

 

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

  
From: 
  Mathias Schindler 

  
To: DocBook Apps 

  
Sent: Monday, October 05, 2009 6:00 
  AM

  
Subject: [docbook-apps] Don't break 
  chapter's to recto pages

  

  

  
Hi!

  
 

  
I have a problem 
  concerning the page breaks of <chapter> elements in double-sided PDF 
  output!

  
 

  
The case is that 
  I want <part>s, <toc>, <preface>, <index> and 
  <colophon> to break to the next recto page, while chapters and 
  appendices should only break to the next page (regardless if recto or 
  verso).

  
 

  
First I tried to 
  modify the “force.page.count”- and “initial.page.number”-templates as 
  follows:

  
 

  
force.page.count(only 
  changed content)::

  
<xsl:choose>

  
   <xsl:when 
  test="$element != 'chapter'">auto</xsl:when>  
  

  
   <xsl:when 
  test="$double.sided != 0">end-on-even</xsl:when>  
  

  
   
  <xsl:otherwise>no-force</xsl:otherwise>

  
</xsl:choose>

  
 

  
initial.page.number(only 
  changed content):

  
<xsl:when 
  test="$double.sided != 0">

  
        
  <xsl:choose>

  
             
    <xsl:when test="$element = 
  'chapter'">auto</xsl:when>

  
…

  
 

  
Unfortunately this ended up in displaying 
  me a “half-double-sided” and “half-single-sided” document. Furthermore, not 
  every chapter wants to wrap to a verso page…

  
 

  
I also tried to add a custom 
  user-pagemaster:

  
 

  
<xsl:template 
  name="user.pagemasters">

  
    
  <fo:page-sequence-master 
  master-name="body-chapter">

  
      
  <fo:repeatable-page-master-alternatives>

  
        
  <fo:conditional-page-master-reference 
  master-reference="blank"

  
                                              
  blank-or-not-blank="blank"/>

  
 

  
     
     <fo:conditional-page-master-reference 
  master-reference="body-odd"

  
                                              
  odd-or-even="odd"/>

  
                                                                          
    

  
        
  <fo:conditional-page-master-reference 
  odd-or-even="even">                                    
                                    
    

  
          
  <xsl:attribute name="master-reference">

  
            
  <xsl:choose>

  
              
  <xsl:when test="$double.sided != 
  0">body-even</xsl:when>

  
              
  <xsl:otherwise>body-odd</xsl:otherwise>

  
            
  </xsl:choose>

  
          
  </xsl:attribute>

  
        
  </fo:conditional-page-master-reference>

  
      
  </fo:repeatable-page-master-alternatives>

  
    
  </fo:page-sequence-master>

  
</xsl:template>

  
 

  
<xsl:template 
  name="select.user.pagemaster">

  
  <xsl:param 
  name="element"/>

  
  <xsl:param 
  name="pageclass"/>

  
  <xsl:param 
  name="default-pagemaster"/>

  
 

  
  
  <xsl:choose>

  
    
  <xsl:when test="$element = 'chapter'">

  
      
  <xsl:value-of select="'body-chapter'"/>

  
    
  </xsl:when>

  
    
  <xsl:otherwise>

  
      
  <xsl:value-of select="$default-pagemaster"/>

  
    
  </xsl:otherwise>

  
  
  </xsl:choose>

  
</xsl:template>

  
 

  
After that it works almost perfect – 
  almost. The double-sided output is fine but again not every chapter breaks to 
  a verso page. I sometimes have one blank page in front of a chapter and 
  sometimes not.

  
 

  
Can anyone help me?

  
 

  
Thanks in advance,

  
 

  
Mathias 
  Schindler