#4 toc catastrophe when toc-depth < 2

open
nobody
None
5
2009-04-27
2001-07-10
Kevin Dunn
No

I want to list only chapters, not sections, in the TOC.
My cusomization worked with stylesheets up to 1.64:

;; Returns the depth of auto TOC that should be made at
the nd-level
(define (toc-depth nd)
(if (string=? (gi nd) (normalize "book"))
1 ;; only chapters in TOC
1))

In 1.71, there is a new line (line 70) in
print/dbautoc.dsl:

keep-with-next?: (if (= level 1) #t #f)

When toc-depth = 2, everything processes correctly
except that the first level of sections get listed and
I want to avoid that.

When toc-depth = 1, the TOC gets bumped from page iii
to iv and runs off the bottom of page iv. Page iii
(formerly first page of TOC) is now blank. When I
comment out line 70 of print/dbautoc.dsl, my book
processes correctly, i.e. chapters, no sections in TOC,
and all is right with the world.

I tried the following, but apparently my kung foo is
not the best:

keep-with-next?: (if (and (= level 1) (> toc-depth
1)) #t #f)

toc-depth is apparently the wrong type for making a
numerical comparison with ">".

While we are on the subject, it might be nice to have a
parameter in dbparam.dsl to control the depth of the
TOC, rather than having to include modified dsssl in
the customization. Something like:

(define %toc-entry-depth%
;; REFENTRY toc-entry-depth
;; PURP Controls the depth (Chapter, Section) in the
TOC
;; DESC
;; /REFENTRY
7)

Discussion

  • Jorge Godoy
    Jorge Godoy
    2001-08-07

    Logged In: YES
    user_id=100502

    Please, send me (godoy@users.sourceforge.net) your document
    (if possible... if not, send me a snippet of document where
    it also happens) and the customized stylesheet. I'll try
    reproducing it here.

     
  • Norman Walsh
    Norman Walsh
    2001-08-07

    • assigned_to: nobody --> kosek
     
  • Norman Walsh
    Norman Walsh
    2001-08-07

    • assigned_to: kosek --> godoy
     
  • Kevin Dunn
    Kevin Dunn
    2002-02-23

    Logged In: YES
    user_id=218715

    OK, sorry for the delay. The problem only appears when your
    TOC is longer than one page AND you wish to list only
    chapters, not sections, in the TOC. My book is longer than I
    think you want to see and I haven't taken the time to make a
    fake book long enough to illustrate the problem. However I
    have fixed it:

    All files are modified against docbook-dsssl-1.76

    In print/dbparam.dsl I added after %generate-book-toc%
    (after line 67):

    (define %book-toc-depth%
    ;; REFENTRY book-toc-depth
    ;; PURP Section level depth for TOC
    ;; DESC
    ;; Determines how deep the TOC should go.
    ;; book-toc-depth=1 will list chapters only.
    ;; book-toc-depth=2 will list sect1.
    ;; book-toc-depth=6 will list sect1, ..., sect5, etc.
    ;; /DESC
    ;; AUTHOR N/A
    ;; /REFENTRY
    6)

    This new parameter sets the depth for book TOC entries.

    In print/dbautoc.dsl I modified toc-depth (line 12):

    ;; Returns the depth of auto TOC that should be made at the
    nd-level
    (define (toc-depth nd)
    (if (string=? (gi nd) (normalize "book"))
    %book-toc-depth%
    1))

    In print/dbautoc.dsl I modified line 70:

    keep-with-next?: (if (and (= level 1) (>
    %book-toc-depth% 1)) #t #f)

    I am attaching modified dbparam.dsl and dbautoc.dsl which
    you can diff against the distribution.

     
  • Kevin Dunn
    Kevin Dunn
    2002-02-23

    print/dbautoc.dsl

     
    Attachments
  • Kevin Dunn
    Kevin Dunn
    2002-02-24

    print/dbparam.dsl

     
    Attachments
  • Kevin Dunn
    Kevin Dunn
    2002-02-24

    print/dbparam.dsl

     
    Attachments
    • assigned_to: godoy --> nobody
    • labels: --> 321158
     
    • milestone: --> 447635
     
  • Robert Stayton
    Robert Stayton
    2009-04-27

    • labels: 321158 -->
    • milestone: 447635 -->