Next in thread → Next in month →

Re: [docbook-apps] Docbook: A front cover page is inserted twice -- please help!!!

From
Bob Stayton <>
Date
2009-01-16T20:31:32+00:00
ID
00e601c97819$6660b860$6400a8c0@pazu
Thread
Re: [docbook-apps] Docbook: A front cover page is inserted twice -- please help!!!
You can't call a template partially, but you can 
look in the template and copy parts of it to use in your own templates.  
For example, this piece from book.titlepage.recto outputs just the 
title:

 

<fo:page-sequence ...>

 <fo:flow ...>

  <xsl:choose>
    
<xsl:when test="bookinfo/title">
      
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" 
select="bookinfo/title"/>
    
</xsl:when>
    <xsl:when 
test="info/title">
      <xsl:apply-templates 
mode="book.titlepage.recto.auto.mode" 
select="info/title"/>
    
</xsl:when>
    <xsl:when 
test="title">
      <xsl:apply-templates 
mode="book.titlepage.recto.auto.mode" select="title"/>
    
</xsl:when>
  </xsl:choose>

 

 </fo:flow>

</fo:page-sequence>

 

Bob Stayton
Sagehill Enterprises


 

 

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

  
From: 
  Nancy 
  Brandt 

  
To:  
  ; Bob Stayton 
  

  
Sent: Tuesday, January 06, 2009 2:43 
  PM

  
Subject: Re: [docbook-apps] Docbook: A 
  front cover page is inserted twice -- please help!!!

  

  
    
    

      
        
Hello Bob, and other Docbook community members 

        
 

        
First of all, thank you Bob for your suggestions!!! You are always 
        helpful!

        
 

        
I've tried your "force-page-count="no-force" suggestion, and yes it works 
        (hooray!!!)

        
 

        
Regarding the second suggestion - calling the 
        book.titlepage.recto template -- it is still not clear to me how to call 
        it partially - for example only a book title (and not the subtitle, 
        version, etc.)?

        
 

        
Could you please explain this in more detail?

        
 

        
Thank you a lot in advance!

        
Best regards,

        
Nancy

        

--- On Mon, 1/5/09, Bob Stayton 
        <> wrote:

        From: 
          Bob Stayton <>
Subject: Re: [docbook-apps] 
          Docbook: A front cover page is inserted twice -- please help!!!
To: 
          , 
Date: 
          Monday, January 5, 2009, 8:31 AM

          

          
If you want to repeat the book titlepage 
          on the cover, you could just call the template named 
          'book.titlepage.recto' in the fo:flow of your front cover. If you just 
          want the book title, you could instead use part of it.  See that 
          template in the stylesheet module fo/titlepage.templates.xsl, or if 
          you have customized the titlepage spec file, in your generated 
          version.

          
 

          
For the double front cover, yes, it is 
          most likely doing a double-sided page sequence. The fo:page-sequence 
          element for the cover needs to have this property: 

          
 

          
force-page-count="no-force"

          
 

          
Without that, the default value is 
          "auto", which means if the page-sequence that follows starts on an odd 
          number, then it generates an even page to close the cover page 
          sequence.  The back cover doesn't have this problem because it is 
          not followed by any page sequence, so it doesn't generate an extra 
          page (unless you set force-page-count="end-on-even").

          
 

          
Bob Stayton
Sagehill Enterprises


          
 

          
 

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

            
From: Nancy Brandt 

            
To:  ; Bob Stayton 

            
Sent: Saturday, January 03, 
            2009 10:08 PM

            
Subject: Re: [docbook-apps] 
            Docbook: A front cover page is inserted twice -- please 
help!!!

            

            
              
              

                
                  
Hello Bob and all other Docbook users,

                  
 

                  
First of all, thank you Bob for your quick response! I 
                  appreciate it much!

                  
 

                  
Regarding the first problem, I don't really imagine how I 
                  can insert a book title into the template similar to how it is 
                  inserted into the first title-page (as in 
                  titlepage-templates.xsl).

                  
 

                  
Regarding the second problem, I removed the book 
                  template from my customization layer, but unfortunately the 
                  front cover still appears twice (as if the 
                  cover mechanism generates an even and odd page). After 
                  that comes the titlepage. However, the back cover page is OK. 
                  When I access the FO file, I see the call to the front 
                  coverpage background file only once!!?? I don't understand why 
                  this problem happens. Please, please advise!

                  
 

                  
Thank you very much in advance!!!!

                  
My best wishes,

                  
Nancy

                  

--- On Sat, 1/3/09, Bob Stayton 
                  <> wrote:

                  From: 
                    Bob Stayton <>
Subject: Re: 
                    [docbook-apps] Docbook: A front cover page is inserted twice 
                    -- please help!!!
To: , 
                    
Date: Saturday, January 
                    3, 2009, 3:43 PM

                    

                    

                    
Hi,

                    
Regarding problem 1, I don't 
                    see in your front.cover template anything that would output 
                    a book title.  The flow seems to contain only an empty 
                    fo:block.

                    
 

                    
Regarding problem 2, the 
                    stock template (starting with 1.73.1) with match="book" 
                    already calls the templates named 'front.cover' and 
                    'back.cover', so you don't need that customized book 
                    template.  That's why you get it twice.

                    
 

                    
 

                    
Bob Stayton
Sagehill 
                    Enterprises


                    
 

                    
 

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

                      
From: 
                      Nancy Brandt 

                      
To:  

                      
Sent: Saturday, 
                      January 03, 2009 12:24 PM

                      
Subject: 
                      [docbook-apps] Docbook: A front cover page is inserted 
                      twice -- please help!!!

                      

                      
                        
                        

                          
                            
Hi folks,

                            
 

                            
I am struggling with the book template (appears 
                            in division.xsl). I defined both the front cover and 
                            back cover in my custom.xsl. Then I call the book 
                            template as follows:
<xsl:template 
                            match="book">
  <xsl:call-template 
                            name="front.cover"/>
  
                            <xsl:apply-imports/>
  
                            <xsl:call-template 
                            name="back.cover"/>
</xsl:template>

                            
 

                            
 When I generate a PDF, the back cover is 
                            OK, but the front cover has the following severe 
                            problems:

                            
1) No book title is generated on the front 
                            cover's background/
2) The cover appears twice 
                            before the titlepage-first.

                            
 

                            
My template for the front coverpage is as 
                            follows:
<!--front coverpage 
                            layout-->
<xsl:template 
                            name="front.cover">
  <xsl:variable 
                            name="id">
    
                            <xsl:call-template 
                            name="object.id"/>
  
                            </xsl:variable>

                            
  <fo:page-sequence 
                            master-reference="front-cover">
      
                            <fo:flow 
                            flow-name="xsl-region-body">
    
                            <fo:block/>
      
                            </fo:flow>
    
                            </fo:page-sequence>
</xsl:template>

                            
 

                            
Its page sequence is defined as 
                            follows:
<xsl:template 
                            name="user.pagemasters">
<xsl:param 
                            name="front-cover.path">
  
                            <xsl:value-of
    
                            select="normalize-space(//bookinfo//imagedata[@role='frontcover']/@fileref)"/>
</xsl:param>

                            
<fo:simple-page-master 
                            master-name="front-cover"
                           
                            page-width="{$page.width}"
                           
                            page-height="{$page.height}"
                           
                            margin-top="0pt"
                           
                            margin-bottom="0pt"
                           
                            margin-left="0pt"
                           
                            margin-right="0pt">
      
                            <fo:region-body 
                            margin-bottom="0pt"
                      
                            column-gap="{$column.gap.titlepage}"
                      
                            column-count="{$column.count.titlepage}"
              
                            background-image="url({$front-cover.path})"/>
    
                            </fo:simple-page-master>
</xsl:template>

                            
 

                            
Please, please advise how to solve these 
                            issues!!!

                            
Thank you all in advance!!!
Best 
                            wishes,
Nancy
Next in thread → Next in month →