This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: Labelling of figures
- From: "Juan R. Migoya" <jmigoya at ingeteam dot es>
- To: docbook-apps at lists dot oasis-open dot org
- Cc: Rory Hunter <roryh at fenriz dot org>
- Date: Mon, 18 Feb 2002 15:15:30 +0100
- Subject: Re: DOCBOOK-APPS: Labelling of figures
- References: <3C7056E8.10907@fenriz.org>
Redefine "block autolabel" (from common/dbcommon.dsl) to include
"section" as ancestor:
---------------------------------------------------------------------
(define (block-autolabel nd #!optional (force-label? #f))
(let* ((chn (element-label (ancestor (normalize "chapter") nd)))
(apn (element-label (ancestor (normalize "appendix") nd)))
(rfn (element-label (ancestor (normalize "refentry") nd)))
;; ************** Add this: *******************************
(secn (element-label (ancestor (normalize "section") nd)))
;; ********************************************************
(bkn (format-number (component-child-number
nd
(component-element-list))
(label-number-format nd))))
(if (equal? chn "")
(if (equal? apn "")
;; *********************** Add this: **************************
(if (equal? secn "")
;; ***********************************************************
(if (equal? rfn "")
bkn
(string-append rfn (gentext-intra-label-sep nd) bkn))
;; *********************** Add this: **************************
(string-append secn (gentext-intra-label-sep nd) bkn))
;; ************************************************************
(string-append apn (gentext-intra-label-sep nd) bkn))
(string-append chn (gentext-intra-label-sep nd) bkn))))
---------------------------------------------------------------------------
Keep in mind that this may be no good in all kind of documents.
HTH.
Regards,
Juan R. Migoya
SPAIN
Rory Hunter wrote:
> Hi,
>
> In an <article>, I notice that any <figure>'s are labelled numerically,
> incrementing for each consectutive figure in the document. Is it possible
> to have numbering restart for each <section>, so that figures are labelled
> e.g. Figure 4.1 for the first figure in the fourth section, using DSSSL?
>
> Cheers,
>
> -- Rory Hunter