Next in thread → Next in month →

Re: [docbook-apps] Limitting float span

From
=?JRN-8859-1?P?Damille_C=F9gnis?=
Date
2006-08-08T08:51:31+00:00
ID
Thread
Re: [docbook-apps] Limitting float span
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bob Stayton a 嶰rit :
> Hi,
> If you put a clear="both" on the fo:block generated for the para that
> follows the para with the graphic, then it will be pushed below the
> graphic.  Now the trick is to write a template pattern that matches on
> the following para.

Of course! :-) Thanks Bob, works great, as usual. These are the final
templates I use, is someone is interested. It could be easily duplicated
for right floats as well.

Camille.

  <!-- Allow for inlinegraphic floats -->

  <xsl:template match="para/inlinegraphic[not(preceding-sibling::text())] |
		       para/inlinemediaobject[not(preceding-sibling::text())]">
    <fo:float float="left" clear="both">
      <fo:block margin-right="1em">
	<xsl:apply-imports/>
      </fo:block>
    </fo:float>
  </xsl:template>

<!-- And do not wrap over following sibling -->

<xsl:template
match="*[preceding-sibling::para[inlinegraphic[not(preceding-sibling::text())]]
|
		
preceding-sibling::para[inlinemediaobject[not(preceding-sibling::text())]]]">
  <fo:block clear="both">
    <xsl:apply-imports/>
  </fo:block>
</xsl:template>

> Bob Stayton
> Sagehill Enterprises
> DocBook Consulting
> 
> 
> 
> ----- Original Message ----- From: "Camille B嶲nis" <>
> To: "apps docbook" <>
> Sent: Monday, August 07, 2006 5:09 AM
> Subject: [docbook-apps] Limitting float span
> 
> 
> Hello,
> 
> given following template:
> 
> <xsl:template match="para/inlinegraphic[not(preceding-sibling::text())]">
> <fo:float float="left" clear="both">
>    <fo:block margin-right="1em">
> <xsl:apply-imports/>
>    </fo:block>
>  </fo:float>
> </xsl:template>
> 
> 
> How can I avoid the float to limit itself to the parent para, and not to
> following ones?
> 
> e.g.:
> -------------------------------------------------------
> ________
> |  o   |  The para with the inlinegraphic in it
> | /|\  |
> |  /\  |
> --------
> Another paragraph
> -------------------------------------------------------
> Instead of:
> -------------------------------------------------------
> ________
> |  o   |  The para with the inlinegraphic in it
> | /|\  |  Another paragraph
> |  /\  |
> --------
> -------------------------------------------------------
> 
> Using <fo:list-block> doesn't really suits me because if first para text
> is longer than graphics, I want it to wrap the graphics below it...
> 
> Cheers,
> 
> Camille.
>>

> --------------------------------------------------------------------------------

- ---------------------------------------------------------------------
To unsubscribe, e-mail: 
For additional commands, e-mail: 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE2FCHjv9P65BfOUMRAtL5AKCBewG9R8wIRMlyI0iNUqbc4Apy1QCeLYE0
LMBFJ7GDclNVZqh0Q1PCQkQ=
=PKSV
-----END PGP SIGNATURE-----
Next in thread → Next in month →