OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Subject: RE: DOCBOOK-APPS: 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>



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Powered by eList eXpress LLC