Next in thread → Next in month →

Re: DOCBOOK-APPS: Reference element and chapter numbering

From
Vladimir Ivanovic <>
Date
2001-06-20T18:27:56+00:00
ID
Thread
Re: DOCBOOK-APPS: Reference element and chapter numbering
Norm, 

Thanks very much. I had to modify your suggestion slightly (see below).
It seems to work in all my tests. 

-- Vladimir

(define (en-label-number-format-list)
  (list
   (list (normalize "set")		"1")
   (list (normalize "book")		"1")
   (list (normalize "prefix")		"1")
   (list (normalize "part")		"I")
   (list (normalize "chapter")		"1")
   (list (normalize "appendix")		"A")
   ;(list (normalize "reference")	"1") ; references-as-chapters
   (list (normalize "reference")	"A") ; references-as-appendices
   (list (normalize "example")		"1")
   (list (normalize "figure")		"1")
   (list (normalize "table")		"1")
   (list (normalize "procedure")	"1")
   (list (normalize "step")		"1")
   (list (normalize "refsect1")		"1")
   (list (normalize "refsect2")		"1")
   (list (normalize "refsect3")		"1")
   (list (normalize "sect1")		"1")
   (list (normalize "sect2")		"1")
   (list (normalize "sect3")		"1")
   (list (normalize "sect4")		"1")
   (list (normalize "sect5")		"1")
   (list (normalize "section")		"1")
   ))

  ;;; for references-as-appendices
  (define (reference-number-sibling-list cmp) (list (normalize "appendix")))
  (define (appendix-number-sibling-list cmp)  (list (normalize "reference")))

  ;;; for references-as-chapters
  ;;(define (reference-number-sibling-list cmp) (list (normalize "chapter")))
  ;;(define (chapter-number-sibling-list cmp)  (list (normalize "reference")))

--------

"NW" == Norman Walsh <> writes:

  NW> / Vladimir Ivanovic <> was heard to say:
  >> I replaced Appendix A  with a Reference. Now my chapters are numbered 1,
  >> 2, 3, I, A  whereas they were formerly numbered 1, 2, 3, A, B.
  >> 
  >> I could live with 1, 2, 3, 4, A, but where does "I" come from? I've
  >> never seen roman numerals as chapter-like numbers in a book when arabic
  >> numerals exist. 

  NW> Parts are often numbered with roman numbers (Part I, Part II, etc.) and
  NW> the stylesheets treat References like Parts.

  >> To "fix" this, I tried using

  NW> Use this instead:

  NW> (define (en-label-number-format-list)
  NW>   (list
  NW>    (list (normalize "set")		"1")
  NW>    (list (normalize "book")		"1")
  NW>    (list (normalize "prefix")		"1")
  NW>    (list (normalize "part")		"I")
  NW>    (list (normalize "chapter")		"1")
  NW>    (list (normalize "appendix")		"A")
  NW>    (list (normalize "reference")	"A") ;; or 1
  NW>    (list (normalize "example")		"1")
  NW>    (list (normalize "figure")		"1")
  NW>    (list (normalize "table")		"1")
  NW>    (list (normalize "procedure")	"1")
  NW>    (list (normalize "step")		"1")
  NW>    (list (normalize "refsect1")		"1")
  NW>    (list (normalize "refsect2")		"1")
  NW>    (list (normalize "refsect3")		"1")
  NW>    (list (normalize "sect1")		"1")
  NW>    (list (normalize "sect2")		"1")
  NW>    (list (normalize "sect3")		"1")
  NW>    (list (normalize "sect4")		"1")
  NW>    (list (normalize "sect5")		"1")
  NW>    (list (normalize "section")		"1")
  NW>    ))

  NW> But now that I think about it, this will generate 1, 2, 3, A, A, ...

  NW> So you probably need this as well:

  NW> (define (reference-number-sibling-list cmp) (normalize "appendix"))
  NW> (define (appendix-number-sibling-list cmp)  (normalize "reference"))

  NW>                                         Be seeing you,
  NW>                                           norm

  NW> -- 
  NW> Norman Walsh <>      | The man with ten children is
  NW> http://www.oasis-open.org/docbook/ | better off than the one with ten
  NW> Chair, DocBook Technical Committee | thousand fonts of type, because
  >> the man with ten children doesn't
  >> want any more.
Next in thread → Next in month →