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: [docbook-apps] Why do captions appear centered?


> They do, both in HTML and FO output.

I haven't tried this, but in looking at the code for both HTML and FO, it
looks like the caption is included in the same block as the graphic, and so
picks up any alignment you put on the <imagedata/> element itself.  That
should be easy enough to change:

For HTML:
 <xsl:template match="mediaobject/caption|mediaobjectco/caption">
  <div class="{name(.)}" align="left">
   <xsl:apply-templates/>
  </div>
 </xsl:template>

or even in CSS:
 .mediaobject .caption, .mediaobjectco .caption { text-align: left;}

For FO:
 <xsl:template match="mediaobject/caption|mediaobjectco/caption">
  <fo:block text-align="left">
   <xsl:apply-templates/>
  </fo:block>
 </xsl:template>

> 
> This only looks good when a caption is so small that it fits into one 
> line, but
> 
> "A Caption is an extended description of a MediaObject."
> 
> "Extended" means IMHO a block of text that can become quite 
> large. And 
> that's what my captions are. Else they were just titles.
> 
> Am I wrong?

I think the definition of 'extended' is open to some interpretation.
Personally, I think a caption should be brief (about a line), just not as
brief as a title.  For example,

<figure>
 <title>Opening Screen</title>
 <mediaobject>
  <imageobject>...</imageobject>
  <caption><para>The opening screen of the application gives users quick
access
to the most common tasks</para></caption>
 </mediaobject>
</figure>

My caption here is "extended" in relation to the figure title, but I think
it would look just fine centered, if the image itself were centered.  I
think the current rendering by the XSLT stylesheets is just fine, and it's a
cinch to change.

Jeff Beal

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org


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