]> granicus.if.org Git - docbook-dsssl/commitdiff
Add force.blank.pages parameter to allow turning off blank
authorBob Stayton <bobs@sagehill.net>
Sun, 2 Dec 2012 20:06:41 +0000 (20:06 +0000)
committerBob Stayton <bobs@sagehill.net>
Sun, 2 Dec 2012 20:06:41 +0000 (20:06 +0000)
pages in double.sided output.

xsl/fo/pagesetup.xsl
xsl/fo/param.ent
xsl/fo/param.xweb

index d2f2e0dd160d22d416627dd574554621cae1a645..95008c7d1d2cb1cb8a7967a0a026ec450ffecd2a 100644 (file)
       <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="titlepage-first"
-                                              page-position="first"/>
+        <xsl:if test="$force.blank.pages != 0">
+          <fo:conditional-page-master-reference master-reference="titlepage-first"
+                                                page-position="first"/>
+        </xsl:if>
         <fo:conditional-page-master-reference master-reference="titlepage-odd"
                                               odd-or-even="odd"/>
         <fo:conditional-page-master-reference 
       <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="lot-first"
-                                              page-position="first"/>
+        <xsl:if test="$force.blank.pages != 0">
+          <fo:conditional-page-master-reference master-reference="lot-first"
+                                                page-position="first"/>
+        </xsl:if>
         <fo:conditional-page-master-reference master-reference="lot-odd"
                                               odd-or-even="odd"/>
         <fo:conditional-page-master-reference 
       <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="front-first"
-                                              page-position="first"/>
+        <xsl:if test="$force.blank.pages != 0">
+          <fo:conditional-page-master-reference master-reference="front-first"
+                                                page-position="first"/>
+        </xsl:if>
         <fo:conditional-page-master-reference master-reference="front-odd"
                                               odd-or-even="odd"/>
         <fo:conditional-page-master-reference 
       <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"/>
+        <xsl:if test="$force.blank.pages != 0">
+          <fo:conditional-page-master-reference master-reference="body-first"
+                                                page-position="first"/>
+        </xsl:if>
         <fo:conditional-page-master-reference master-reference="body-odd"
                                               odd-or-even="odd"/>
         <fo:conditional-page-master-reference 
       <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="back-first"
-                                              page-position="first"/>
+        <xsl:if test="$force.blank.pages != 0">
+          <fo:conditional-page-master-reference master-reference="back-first"
+                                                page-position="first"/>
+        </xsl:if>
         <fo:conditional-page-master-reference master-reference="back-odd"
                                               odd-or-even="odd"/>
         <fo:conditional-page-master-reference 
       <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="index-first"
-                                              page-position="first"/>
+        <xsl:if test="$force.blank.pages != 0">
+          <fo:conditional-page-master-reference master-reference="index-first"
+                                                page-position="first"/>
+        </xsl:if>
         <fo:conditional-page-master-reference master-reference="index-odd"
                                               odd-or-even="odd"/>
         <fo:conditional-page-master-reference 
         <fo:repeatable-page-master-alternatives>
           <fo:conditional-page-master-reference master-reference="blank-draft"
                                                 blank-or-not-blank="blank"/>
-          <fo:conditional-page-master-reference master-reference="titlepage-first-draft"
-                                                page-position="first"/>
+          <xsl:if test="$force.blank.pages != 0">
+            <fo:conditional-page-master-reference master-reference="titlepage-first-draft"
+                                                  page-position="first"/>
+          </xsl:if>
           <fo:conditional-page-master-reference master-reference="titlepage-odd-draft"
                                                 odd-or-even="odd"/>
           <fo:conditional-page-master-reference 
         <fo:repeatable-page-master-alternatives>
           <fo:conditional-page-master-reference master-reference="blank-draft"
                                                 blank-or-not-blank="blank"/>
-          <fo:conditional-page-master-reference master-reference="lot-first-draft"
-                                                page-position="first"/>
+          <xsl:if test="$force.blank.pages != 0">
+            <fo:conditional-page-master-reference master-reference="lot-first-draft"
+                                                  page-position="first"/>
+          </xsl:if>
           <fo:conditional-page-master-reference master-reference="lot-odd-draft"
                                                 odd-or-even="odd"/>
           <fo:conditional-page-master-reference 
         <fo:repeatable-page-master-alternatives>
           <fo:conditional-page-master-reference master-reference="blank-draft"
                                                 blank-or-not-blank="blank"/>
-          <fo:conditional-page-master-reference master-reference="front-first-draft"
-                                                page-position="first"/>
+          <xsl:if test="$force.blank.pages != 0">
+            <fo:conditional-page-master-reference master-reference="front-first-draft"
+                                                  page-position="first"/>
+          </xsl:if>
           <fo:conditional-page-master-reference master-reference="front-odd-draft"
                                                 odd-or-even="odd"/>
           <fo:conditional-page-master-reference 
         <fo:repeatable-page-master-alternatives>
           <fo:conditional-page-master-reference master-reference="blank-draft"
                                                 blank-or-not-blank="blank"/>
-          <fo:conditional-page-master-reference master-reference="body-first-draft"
-                                                page-position="first"/>
+          <xsl:if test="$force.blank.pages != 0">
+            <fo:conditional-page-master-reference master-reference="body-first-draft"
+                                                  page-position="first"/>
+          </xsl:if>
           <fo:conditional-page-master-reference master-reference="body-odd-draft"
                                                 odd-or-even="odd"/>
           <fo:conditional-page-master-reference 
         <fo:repeatable-page-master-alternatives>
           <fo:conditional-page-master-reference master-reference="blank-draft"
                                                 blank-or-not-blank="blank"/>
-          <fo:conditional-page-master-reference master-reference="back-first-draft"
-                                                page-position="first"/>
+          <xsl:if test="$force.blank.pages != 0">
+            <fo:conditional-page-master-reference master-reference="back-first-draft"
+                                                  page-position="first"/>
+          </xsl:if>
           <fo:conditional-page-master-reference master-reference="back-odd-draft"
                                                 odd-or-even="odd"/>
           <fo:conditional-page-master-reference 
         <fo:repeatable-page-master-alternatives>
           <fo:conditional-page-master-reference master-reference="blank-draft"
                                                 blank-or-not-blank="blank"/>
-          <fo:conditional-page-master-reference master-reference="index-first-draft"
-                                                page-position="first"/>
+          <xsl:if test="$force.blank.pages != 0">
+            <fo:conditional-page-master-reference master-reference="index-first-draft"
+                                                  page-position="first"/>
+          </xsl:if>
           <fo:conditional-page-master-reference master-reference="index-odd-draft"
                                                 odd-or-even="odd"/>
           <fo:conditional-page-master-reference 
   <xsl:param name="element" select="local-name(.)"/>
   <xsl:param name="master-reference" select="''"/>
 
+  <xsl:variable name="first">
+    <xsl:choose>
+      <xsl:when test="$force.blank.pages = 0">auto</xsl:when>
+      <xsl:otherwise>auto-odd</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
   <!-- Select the first content that the stylesheet places
        after the TOC -->
   <xsl:variable name="first.book.content" 
     <!-- double-sided output -->
     <xsl:when test="$double.sided != 0">
       <xsl:choose>
-        <xsl:when test="$element = 'toc'">auto-odd</xsl:when>
+        <xsl:when test="$element = 'toc'"><xsl:value-of select="$first"/></xsl:when>
         <xsl:when test="$element = 'book'">1</xsl:when>
         <!-- preface typically continues TOC roman numerals -->
         <!-- Change page.number.format if not -->
-        <xsl:when test="$element = 'preface'">auto-odd</xsl:when>
+        <xsl:when test="$element = 'preface'"><xsl:value-of select="$first"/></xsl:when>
         <xsl:when test="($element = 'dedication' or $element = 'article') 
                     and not(preceding::chapter
                             or preceding::preface
                             or parent::reference)">1</xsl:when>
         <xsl:when test="generate-id($first.book.content) =
                         generate-id(.)">1</xsl:when>
-        <xsl:otherwise>auto-odd</xsl:otherwise>
+        <xsl:otherwise><xsl:value-of select="$first"/></xsl:otherwise>
       </xsl:choose>
     </xsl:when>
 
   <xsl:param name="master-reference" select="''"/>
 
   <xsl:choose>
+    <!-- no automatic even blank pages at end of chapters -->
+    <xsl:when test="$force.blank.pages = 0">no-force</xsl:when>
     <!-- double-sided output -->
     <xsl:when test="$double.sided != 0">end-on-even</xsl:when>
     <!-- single-sided output -->
index 6ee9ad27a29746280bf4d685e303007155ce811a..8c0fb98017b223ebfb7ea32fe298738304a9b44c 100644 (file)
 <!ENTITY table.caption.properties SYSTEM "../params/table.caption.properties.xml">
 <!ENTITY para.properties SYSTEM "../params/para.properties.xml">
 <!ENTITY activate.external.olinks SYSTEM "../params/activate.external.olinks.xml">
+<!ENTITY force.blank.pages SYSTEM "../params/force.blank.pages.xml">
index 0f0f8a85cf13f56a70e8d4b679884786736fd7f6..81eb46f007b07e9c9d1b2f2a8dc3e75d75f9bb5a 100644 (file)
@@ -377,6 +377,7 @@ zero by default, so this is simply the page-master margin-right.
 &page.width.portrait;
 &paper.type;
 &double.sided;
+&force.blank.pages;
 &body.margin.bottom;
 &body.margin.top;
 &body.margin.inner;
@@ -668,6 +669,7 @@ around all these parameters.</para>
 <src:fragref linkend="footnote.sep.leader.properties.frag"/>
 <src:fragref linkend="fop.extensions.frag"/>
 <src:fragref linkend="fop1.extensions.frag"/>
+<src:fragref linkend="force.blank.pages.frag"/>
 <src:fragref linkend="formal.object.properties.frag"/>
 <src:fragref linkend="formal.procedures.frag"/>
 <src:fragref linkend="formal.title.placement.frag"/>