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: DOCBOOK-APPS: Putting titles below figures


Currently using the XSLT stylesheets 1.44 for Docbook the titles for all formal objects -- i.e. figures and examples -- are placed above the formal object. This is common practice for examples but not for figures. In most technical books the title goes below the figure. I know the caption goes below the figure currently, but the caption doesn't include the figure number so that's not what I really want. 

The relevant templates for formal objects are these:

<xsl:template match="figure|example">
  <xsl:call-template name="formal.object"/>
</xsl:template>

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

  <fo:block id="{$id}"
            xsl:use-attribute-sets="formal.object.properties">
    <xsl:call-template name="formal.object.heading"/>
    <xsl:apply-templates/>
  </fo:block>
</xsl:template>

Fixing this to do what I want seemed obvious, just override these templates in my driver stylesheet and flip the order of header and body for graphics; e.g.:

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

  <fo:block id="{$id}"
            xsl:use-attribute-sets="formal.object.properties">
    <xsl:apply-templates/>
    <xsl:call-template name="formal.object.heading"/>
  </fo:block>
</xsl:template>

However, it appears that the templates that get applied for the body of a figure depend on variables set by <xsl:call-template name="formal.object.heading"/> so I can't just flip the order. I tried to follow the logic of the various calls here to reproduce, but it's complicated and I got lost. :-(

The immediate question is whether anyone has a quick way to get my title s below my graphics instead of above.

The longer term question is whether this should be the default position for graphic titles? 
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+ 
|          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
|              http://www.ibiblio.org/xml/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      | 
|  Read Cafe con Leche for XML News: http://www.ibiblio.org/xml/     |
+----------------------------------+---------------------------------+


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


Powered by eList eXpress LLC