This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: How to output number of pages w/ Jade
- To: Udo Stenzel <udo at arthur dot sax dot sub dot de>
- Subject: Re: DOCBOOK-APPS: How to output number of pages w/ Jade
- From: Yann Dirson <ydirson at alcove dot fr>
- Date: Tue, 23 Oct 2001 09:19:57 +0200
- Cc: docbook-apps at lists dot oasis-open dot org
- List-Id: <docbook-apps.lists.oasis-open.org>
- References: <20011022204640.B16582@arthur.sax.sub.de>
On Mon, Oct 22, 2001 at 08:46:40PM +0200, Udo Stenzel wrote:
> I'd like to customize Norm's DSSSL-stylesheets so they put "page nn of
> mm" in the header where they only put "page nn".
That's a big problem it seems. I implemented Norm's suggestion of
putting <anchor id="EOF"> near the end of the file. If there is none,
I attempt to get the pagenum for the last element in the grove, but
unfortunately that does not work - I can't understand why.
The problem with the <anchor> solution (aside from being forced to
insert and maintain it), is that any back-matter generated material
(ToC, index...) doesn't get counted, so it is plain wrong in many
cases.
You'll notice I also tried (total-node-page-numbers), with no better
results.
(define ($pagenumber-with-total-sosofo$)
(make sequence
(literal "Page ")
(page-number-sosofo) ; FIXME: replace with $page-number-header-footer$ when
; possible to parametrize font-posture ?
(literal " of ")
;; use element with ID="EOF" for last page, or attempt to find last element
(let ((eof-elt (element-with-id (normalize "eof"))))
(if (node-list-empty? eof-elt)
(element-page-number-sosofo (last-descendant-node (sgml-root-element)))
(make link
destination: (idref-address (normalize "eof"))
(element-page-number-sosofo eof-elt))
))
;;; (total-node-page-numbers (sgml-root-element))
))
--
Yann Dirson <Yann.Dirson@fr.alcove.com> http://www.alcove.com/
Free-Software Engineer Ingénieur Logiciel-Libre
Free-Software time manager Responsable du temps Informatique-Libre
----------------------------------------------------------------
To subscribe or unsubscribe from this elist use the subscription
manager: <http://lists.oasis-open.org/ob/adm.pl>