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


> From: Elliotte Rusty Harold <elharo@metalab.unc.edu>
> 
> 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? --

As far as I can tell, you succeeded.  8^)
When I put your figure template into a customization
layer, I get the same PDF output as before except
the figure title appears below the figure content.
What exactly was your experience?  I'm using 
version 1.44 of the Norm's fo stylesheets.

XSL processing is supposed to be stateless, so one template
cannot be affected by variables set by other templates, unless
the variables are explicitly passed to them using <xsl:with-param>.
Your reordering works as you expect in my tests.
Congratulations!

I agree that the positioning of figure titles should
be a customizable parameter.  You should file a feature
request on the sourceforge site. 

bobs
Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
Caldera International, Inc.                 fax:   (831) 429-1887
                                            email: bobs@caldera.com


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


Powered by eList eXpress LLC