This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Got a good hack for keep-with-next workaround forFOP?


> From: Phil Glaser [mailto:StillSmallVoice@DirectvInternet.com]
>
> I gather from the FOP list archive
> (http://marc.theaimsgroup.com/?l=fop-user&m=102102545323696&w=2)
> that keep-with-next just isn't implemented yet in FOP. The 
> suggestion in the above-referenced message is to use a
> "blind table" to keep figure title and
> image together. Can someone on this list share some XSL to
> add to my FO driver to do this? Or is there some other 
> workaround?

Thank's for the hint.

The template for figure, example, equation and table is
in fo/formal.xsl. There is already a table, but the image
and the header are placed in the same cell. I've split it
in two rows and it seems to work.

Add this two templates to your FO driver and let me know
if there are any problems.

Nicolas

---

<xsl:template name="formal.object">
  <xsl:param name="placement" select="'before'"/>

  <xsl:variable name="id">
    <xsl:call-template name="object.id"/>
  </xsl:variable>

 <fo:table table-layout="fixed" width="100%">
   <fo:table-column column-number="1"/>
   <fo:table-body>

    <xsl:if test="$placement = 'before'">
      <fo:table-row keep-with-next="always">
        <xsl:call-template name="formal.object.heading"/>
	</fo:table-row>
    </xsl:if>

    <fo:table-row>
	<fo:table-cell>
	  <fo:block id="{$id}"
            xsl:use-attribute-sets="formal.object.properties">
	    <xsl:apply-templates/>
	  </fo:block>
	</fo:table-cell>
    </fo:table-row>
	
    <xsl:if test="$placement != 'before'">
	  <fo:table-row keep-with-previous="always">
	    <xsl:call-template name="formal.object.heading"/>
	  </fo:table-row>
      </xsl:if>

    </fo:table-body>
  </fo:table>
</xsl:template>

<xsl:template name="formal.object.heading">
  <xsl:param name="title"></xsl:param>
  <fo:table-cell>
    <fo:block xsl:use-attribute-sets="formal.title.properties">
      <xsl:apply-templates select="." mode="object.title.markup"/>
    </fo:block>
  </fo:table-cell>
</xsl:template>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]