docbook-apps

Re: [docbook-apps] Incorrect page sequence for TOC/Lot and preface pages withdouble-sided output

  • 1.  Re: [docbook-apps] Incorrect page sequence for TOC/Lot and preface pages withdouble-sided output

    Posted 04-10-2011 17:54
    Hi Dave,

    If you are seeing incorrect margins, then the problem is not in the templates you have
    customized, but in the selection of the page masters as pages are generated. There is
    one more thing you need to do for eliminating the extra blank pages in page sequences.
    You need to customize the fo:page-sequence-master to remove the page-position="first"
    item, since the "first" page master's layout matches the "odd" page master layout, but
    that is not appropriate when the first page is even. Here is the original
    fo:page-sequence-master for "lot" in the template named "setup.pagemasters" in
    fo/pagesetup.xsl:


    <fo:page-sequence-master master-name="lot">
    <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"/>
    <fo:conditional-page-master-reference master-reference="lot-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">lot-even</xsl:when>
    <xsl:otherwise>lot-odd</xsl:otherwise>
    </xsl:choose>
    </xsl:attribute>
    </fo:conditional-page-master-reference>
    </fo:repeatable-page-master-alternatives>
    </fo:page-sequence-master>

    To customize this, your customization layer needs to have a template named
    "user.pagemasters" that contains a definition of a new fo:page-sequence-master that is
    the same as this one except it must have a new master-name and it must remove this
    element:

    <fo:conditional-page-master-reference master-reference="lot-first"
    page-position="first"/>

    You can also remove the element for "blank", but it is not necessary because the
    no-force option prevents it from being used. With those gone, each page master is
    selected only by "odd" or "even", so when the first page is even it should get the
    even page master with those margins.

    Then your customization layers needs to add a template named "select.user.pagemaster"
    to choose your new master-name for "lot". See this reference for more details on
    custom page masters:

    http://www.sagehill.net/docbookxsl/PageDesign.html


    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net