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] | [List Home]

Subject: Re: [docbook-apps] table title horizontal alignment, center

I think you will need to customize the template named formal.object.heading
in fo/formal.xsl.  Something like this:

<xsl:template name="formal.object.heading">
  <xsl:param name="object" select="."/>
  <xsl:param name="placement" select="'before'"/>

  <fo:block xsl:use-attribute-sets="formal.title.properties">
     <xsl:if test="self::table">
      <xsl:attribute name="text-align">center</xsl:attribute>
      <xsl:when test="$placement = 'before'">

    <xsl:apply-templates select="$object" mode="object.title.markup">
      <xsl:with-param name="allow-anchors" select="1"/>

It checks to see if the formal object is a table, and if so adds the
text-align attribute. I presume you only wanted to do this with tables, not
figures, examples, etc.

Bob Stayton
Sagehill Enterprises
DocBook Consulting

----- Original Message ----- 
From: "Steve Whitlatch" <swhitlat@getnet.net>
To: <docbook-apps@lists.oasis-open.org>
Sent: Wednesday, March 17, 2004 5:37 PM
Subject: [docbook-apps] table title horizontal alignment, center

> Hello,
> I am experimenting with techniques for horizontally aligning table
> titles. I have some XSL code that center aligns the table title text,
> but it fails to center align the prefix and autonumber.
> Here is the code from my XSL customization layer:
>   <xsl:template match="table" mode="insert.title.markup">
>        <xsl:param name="title"/>
>     <fo:block text-align="center"
>       <xsl:value-of select="$title"/>
>     </fo:block>
>   </xsl:template>
> Here is an ascii art depiction of what I get:
>     *      table row                                            *
>     ******************************************
>     *     last row of table                                   *
>     ******************************************
>     Table 1
>                        Table Title
> The text from <title>Table Title</title> is centered and moved down
> vertically about one line. And the "Table 1" portion is unaffected. I
> guess I should not be expecting anything else with that code though.
> Seems obvious. I'd like to keep both parts together and also prevent
> the entire displayed table title from moving down.
> Looks like I need something like:
> <xsl:value-of select="$title-plus-prefix-plus-autonumber"/>
> But it won't be that easy. Any suggestions?
> The answer to this question, and examples of applied solutions to all
> other questions I've asked on this list will be made available in a
> downloadable example DocBook XML document/project from my homepage.
> I'm trying to remove the worst errors/deficiencies before posting it.
> I've also got a round-trippable structured FrameMaker 7.0 version of
> the same document I made for comparison. I'll post both projects
> within a week or so.
> Thanks to Bob Stayton for all his patient help.
> Steve Whitlatch
> To unsubscribe from this list, send a post to
docbook-apps-unsubscribe@lists.oasis-open.org, or visit

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