Re: suppressing simplesect numbering

Subject: Re: suppressing simplesect numbering
From: Norman Walsh <ndw@xxxxxxxxxx>
Date: Fri, 3 Sep 1999 07:28:38 -0400
/ Jose Carlos Ramalho <jcr@xxxxxxxxxxxx> was heard to say:
| > 
| > Uh, if they're on by default that's a bug. Or do you want proper sections
| > (sect*, section) numbered but simplesects unnumbered? Can you send me
| > a short sample?
| 
| Yes, that is what I want. 
| I want every sect* level to be numbered except simplesect.
| Is there a way to do this?

If you create a stylesheet customization that uses this version
of section-autolable, I think you'll get what you want...

(define (section-autolabel nd #!optional (force-label? #f))
  (let* ((isep (gentext-intra-label-sep nd))
	 (prefix (section-autolabel-prefix nd)))
    (if (and (or force-label? %section-autolabel%)
	     (or %label-preface-sections%
		 (not hasprf)))
	(cond
	 ((equal? (gi nd) (normalize "sect1"))
	  (string-append prefix (format-number (child-number nd) 
					       (label-number-format nd))))
	 ((equal? (gi nd) (normalize "sect2"))
	  (string-append 
	   (element-label (ancestor (normalize "sect1") nd) force-label?)
	   isep 
	   (format-number (child-number nd) (label-number-format nd))))
	 ((equal? (gi nd) (normalize "sect3"))
	  (string-append
	   (element-label (ancestor (normalize "sect2") nd) force-label?)
	   isep 
	   (format-number (child-number nd) (label-number-format nd))))
	 ((equal? (gi nd) (normalize "sect4"))
	  (string-append
	   (element-label (ancestor (normalize "sect3") nd) force-label?)
	   isep 
	   (format-number (child-number nd) (label-number-format nd))))
	 ((equal? (gi nd) (normalize "sect5"))
	  (string-append 
	   (element-label (ancestor (normalize "sect4") nd) force-label?)
	   isep 
	   (format-number (child-number nd) (label-number-format nd))))

	 ((equal? (gi nd) (normalize "simplesect"))
          "")
	 ((equal? (gi nd) (normalize "section"))
	  (if (node-list-empty? (ancestor (normalize "section") nd))
	      (string-append prefix (format-number (child-number nd) 
						   (label-number-format nd)))
	      (string-append 
	       (element-label (ancestor (normalize "section") nd) force-label?)
	       isep 
	       (format-number (child-number nd) (label-number-format nd)))))
	 (else (string-append (gi nd) " IS NOT A SECTION!")))
	"")))


                                        Cheers,
                                          norm

-- 
Norman Walsh <ndw@xxxxxxxxxx>      | My problems start when the smarter
http://nwalsh.com/                 | bears and the dumber visitors
                                   | intersect.--Steve Thompson,
                                   | wildlife biologist at Yosemite
                                   | National Park


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread