[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Sequential table numbering (as opposed to hierarchical) ?
Thank you very much! This is what I was looking for. I hadn't quite gotten into the customization layer, yet, but it was approaching like the proverbial light at the end of the tunnel (the other one, the one that's rushing towards you with a steam whistle blowing). :) - Johnson --- Keith Fahlgren <firstname.lastname@example.org> wrote: > On 7/13/07, Johnson Earls <email@example.com> wrote: > > I'm using DocBook v4.5, and the docbook-xsl 1.72.0 XSL > stylesheets. > > What I'd like to do is make it so my tables (and figures, etc.) > are > > numbered sequentially through the entire Book, instead of being > > numbered per-chapter. Is this something simple that I'm just > missing? > > Hi Johnson, > > There are a few factors that influence the way figures, tables, and > examples are numbered ("labeled"), one of which is the labeling of > the > chapters and parts above them (described in ). The second, which > takes precedence by default, is a @label attribute on the figure, > example, or table . This @label will be preserved verbatim if it > exists. However, that's not a very dynamic way to generate numbering > and creates unnecessary work. > > You asked specifically about sequential figure and table numbering, > so > here's how you'd set up a customization layer (you can't do it > using only parameters, I think), if you haven't already. Inside that, > override the template matching figures, tables, and examples in the > label.markup mode. The template you're overriding is in > common/labels.xsl. I'd customize it to look like so: > > <xsl:template match="figure|table|example" mode="label.markup"> > <xsl:choose> > <xsl:when test="@label"> > <xsl:value-of select="@label"/> > </xsl:when> > <xsl:otherwise> > <xsl:number format="1" from="book|article" level="any"/> > </xsl:otherwise> > </xsl:choose> > </xsl:template> > > Please note: This'll still allow you to override the autonumbering > with a @label. > > This should work on all the output types that have numbered figures, > tables, and examples. > > HTH, > Keith > > 1. http://www.sagehill.net/docbookxsl/SectionNumbering.html > 2. http://www.docbook.org/tdg/en/html/figure.html > " Label specifies an identifying string for presentation purposes. > > Generally, an explicit Label attribute is used only if the > processing system is incapable of generating the label automatically. > If present, the Label is normative; it will used even if the > processing system is capable of automatic labelling. " > 3. http://www.sagehill.net/docbookxsl/CustomMethods.html > > --------------------------------------------------------------------- > To unsubscribe, e-mail: firstname.lastname@example.org > For additional commands, e-mail: > email@example.com > > ____________________________________________________________________________________ Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out. http://answers.yahoo.com/dir/?link=list&sid=396545433