docbook-apps

  • 1.  Re: Suppressing book title page in fo output?

    Posted 01-31-2008 06:29


    Hi Warren!

    Thanks for the reply.

    On Wed, 30 Jan 2008 17:40:04 +0200, Warren Young <warren@xxx> wrote:

    > I don't know what this other blank page you're referring to is. You
    > might need to post either a link to the generated PDF or the source that
    > created it.

    I provided a minimal example in my post. Here it is again:


    <book>


    <chapter>

    <para> abc</para>


    <para>blah blah</para>

    </chapter>
    </book>


    When rendered w/ docbook xsl fo stylesheets (and fo processor), there
    are three pages before the TOC.


    I'm using docbook xsl 1.72.2, saxon 655, java 160_03 and fop 0.94.
    Althought I'm pretty sure my toolchain has nothing to do with this.



    .::Antti::.






  • 2.  Re: [docbook-apps] Re: Suppressing book title page in fo output?

    Posted 01-31-2008 23:26
    Hi,
    There are two things going on here.

    The DocBook titlepage specs include a separator item after the title pages:

    <t:titlepage-separator>
    <fo:block break-after="page"/>
    </t:titlepage-separator>

    This is supposed to just force a page break after the end of the verso
    titlepage content. This works fine in XEP and Antenna House, but FOP
    creates an extra page with it. This is a long standing bug in FOP's
    handling of breaks. If you were retaining your title pages (recto and
    verso sides), then making this an empty element would eliminate the extra
    blank page before the TOC:

    <t:titlepage-separator>
    </t:titlepage-separator>

    But you are trying to eliminate the title pages as well. Creating an empty
    book.titlepage template seems like it should work, but it doesn't. That's
    because the template with match="book" in fo/division.xsl creates a
    page-sequence if a book has any front matter elements (such as title):

    <xsl:variable name="preamble"
    select="title|subtitle|titleabbrev|bookinfo|info"/>

    <xsl:if test="$preamble">
    <xsl:call-template name="page.sequence">
    <xsl:with-param name="master-reference"
    select="$titlepage-master-reference"/>
    <xsl:with-param name="content">
    <fo:block id="{$id}">
    <xsl:call-template name="book.titlepage"/>
    </fo:block>
    </xsl:with-param>
    </xsl:call-template>
    </xsl:if>

    So even if you make the book.titlepage empty, there is still a page sequence
    with an empty fo:block, so it will generate at least one page (two if you
    set double.sided = 1).

    So to start a book with the table of contents, you will need to either
    remove the book's title and bookinfo (so this page-sequence is not
    triggered), or customize the template with match="book" to remove this
    page-sequence entirely. I would recommend the latter.

    If you are using stylesheets prior to 1.73.0, then you will find the book
    template is much bigger. It was refactored in 1.73 to be more compact and
    easier to customize. If you need to customize it, you might consider
    upgrading to 1.73.2 first.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net