I went ahead and added something similar to the FO stylesheet.  I created a new 
param named 'force.blank.pages'.  When set to the default value of 1, you get 
the current behavior where each chapter starts on an odd page, and blank pages 
are generated as needed.  If set to zero, then each chapter starts on the next 
available page and no blank pages are generated.  This param is independent of 
double.sided.  This is in the current snapshot release, and will be in the next 
distribution.

Bob Stayton
Sagehill Enterprises
b...@sagehill.net


From: Xmplar 
Sent: Tuesday, November 06, 2012 2:39 AM
To: docbook@lists.oasis-open.org 
Subject: Re: [docbook] Omit blank pages after chapter and appendix in double 
sided output


I have a customization to eliminate blank pages between chapters, which 
requires a custom page sequence, based on Bob's post of 5 April 2012.

I have a variable "chaptersonrecto" - set to "1" to start chapters on a recto 
page, set to "0" to start chapters on any page.

Then in template name="user.pagemasters" (in pagesetup.xsl) I have this coding 
for custom pages in the "body" page sequence - so whenever you set 
"chaptersonrecto" to "0", this page sequence is selected for processing, 
otherwise it uses the standard page sequence for "body":

<xsl:if test="$chaptersonrecto = 0">
     <fo:page-sequence-master master-name="bodycustom">
       <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-first" 
page-position="first" odd-or-even="odd"/>        
         <!--<fo:conditional-page-master-reference master-reference="body-even" 
page-position="first" odd-or-even="even"/>-->
         <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:if>

Then in xsl:template name="select.user.pagemaster" I select that new page 
sequence where the "body" page sequence is replaced with "bodycustom", with:

<xsl:when test="$default-pagemaster = 'body'">
        <xsl:choose>
          <xsl:when test="$chaptersonrecto = 0">
            <xsl:value-of select="'bodycustom'"/>   
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="$default-pagemaster"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:when>

 

Then in xsl:template name="force.page.count" I set whether  chapter pages end 
on even or on any page (I have a more complex selection in the <xsl:when test> 
statement that forces the last chapter (before the appendices) to always end on 
even, and which includes part pages):

<xsl:when test="starts-with($master-reference,'bodycustom')">
        <xsl:choose>
                    <xsl:when test="($element = 'chapter' or $element = 
'article')
            and not(following-sibling::d:chapter or 
parent::d:part[following-sibling::d:part])">end-on-even</xsl:when>
          <xsl:otherwise>no-force</xsl:otherwise>
        </xsl:choose>
        </xsl:when>

Finally, I need to add "bodycustom" in various places in the templates 
header.content and footer.content so headers and footers appear correctly 
whenever the custom body page sequence is selected.

This could be adapted for the page class "back" which contains appendices.

Dave

On 04-11-12 8:48 AM, Marit wrote: 
Here I find myself able to generate print, interactive pdfs and epubs from
docbook and thought I knew a little or more, though it seems impossible to
omit blank pages after each chapter and appendix in a double sided
configuration (with of course, different marges left and right). 

So far, I have studied posts like
https://lists.oasis-open.org/archives/docbook-apps/200903/msg00168.html and
http://www.mail-archive.com/docbook-apps@lists.oasis-open.org/msg09285.html,
but whatever I try, right pages turn into left pages, pages skip numbering. 

Does anybody knows a good way in order to do this... basically in creating a
book, double sided without any blank page after chapters or appendixes? I
have a book with over 30 appendixes, so blank pages are not appreciated
(from a environmental perspective). 

Help is much appreciated.

Best regards,

Marit


Reply via email to