numberer.scrbl (1330B)
1 #lang scribble/base 2 @(require scribble/core) 3 4 @(define P (make-numberer (lambda (v parent-number) 5 (values (list (format "[~a]" v) ; number in brackets 6 "") ; no separator afterward 7 (add1 v))) ; increment section number 8 1)) @; count from 1 9 @(define PL (make-numberer (lambda (v parent-number) 10 (values (list (if (null? parent-number) 11 (string v) ; top-level section is uppercase 12 (string-downcase (string v))) ; nested is lowercase 13 ",") ; "," as separator 14 (integer->char (add1 (char->integer v))))) ; increment letter 15 #\A)) @; count from A 16 17 @(define (P-section . s) (section #:style (style #f (list P)) s)) 18 @(define (PL-section . s) (section #:style (style #f (list PL)) s)) 19 @(define (PL-subsection . s) (subsection #:style (style #f (list PL)) s)) 20 21 @title{Two Tracks} 22 23 @P-section{Px} 24 25 @PL-section{Py} 26 27 @PL-section{PLx} 28 29 @P-section{Pz} 30 @PL-subsection{PL-subx} 31 @subsection{Normal} 32 @PL-subsection{PL-suby} 33 34 @PL-section{PLy} 35 36 @PL-section{PLz} 37 @subsection{Normal2}