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] Font familiy of some automatically generated index-entries

----- Original Message ----- 
From: "Joachim Ziegler" <ziegler@mpi-sb.mpg.de>
To: "Bob Stayton" <bobs@sagehill.net>
Cc: "docbook-apps" <docbook-apps@lists.oasis-open.org>
Sent: Friday, February 06, 2004 5:53 AM
Subject: Re: [docbook-apps] Font familiy of some automatically generated

> Bob Stayton wrote:
> > If you look in fo/autoidx.xsl, the stylesheet module that handles
> > indexterms,
> > you will find this line:
> >
> > <xsl:value-of select="primary"/>
> >
> > Taking the value of an element returns just the text content of the
> > including those of its decendent elements.  I suspect this was done on
> > purpose to give the index a consistent look and to avoid complications
> > that might arise when elements are formatted. There are
> > elements that are allowed inside <primary> that would break the
> > of an index.  For example, revhistory is allowed, but it generates a
> >
> > If you want to change that behavior, you will need to customize several
> > templates in fo/autoidx.xsl. For example, replace the above line with:
> >
> > <xsl:apply-templates select="primary/child::node()"/>
> Thank you, this works fine, but there is one problem left that sometimes
> occurs:
> Imagine that in your document you first talk about stacks as a
> datastructure in general and later you talk about a (C++, Java,...)
> implementation "class stack". So you have two indexterms
> <indexterm><primary>stack</primary></indexterm>
> .
> .
> .
> <indexterm><primary><classname>stack</classname></primary></indexterm>
> There should be twe separate index entries, one for stack in general
> (proportional font), and one for the class stack (fixed font) so that
> the reader can quickly distinguish between them. Many books do it this
> way, e.g. Stroustrup (from which I've taken this stack example.)
> But the XSLT stylesheets map both indexterms to one entry.
> Is there any way to workaround this?

I thought this was going to be really hard, because the indexing
machinery is so complex and difficult to follow.

But actually, you can accomplish this without customizing the
stylesheet at all.  You can do it entirely in your source document.
The sortas attribute can be used to separate them:

<indexterm><primary sortas="stack classname">

If all the instances of the classname indexterm have a sortas attribute
that differs from the non-classname indexterms, then they will be treated
as different index entries.  You'll have to be careful to get them to sort
together if you have other "stack somethings".  You'll have to come
up with a naming scheme, maybe using a character that occurs
before all letters in the sort order.

Combined with the earlier customization, you should get what you want.

Bob Stayton
Sagehill Enterprises
DocBook Consulting

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