This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .

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

# Jadetex - Page numbers: Roman, Arabic - Confused

• To: docbook-apps at lists dot oasis-open dot org
• Subject: DOCBOOK-APPS: Jadetex - Page numbers: Roman, Arabic - Confused
• From: Ian Castle <bb+lists dot docbook-apps at looksystems dot co dot uk>
• Date: Fri, 20 Apr 2001 13:11:03 +0100

Simple Problem: I want Verso/Recto title page to have no numbers,
Table(s) Of
Contents, Preface to have lower case roman numeral page numbering
(iii,iv...).
Chapters through to the end of the book to have arabic numerals starting
at
1,2,3..... The document is to be single sided (two sided is another
story!).

I'm confused because other people on the list (e.g
http://sources.redhat.com/ml/docbook-apps/2001-q1/msg00434.html) seem to
have
this working, but I don't.

Tool chain:

- Docbook DTD 4.1 (and 3.1).
- Style sheets unadulterated DSSSL 1.61
- Open Jade 1.3 + Patches for enhanced table support etc (to go with
3.x)
- JadeTex 3.4, 3.6
- TeTeX 1.0.7 + patches that come with Redhat 7.0 + hyperref 6.71a (as
jadetex 3.x requires it) + fancyhdr 2.0 2000/10/11.

What I get:

I observe that I have:

(define ($page-number-format$ #!optional (gi (gi)))
(cond
((equal? (normalize gi) (normalize "toc")) "i")
((equal? (normalize gi) (normalize "lot")) "i")
((equal? (normalize gi) (normalize "preface")) "i")
(else "1")))

in my style sheets and after running jade I can see lots of

\PageNumberFormat{i}

and

\PageNumberFormat{1}

in the resulting .tex file.

If I change the style sheet, to say, I or 1 or whatever then I see
corresponding changes in the output, so I conclude that jade and the
stylesheets are doing the correct thing.

Looking at jadetex.dtx, the only place where \PageNumberFormat is used
*seems
to me* [I am no TeXpert or TeXnician!] in the definition of  the \endSpS
"macro". I guess that this macro is run whenever a DSSSL
"simple-page-sequence" is terminated. The relevant part seems to be:

\ifnum\PageNumberRestart=1
\global\c@page \@ne
\gdef\thepage{\csname
PageNumbering@\PageNumberFormat\endcsname\c@page}%
\fi

Which, and I don't profess to understand it at all,  I assume is saying
some
like:

"at the end of the simple-page-sequence if we are restarting numbering,
then
globally (i.e. outside of the scope of the \EndSpS macro) set the page
number
format accordingly."

This seems reasonable (given the proviso that the first s-p-s will be
rendered in arabic as PageNumberFormat is only checked at the end of the
s-p-s - which is OK as my first s-p-s is the title page where I don't
actually want any numbers...)

However - this just seems to be attempting to set the format. It doesn't
actually cause the page number to be printed.

In the .tex file produced by jade I notice that there is one
\insertPageNumber for every page number to be produced...

... but... (and this is where my confusion starts)... \insertPageNumber
is
defined in jadetex.dtx as

\def\insertPageNumber#1{#1\arabic{page}}

Note the "\arabic" which seems to be saying (and empirical evidence
suggests
that it is) that it will ALWAYS use an arabic format regardless of the
anything set anywhere else.

If I put the following definition in my jadetex.cfg

\def\insertPageNumber#1{
\if\PageNumberFormat i
#1\roman{page}
\else
\if\PageNumberRestart 1
\setcounter{page}{1}
\arabic{page}
\else
#1\arabic{page}
\fi
\fi
}

Then I get what I want. Which is nice - but not necessarily very robust.
Especially the bit that resets the page number to 1 - this fails
miserably if
I use the dsssl style sheet option %page-number-restart%).

But I can't see how it can possibly work if you don't do something like
this.

Of course, if I do have a preface with roman numerals on the page, then
in
the table of contents it is rendered in arabic numerals. I can't even
begin
to conceive of how this could be remedied as the page number format
doesn't
seem to be some "state" that is associated with the page element - just
some
thing that gets worked out as the page number is actually rendered....

I had wondered if it was something to do with "fancyhdr" which I don't
understand. I notice in jadetex 3.6 that it now requires
fancyhdr[2000/10/10]. But searching through CTAN and anywhere else only
reveals a fancyhdr.sty that does not contain a "\ProvidesFile" or
"\ProvidesPackage" statement anywhere - just mentions 2.0 and 11/10/2000
in a
comment.

So where am I going wrong?

------------------------------------------------------------------
To unsubscribe from this elist send a message with the single word
"unsubscribe" in the body to: docbook-apps-request@lists.oasis-open.org



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