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] Formatting in index

[Moving this over to the docbook-apps mailing list where formatting topics 
are discussed]

It's possible to do that, but it isn't as easy as it should be.

If you create an indexterm like this;


you will find that the templates that generate the index don't retain the 
formatting.  That's because in fo/autoidx.xsl, in the template:

<xsl:template match="indexterm" mode="index-primary">

There is this line that outputs the text of the indexterm:

    <xsl:value-of select="primary"/>

When you use xsl:value-of on an element, it returns only the text nodes, no 
formatting.  I believe this was done by design so the index has a uniform 
look of plain text.  However, it creates other problems, like not retaining 
superscript and subscript in indexterms.

So to get what you want, you would need to copy that template to your 
customization layer and replace that line with:

   <xsl:apply-templates select="primary"/>

That would wrap the text for the index in an fo:inline with format 
properties.  Same with "index-secondary" processing the "secondary" element 
and "index-tertiary" for "tertiary" elements.

This kind of customization would be easier if the stylesheets modularized 
that bit of code into a separate template rather than burying it in the 
middle of a long complex template that you have to copy.

Bob Stayton
Sagehill Enterprises

----- Original Message ----- 
From: "Michael Galloy" <mgalloy@txcorp.com>
To: <docbook@lists.oasis-open.org>
Sent: Wednesday, June 25, 2008 11:00 AM
Subject: [docbook] Formatting in index

>I would like to add some routine names that are marked up with  "function" 
>tags to my index. It is not a problem to get them to show  up in the index, 
>but is there a way I can get them to appear in the  index with the same 
>formatting that they would appear with in the main  text? (I'm using FOP, 
>is this a FOP issue or a DocBook issue?)
> -Mike
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-help@lists.oasis-open.org

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