Re: [docbook-apps] Caption spacing in mediaobject

From
Bob Stayton <>
Date
2007-02-13T09:40:07+00:00
ID
246901c74f52$e9a5ac90$6400a8c0@totoro
Thread
Re: [docbook-apps] Caption spacing in mediaobject
Hi,
You could do two things:

1.  Remove the para wrapper in the caption. A caption doesn't require a 
para to contain its text, and the para uses the normal.para.spacing 
attribute-set that adds extra space.

2.  Customize the template that handles caption, from fo/graphics.xsl:

<xsl:template match="caption">
  <fo:block>
    <xsl:if test="@align = 'right' or @align = 'left' or @align='center'">
      <xsl:attribute name="text-align"><xsl:value-of
                         select="@align"/></xsl:attribute>
    </xsl:if>
    <xsl:apply-templates/>
  </fo:block>
</xsl:template>

You can add spacing properties to the fo:block element.  There really ought 
to be a caption.properties attribute-set, if you care to file a feature 
request on the DocBook SourceForge site.  8^)

Bob Stayton
Sagehill Enterprises
DocBook Consulting



----- Original Message ----- 
From: "Tavmjong Bah" <>
To: <>
Sent: Monday, February 12, 2007 2:04 PM
Subject: [docbook-apps] Caption spacing in mediaobject


>
> Hi,
>
> How do I control the spacing between an imageobject and a caption in
> PDF output? The default spacing puts a caption closer to a following
> figure than to the figure it belongs to. Also, is there a way to keep
> the image and caption on the same page? I see some reference that FOP
> 0.93 supports keeps but don't understand how they work.
>
> This is an example of what I have in my source file:
>
>  <mediaobject>
>   <imageobject>
>    <imagedata fileref="test.png" format="PNG" align="center"/>
>   </imageobject>
>   <textobject>
>    <phrase>Test</phrase>
>   </textobject>
>   <caption>
>    <para>
>     The caption.
>    </para>
>   </caption>
>  </mediaobject>
>  <mediaobject>
>   ...
>
> I am using FOP SVN and docbook-xsl-snapshot.
>
> Thanks,
>
> Tav
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: 
> For additional commands, e-mail: 
>
>
>