docbook-apps

  • 1.  keep-together and blockquotes

    Posted 04-11-2007 20:51
    
    
    Just by chance I have a blockquote in which a page break occurs between the quotation and the attribution.  This simply looks bad. I have tried using <?dbfo keep-together="always"?> after the <blockquote>, but it doesn't have any effect.

    <blockquote><?dbfo keep-together="always"?>
    <attribution>A. N. Author, <citetitle>A Title</citetitle></attribution>
    <para>Some long quotation here extending over several lines</para>
    </blockquote>
    I could use a hard page-break before the <blockquote>, but I'd rather not do that - some day it will turn around and bite me!  For a similar reason I don't like to use a soft page break, <?dbfo-need height="1.5in"?> before the blockquote, suppose I later change the line spacing in the document!

    Is there any way I can use 'keep-together' to force the quote and attribution to keep to the same page?

    I have tried to customize blockquote in fo/block.xsl, but it doesn't work, what am I doing wrong?

    <xsl:template match="blockquote">

    <!-- this variable added -->
     
    <xsl:variable name="keep.together">
       
    <xsl:call-template name="dbfo-attribute">
         
    <xsl:with-param name="pis"
                          select="processing-instruction('dbfo')"/>
         
    <xsl:with-param name="attribute" select="'keep-together'"/>
       
    </xsl:call-template>
     
    </xsl:variable>
    <!--  -->

     
    <fo:block xsl:use-attribute-sets="blockquote.properties">
       
    <xsl:call-template name="anchor"/>
       
    <fo:block>

    <!-- this test added -->
         
    <xsl:if test="$keep.together != ''">
           
    <xsl:attribute name="keep-together.within-column">
             
    <xsl:value-of select="$keep.together"/>
           
    </xsl:attribute>
         
    </xsl:if>
    <!--  -->

         
    <xsl:if test="title">
           
    <fo:block xsl:use-attribute-sets="formal.title.properties">
             
    <xsl:apply-templates select="." mode="object.title.markup"/>
           
    </fo:block>
         
    </xsl:if>
         
    <xsl:apply-templates select="*[local-name(.) != 'title'
                                       and local-name(.) != 'attribution']"/>
       
    </fo:block>
       
    <xsl:if test="attribution">
          <fo:block text-align="right">
            <xsl:text>&#x2014;</xsl:text>
           
    <xsl:apply-templates select="attribution"/>
         
    </fo:block>
       
    </xsl:if>
     
    </fo:block>
    </xsl:template>


    Ron
    Ron Catterall, Phd, DSc       email: ron@catterall.net
    Prolongacion de Hidalgo 140http://catterall.net/
    San Felipe del Aguatel: +52 951 520 1821
    Oaxaca      68020Mexicofax: +1 530 348 8309


  • 2.  Re: [docbook-apps] keep-together and blockquotes

    Posted 04-11-2007 21:11
    El Miércoles, 11 de Abril de 2007 22:50, Ron Catterall escribió:

    >
    >   <fo:block xsl:use-attribute-sets="blockquote.properties">
    >     <xsl:call-template name="anchor"/>
    >     <fo:block>
    >
    >
    >       <xsl:if test="$keep.together != ''">
    >         <xsl:attribute name="keep-together.within-column">
    >           <xsl:value-of select="$keep.together"/>
    >         </xsl:attribute>
    >       </xsl:if>
    >

    Try moving it to just after the first fo:block.

    <fo:block xsl:use-attribute-sets="blockquote.properties">

          <xsl:if test="$keep.together != ''">
            <xsl:attribute name="keep-together.within-column">
              <xsl:value-of select="$keep.together"/>
            </xsl:attribute>
          </xsl:if>

        <xsl:call-template name="anchor"/>
        <fo:block>


    --
    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



  • 3.  Re: [docbook-apps] keep-together and blockquotes

    Posted 04-12-2007 13:22
    Thanks, that did it.
    Ron

    >El Miércoles, 11 de Abril de 2007 22:50, Ron Catterall escribió:
    >
    >>
    > > <fo:block xsl:use-attribute-sets="blockquote.properties">
    >> <xsl:call-template name="anchor"/>
    >> <fo:block>
    >>
    >>
    >> <xsl:if test="$keep.together != ''">
    >> <xsl:attribute name="keep-together.within-column">
    >> <xsl:value-of select="$keep.together"/>
    >> </xsl:attribute>
    >> </xsl:if>
    >>
    >
    >Try moving it to just after the first fo:block.
    >
    > <fo:block xsl:use-attribute-sets="blockquote.properties">
    >
    > <xsl:if test="$keep.together != ''">
    > <xsl:attribute name="keep-together.within-column">
    > <xsl:value-of select="$keep.together"/>
    > </xsl:attribute>
    > </xsl:if>
    >
    > <xsl:call-template name="anchor"/>
    > <fo:block>
    >
    >
    >--
    >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


    --
    Ron Catterall, Phd, DSc email: ron@catterall.net
    Prolongacion de Hidalgo 140 http://catterall.net/
    San Felipe del Agua tel: +52 951 520 1821
    Oaxaca 68020 Mexico fax: +1 530 348 8309