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] Changing Table headers


On Thu, Apr 10, 2003 at 06:36:42PM -0400, Scott Anguish wrote:
> I've figured out how to move Table/Figure and other headers to the 
> bottom of the image by adding
> 
> <xsl:param name="formal.title.placement">
> figure after
> example before
> equation before
> table before
> procedure before
> </xsl:param>
> 
> to my custom .xsl file...  (this is great BTW... I wish it was 
> documented someplace)

Well, it is mentioned in:

http://www.sagehill.net/xml/docbookxsl/PrintCustomEx.html

under "Figure, table, and other title".
> 
> The next change I need to make is a bit more extreme though.
> 
> I'd prefer
> 
> <p class="title"><span class="title-header">Figure 1:</span> title 
> contents</p>
> 
> to having the entire thing bolded.
> 
> I've found where this bolding is done, and removed it entirely, but how 
> do I add it back in as above?

Add this to your customization layer:

<xsl:template name="formal.object.heading">
  <xsl:param name="object" select="."/>
  <p class="title">
    <xsl:choose>
      <xsl:when test="local-name($object) = 'figure'">
        <span class="title-header">
          <xsl:apply-templates select="$object" mode="object.title.markup">
            <xsl:with-param name="allow-anchors" select="1"/>
          </xsl:apply-templates>
        </span>
        <xsl:text> </xsl:text>
        <xsl:apply-templates select="$object" mode="title.markup">
          <xsl:with-param name="allow-anchors" select="1"/>
        </xsl:apply-templates>
      </xsl:when>
      <xsl:otherwise>
        <b>
          <xsl:apply-templates select="$object" mode="object.title.markup">
            <xsl:with-param name="allow-anchors" select="1"/>
          </xsl:apply-templates>
        </b>
      </xsl:otherwise>
    </xsl:choose>
  </p>
</xsl:template>

<xsl:param name="local.l10n.xml" select="document('')"/>
<l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0";>
  <l:l10n language="en">
    <l:context name="title">
      <l:template name="figure" text="Figure %n:"/>
    </l:context>
  </l:l10n>
</l:i18n>

This customizes the 'formal.object.heading' template
that outputs the title.  The original is found
in html/formal.xsl.  When the element is a figure,
I removed the <b> tags, as you probably already did.
Then I use object.title.markup to output just the "Figure
N:" part by changing the gentext template for figure
in context "title" to output just the label and number.
That's the second part in the 'local.l10n.xml' parameter.
Then I close the <span>, output text space, and use the
'title.markup' template, which outputs just the title.

I keep the original processing steps in the
xsl:otherwise part to handle non-figure formal objects.
You can expand the test to include tables, examples, etc.

-- 

Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
The SCO Group                               fax:   (831) 429-1887
                                            email: bobs at sco dot com

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


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