docbook-apps

  • 1.  RE: [docbook-apps] Selective pagebreaks

    Posted 07-23-2007 20:41
    What I have is a series of TESTS. Each test is a section. At the end of each TEST I have a "hard-pagebreak" which usually just forces the next section to start on a new page. However, if the section is "near" to the end of the pasge already, then it inserts another page.

    The PI that I use is the one from the book.

    <xsl:template match="processing-instruction('hard-pagebreak')">
    <fo:block break-before='page'/>
    </xsl:template>

    I wonder, could I use "break-after='page'" instead of before?


    -----Original Message-----
    From: M.Canales.es [mailto:macana@macana-es.com]
    Sent: Mon 7/23/2007 2:12 PM
    To: docbook-apps@lists.oasis-open.org
    Subject: Re: [docbook-apps] Selective pagebreaks

    El Lunes, 23 de Julio de 2007 20:58, Nelson, Dean escribió:

    >
    > Ideally I would like to make a PI that I can use on selected sections
    > that intelligently says "start a new page now". Any ideas?

    If you meant "start a new page on this section but not in this other", in LFS
    we have a customization that creates conditional new pages for sect1 based on
    if a descendant sect2 contains role="package" or not:



    <xsl:attribute-set name="section.level1.properties">
    <xsl:attribute name="break-before">
    <xsl:choose>
    <xsl:when
    test="preceding-sibling::sect1[position()=1]/sect2/@role='package'
    or self::sect1/sect2/@role='package'">page</xsl:when>
    <xsl:otherwise>
    <xsl:text>auto</xsl:text>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:attribute>
    </xsl:attribute-set>

    Note: This make use of @break-before just to avoid such extra blank pages.


    --
    Manuel Canales Esparcia
    Usuario de LFS nº2886: http://www.linuxfromscratch.org
    LFS en castellano: http://www.escomposlinux.org/lfs-es http://www.lfs-es.info
    TLDP-ES: http://es.tldp.org

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org





  • 2.  Re: [docbook-apps] Selective pagebreaks

    Posted 07-23-2007 21:01
    El Lunes, 23 de Julio de 2007 22:40, Nelson, Dean escribió:
    > What I have is a series of TESTS. Each test is a section. At the end of
    > each TEST I have a "hard-pagebreak" which usually just forces the next
    > section to start on a new page.

    Then, what you want is that all TEST must start on a new page, right?

    Do you have sections others than TEST that must not start on their own new
    page?

    > However, if the section is "near" to the
    > end of the pasge already, then it inserts another page.
    >
    > The PI that I use is the one from the book.
    >
    > <xsl:template match="processing-instruction('hard-pagebreak')">
    > <fo:block break-before='page'/>
    > </xsl:template>
    >
    > I wonder, could I use "break-after='page'" instead of before?

    Yes, it works also and might solve the blank pages issue, if you want continue
    using the PI.

    --
    Manuel Canales Esparcia
    Usuario de LFS nº2886: http://www.linuxfromscratch.org
    LFS en castellano: http://www.escomposlinux.org/lfs-es http://www.lfs-es.info
    TLDP-ES: http://es.tldp.org