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: set level of section auto-numbering


On Mon, Jan 20, 2003 at 09:12:25PM +0100, Michael Wiedmann wrote:
> * Bob Stayton <bobs@caldera.com> [030120 11:47]:
> ...
> > There's an example of this in my book:
> > 
> > http://www.sagehill.net/xml/docbookxsl/GeneralCustoms.html#SectionNum
> > 
> > Let me know if it doesn't work for you.
> 
> Bob, that's fine if one uses <sectX> tags, but I prefer 
> nested <section> tags :-(
> 
> Any other ideas?

I think you'll have to customize a template, specifically
this one in common/labels.xsl:

<xsl:template match="section" mode="label.markup">

That template generates the numbers for sections, and is
used by the TOC, xrefs, and the section "title page"
(which is just the section title).  It is recursive,
working upward through its ancestors to generate the proper
nesting of numbers at different levels. You'll have
to make the whole process conditional on its section
level, which can be determined by counting section
ancestors with count(ancestor::section) and comparing
it to your limit.

You'll also have to change the gentext template for
section titles to remove the hard-coded dot that
appears between the %n number and %t title.
Otherwise you get a dot preceding the section title.
Unfortunately, there is no way to specify the section
level for a gentext template to make that conditional.

And of course, cross references to sections without
numbers need to be handled differently from
references to sections with numbers.  All in all,
it seems like a good candidate for a feature request.  8^)

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@sco.com


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