annotate lisp/w3/html32.dsl @ 172:a38aed19690b

Added tag r20-3b12 for changeset 929b76928fce
author cvs
date Mon, 13 Aug 2007 09:47:55 +0200
parents 34a5b81f86ba
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
134
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
1 <!doctype style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN">
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
2
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
3 ;; ######################################################################
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
4 ;;
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
5 ;; DSSSL style sheet for HTML 3.2 print output
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
6 ;;
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
7 ;; 1996.11.17
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
8 ;;
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
9 ;; Base version, August 1996: Jon Bosak, Sun Microsystems, based on work
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
10 ;; by Anders Berglund, EBT, with critical assistance from James Clark
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
11 ;; TOC section and recto/verso page treatments based on models by James
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
12 ;; Clark, October 1996
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
13 ;;
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
14 ;; ######################################################################
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
15
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
16 ;; Features in HTML 3.2 that are not implemented in the style sheet:
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
17 ;;
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
18 ;; automatic table column widths
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
19 ;; % on width attribute for TABLE
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
20 ;; attributes on TH and TD: align, valign, rowspan, colspan
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
21 ;; attributes on TABLE: width, align, border, cellspacing, cellpadding
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
22 ;; start attribute on OL
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
23 ;; value attribute on LI
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
24 ;; noshade attribute on HR
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
25 ;;
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
26 ;; See also "Non-Printing Elements" below
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
27 ;;
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
28 ;; Features in the style sheet that are not in HTML 3.2:
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
29 ;;
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
30 ;; page headers that display the HEAD TITLE content
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
31 ;; page footers that display the page number
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
32 ;; autonumbering of heads and table captions
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
33 ;; support for named units (pt, pi, cm, mm) in size attributes
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
34 ;; automatic TOC generation
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
35
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
36 ;; ============================== UNITS ================================
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
37
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
38 (define-unit pi (/ 1in 6))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
39 (define-unit pt (/ 1in 72))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
40 (define-unit px (/ 1in 96))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
41
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
42 ;; see below for definition of "em"
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
43
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
44
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
45 ;; ============================ PARAMETERS ==============================
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
46
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
47 ;; ........................... Basic "look" .............................
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
48
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
49 ;; Visual acuity levels are "normal", "presbyopic", and
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
50 ;; "large-type"; set the line following to choose the level
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
51
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
52 (define %visual-acuity% "normal")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
53 ;; (define %visual-acuity% "presbyopic")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
54 ;; (define %visual-acuity% "large-type")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
55
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
56 (define %bf-size%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
57 (case %visual-acuity%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
58 (("normal") 11pt)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
59 (("presbyopic") 12pt)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
60 (("large-type") 24pt)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
61 (define %mf-size% (- %bf-size% 1pt))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
62 (define %hf-size% %bf-size%)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
63
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
64 (define-unit em %bf-size%)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
65
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
66 (define %autonum-level% 6) ;; zero disables autonumbering
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
67 (define %flushtext-headlevel% ;; heads above this hang out on the left
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
68 (if (equal? %visual-acuity% "large-type") 6 4))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
69 (define %body-start-indent% ;; sets the white space on the left
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
70 (if (equal? %visual-acuity% "large-type") 0pi 4pi))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
71 (define %toc?% #t) ;; enables TOC after H1
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
72
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
73 ;; ........................ Basic page geometry .........................
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
74
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
75 (define %page-width% 8.5in)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
76 (define %page-height% 11in)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
77
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
78 (define %left-right-margin% 6pi)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
79 (define %top-margin%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
80 (if (equal? %visual-acuity% "large-type") 7.5pi 6pi))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
81 (define %bottom-margin%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
82 (if (equal? %visual-acuity% "large-type") 7.5pi 6pi))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
83 (define %header-margin%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
84 (if (equal? %visual-acuity% "large-type") 4.5pi 3pi))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
85 (define %footer-margin% 3.5pi)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
86
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
87 (define %text-width% (- %page-width% (* %left-right-margin% 2)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
88 (define %body-width% (- %text-width% %body-start-indent%))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
89
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
90 ;; .......................... Spacing factors ...........................
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
91
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
92 (define %para-sep% (/ %bf-size% 2.0))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
93 (define %block-sep% (* %para-sep% 2.0))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
94
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
95 (define %line-spacing-factor% 1.2)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
96 (define %bf-line-spacing% (* %bf-size% %line-spacing-factor%))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
97 (define %mf-line-spacing% (* %mf-size% %line-spacing-factor%))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
98 (define %hf-line-spacing% (* %hf-size% %line-spacing-factor%))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
99
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
100 (define %head-before-factor% 1.0)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
101 (define %head-after-factor% 0.6)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
102 (define %hsize-bump-factor% 1.2)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
103
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
104 (define %ss-size-factor% 0.6)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
105 (define %ss-shift-factor% 0.4)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
106 (define %smaller-size-factor% 0.9)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
107 (define %bullet-size-factor% 0.8)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
108
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
109 ;; ......................... Fonts and bullets ..........................
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
110
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
111 ;; these font selections are for Windows 95
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
112
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
113 (define %title-font-family% "Arial")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
114 (define %body-font-family% "Times New Roman")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
115 (define %mono-font-family% "Courier New")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
116 (define %dingbat-font-family% "Wingdings")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
117
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
118 ;; these "bullet strings" are a hack that is completely dependent on
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
119 ;; the Wingdings font family selected above; consider this a
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
120 ;; placeholder for suitable ISO 10646 characters
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
121
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
122 (define %disk-bullet% "l")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
123 (define %circle-bullet% "¡")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
124 (define %square-bullet% "o")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
125
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
126 (define %bullet-size% (* %bf-size% %bullet-size-factor%))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
127
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
128
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
129 ;; ========================== COMMON FUNCTIONS ==========================
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
130
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
131 (define (expt b n)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
132 (if (= n 0)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
133 1
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
134 (* b (expt b (- n 1)))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
135
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
136 ;; per ISO/IEC 10179
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
137 (define (node-list-reduce nl proc init)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
138 (if (node-list-empty? nl)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
139 init
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
140 (node-list-reduce (node-list-rest nl)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
141 proc
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
142 (proc init (node-list-first nl)))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
143
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
144 ;; per ISO/IEC 10179
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
145 (define (node-list-length nl)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
146 (node-list-reduce nl
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
147 (lambda (result snl)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
148 (+ result 1))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
149 0))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
150
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
151 (define if-front-page
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
152 (external-procedure "UNREGISTERED::James Clark//Procedure::if-front-page"))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
153
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
154 (define if-first-page
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
155 (external-procedure "UNREGISTERED::James Clark//Procedure::if-first-page"))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
156
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
157 (define upperalpha
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
158 '(#\A #\B #\C #\D #\E #\F #\G #\H #\I #\J #\K #\L #\M
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
159 #\N #\O #\P #\Q #\R #\S #\T #\U #\V #\W #\X #\Y #\Z))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
160
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
161 (define loweralpha
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
162 '(#\a #\b #\c #\d #\e #\f #\g #\h #\i #\j #\k #\l #\m
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
163 #\n #\o #\p #\q #\r #\s #\t #\u #\v #\w #\x #\y #\z))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
164
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
165 (define (char-downcase ch)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
166 (case ch
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
167 ((#\A) #\a) ((#\B) #\b) ((#\C) #\c) ((#\D) #\d) ((#\E) #\e)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
168 ((#\F) #\f) ((#\G) #\g) ((#\H) #\h) ((#\I) #\i) ((#\J) #\j)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
169 ((#\K) #\k) ((#\L) #\l) ((#\M) #\m) ((#\N) #\n) ((#\O) #\o)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
170 ((#\P) #\p) ((#\Q) #\q) ((#\R) #\r) ((#\S) #\s) ((#\T) #\t)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
171 ((#\U) #\u) ((#\V) #\v) ((#\W) #\w) ((#\X) #\x) ((#\Y) #\y)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
172 ((#\Z) #\z) (else ch)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
173
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
174 (define (LOCASE slist)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
175 (if (null? slist)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
176 '()
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
177 (cons (char-downcase (car slist)) (LOCASE (cdr slist)))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
178
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
179 (define (STR2LIST s)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
180 (let ((len (string-length s)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
181 (let loop ((i 0) (ln len))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
182 (if (= i len)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
183 '()
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
184 (cons (string-ref s i) (loop (+ i 1) ln))))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
185
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
186 (define (STRING-DOWNCASE s)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
187 (apply string (LOCASE (STR2LIST s))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
188
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
189 (define (UNAME-START-INDEX u last)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
190 (let ((c (string-ref u last)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
191 (if (or (member c upperalpha) (member c loweralpha))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
192 (if (= last 0)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
193 0
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
194 (UNAME-START-INDEX u (- last 1)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
195 (+ last 1))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
196
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
197 (define (PARSEDUNIT u) ;; this doesn't deal with "%" yet
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
198 (if (string? u)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
199 (let ((strlen (string-length u)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
200 (if (> strlen 2)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
201 (let ((u-s-i (UNAME-START-INDEX u (- strlen 1))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
202 (if (= u-s-i 0) ;; there's no number here
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
203 1pi ;; so return something that might work
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
204 (if (= u-s-i strlen) ;; there's no unit name here
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
205 (* (string->number u) 1px) ;; so default to pixels (3.2)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
206 (let* ((unum (string->number
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
207 (substring u 0 u-s-i)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
208 (uname (STRING-DOWNCASE
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
209 (substring u u-s-i strlen))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
210 (case uname
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
211 (("mm") (* unum 1mm))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
212 (("cm") (* unum 1cm))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
213 (("in") (* unum 1in))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
214 (("pi") (* unum 1pi))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
215 (("pc") (* unum 1pi))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
216 (("pt") (* unum 1pt))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
217 (("px") (* unum 1px))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
218 (("barleycorn") (* unum 2pi)) ;; extensible!
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
219 (else
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
220 (cond
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
221 ((number? unum)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
222 (* unum 1px))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
223 ((number? (string->number u))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
224 (* (string->number u) 1px))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
225 (else u))))))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
226 (if (number? (string->number u))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
227 (* (string->number u) 1px)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
228 1pi)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
229 1pi))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
230
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
231 (define (INLIST?)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
232 (or
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
233 (have-ancestor? "OL")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
234 (have-ancestor? "UL")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
235 (have-ancestor? "DIR")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
236 (have-ancestor? "MENU")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
237 (have-ancestor? "DL")))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
238
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
239 (define (INHEAD?)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
240 (or
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
241 (have-ancestor? "H1")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
242 (have-ancestor? "H2")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
243 (have-ancestor? "H3")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
244 (have-ancestor? "H4")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
245 (have-ancestor? "H5")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
246 (have-ancestor? "H6")))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
247
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
248 (define (HSIZE n)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
249 (* %bf-size%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
250 (expt %hsize-bump-factor% n)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
251
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
252 (define (OLSTEP)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
253 (case (modulo (length (hierarchical-number-recursive "OL")) 4)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
254 ((1) 1.2em)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
255 ((2) 1.2em)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
256 ((3) 1.6em)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
257 ((0) 1.4em)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
258
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
259 (define (ULSTEP) 1em)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
260
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
261 (define (PQUAD)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
262 (case (attribute-string "align")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
263 (("LEFT") 'start)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
264 (("CENTER") 'center)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
265 (("RIGHT") 'end)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
266 (else (inherited-quadding))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
267
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
268 (define (HQUAD)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
269 (cond
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
270 ((string? (attribute-string "align")) (PQUAD))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
271 ((have-ancestor? "CENTER") 'center)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
272 ((have-ancestor? "DIV") (inherited-quadding))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
273 (else 'start)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
274
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
275 (define (BULLSTR sty)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
276 (case sty
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
277 (("circle") %circle-bullet%)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
278 (("square") %square-bullet%)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
279 (else %disk-bullet%)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
280
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
281
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
282 ;; ======================= NON-PRINTING ELEMENTS ========================
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
283
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
284 ;; Note that HEAD includes TITLE, ISINDEX, BASE, META, STYLE,
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
285 ;; SCRIPT, and LINK as possible children
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
286
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
287 (element HEAD (empty-sosofo))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
288 (element FORM (empty-sosofo))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
289 (element APPLET (empty-sosofo))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
290 (element PARAM (empty-sosofo))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
291 (element TEXTFLOW (empty-sosofo))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
292 (element MAP (empty-sosofo))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
293 (element AREA (empty-sosofo))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
294
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
295
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
296 ;; ========================== TABLE OF CONTENTS =========================
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
297
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
298 ;; Container elements in which to look for headings
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
299 (define %clist% '("BODY" "DIV" "CENTER" "BLOCKQUOTE" "FORM"))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
300
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
301 (mode toc
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
302 (element h1 (empty-sosofo))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
303 (element h2 ($toc-entry$ 2))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
304 (element h3 ($toc-entry$ 3))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
305 (element h4 ($toc-entry$ 4))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
306 (element h5 ($toc-entry$ 5))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
307 (element h6 ($toc-entry$ 6))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
308 (default (apply process-matching-children
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
309 (append %hlist% %clist%)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
310 )
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
311
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
312 (define %toc-indent% 1em)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
313
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
314 (define ($toc-entry$ level)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
315 (make paragraph
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
316 use: para-style
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
317 start-indent: (+ %body-start-indent%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
318 (* %toc-indent% (+ 1 level)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
319 first-line-start-indent: (* -3 %toc-indent%)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
320 quadding: 'start
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
321 (literal (NUMLABEL level))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
322 (make link
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
323 destination: (current-node-address)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
324 (with-mode #f (process-children-trim)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
325 (make leader (literal "."))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
326 (current-node-page-number-sosofo)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
327
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
328 (define (MAKEBODYRULE)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
329 (make rule
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
330 orientation: 'horizontal
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
331 space-before: (* 2 %block-sep%)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
332 space-after: (* 2 %block-sep%)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
333 line-thickness: 1pt
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
334 length: %body-width%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
335 start-indent: %body-start-indent%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
336 display-alignment: 'start))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
337
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
338 (define (MAKETOC)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
339 (if %toc?%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
340 (sosofo-append
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
341 (MAKEBODYRULE)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
342 (make paragraph
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
343 font-family-name: %title-font-family%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
344 font-weight: 'bold
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
345 font-posture: 'upright
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
346 font-size: (HSIZE 2)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
347 line-spacing: (* (HSIZE 2) %line-spacing-factor%)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
348 space-before: (* (HSIZE 2) %head-before-factor%)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
349 space-after: (* (HSIZE 2) %head-after-factor%)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
350 start-indent: %body-start-indent%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
351 quadding: 'start
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
352 keep-with-next?: #t
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
353 (literal "Table of Contents"))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
354 (with-mode toc
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
355 (process-node-list (ancestor "BODY")))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
356 (MAKEBODYRULE))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
357 (empty-sosofo)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
358
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
359 ;; ============================ TOP LEVEL ===============================
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
360
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
361 (define page-style
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
362 (style
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
363 page-width: %page-width%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
364 page-height: %page-height%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
365 left-margin: %left-right-margin%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
366 right-margin: %left-right-margin%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
367 top-margin: %top-margin%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
368 bottom-margin: %bottom-margin%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
369 header-margin: %header-margin%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
370 footer-margin: %footer-margin%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
371 font-family-name: %body-font-family%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
372 font-size: %bf-size%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
373 line-spacing: %bf-line-spacing%))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
374
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
375 (element HTML
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
376 (let ((page-footer
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
377 (make sequence
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
378 font-size: %hf-size%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
379 line-spacing: %hf-line-spacing%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
380 font-posture: 'italic
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
381 (literal "Page ")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
382 (page-number-sosofo)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
383 (page-header
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
384 (make sequence
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
385 font-size: %hf-size%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
386 line-spacing: %hf-line-spacing%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
387 font-posture: 'italic
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
388 (process-first-descendant "TITLE"))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
389 (make simple-page-sequence
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
390 use: page-style
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
391 left-header: (if-first-page
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
392 (empty-sosofo)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
393 (if-front-page (empty-sosofo) page-header))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
394 right-header: (if-first-page
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
395 (empty-sosofo)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
396 (if-front-page page-header (empty-sosofo)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
397 left-footer: (if-first-page
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
398 (empty-sosofo)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
399 (if-front-page (empty-sosofo) page-footer))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
400 right-footer: (if-first-page
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
401 (empty-sosofo)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
402 (if-front-page page-footer (empty-sosofo)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
403 input-whitespace-treatment: 'collapse
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
404 quadding: 'justify
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
405 (process-children-trim))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
406
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
407 (element BODY (process-children-trim))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
408
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
409 ;; ========================== BLOCK ELEMENTS ============================
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
410
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
411 ;; ............................ Generic DIV .............................
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
412
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
413 (element DIV
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
414 (let ((align (attribute-string "align")))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
415 (make display-group
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
416 quadding:
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
417 (case align
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
418 (("LEFT") 'start)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
419 (("CENTER") 'center)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
420 (("RIGHT") 'end)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
421 (else 'justify))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
422 (process-children-trim))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
423
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
424 (element CENTER
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
425 (make display-group
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
426 quadding: 'center
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
427 (process-children-trim)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
428
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
429
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
430 ;; .............................. Headings ..............................
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
431
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
432 (define %hlist% '("H1" "H2" "H3" "H4" "H5" "H6"))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
433
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
434 (define (NUMLABEL hlvl)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
435 (let ((enl (element-number-list
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
436 (reverse (list-tail (reverse %hlist%) (- 6 hlvl))))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
437 (let loop ((idx 1))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
438 (if (or (= idx %autonum-level%) (= idx hlvl))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
439 (if (= idx 2) ". " " ")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
440 (let ((thisnum (list-ref enl idx)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
441 (string-append
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
442 (if (> idx 1) "." "")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
443 (format-number thisnum "1")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
444 (loop (+ idx 1))))))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
445
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
446 (define ($heading$ headlevel)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
447 (let ((headsize (if (= headlevel 6) 0 (- 5 headlevel))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
448 (make paragraph
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
449 font-family-name: %title-font-family%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
450 font-weight: (if (< headlevel 6) 'bold 'medium)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
451 font-posture: (if (< headlevel 6) 'upright 'italic)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
452 font-size: (HSIZE headsize)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
453 line-spacing: (* (HSIZE headsize) %line-spacing-factor%)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
454 space-before: (* (HSIZE headsize) %head-before-factor%)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
455 space-after: (if (and %toc?% (= headlevel 1))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
456 4em ;; space if H1 before TOC
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
457 (* (HSIZE headsize) %head-after-factor%))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
458 start-indent:
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
459 (if (< headlevel %flushtext-headlevel%)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
460 0pt
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
461 %body-start-indent%)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
462 quadding: (HQUAD)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
463 keep-with-next?: #t
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
464 break-before: (if (and
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
465 %toc?%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
466 (= headlevel 2)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
467 (= (child-number) 1))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
468 'page #f) ;; if TOC on, break before first H2
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
469 (literal
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
470 (if (and (<= headlevel %autonum-level%) (> headlevel 1))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
471 (NUMLABEL headlevel)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
472 (string-append "")))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
473 (process-children-trim))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
474
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
475 (element H1
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
476 (sosofo-append
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
477 ($heading$ 1)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
478 (MAKETOC)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
479
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
480 (element H2 ($heading$ 2))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
481 (element H3 ($heading$ 3))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
482 (element H4 ($heading$ 4))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
483 (element H5 ($heading$ 5))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
484 (element H6 ($heading$ 6))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
485
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
486
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
487 ;; ............................ Paragraphs ..............................
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
488
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
489 (define para-style
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
490 (style
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
491 font-size: %bf-size%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
492 font-weight: 'medium
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
493 font-posture: 'upright
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
494 font-family-name: %body-font-family%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
495 line-spacing: %bf-line-spacing%))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
496
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
497 (element P
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
498 (make paragraph
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
499 use: para-style
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
500 space-before: %para-sep%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
501 start-indent: %body-start-indent%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
502 quadding: (PQUAD)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
503 (process-children-trim)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
504
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
505 (element ADDRESS
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
506 (make paragraph
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
507 use: para-style
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
508 font-posture: 'italic
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
509 space-before: %para-sep%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
510 start-indent: %body-start-indent%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
511 (process-children-trim)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
512
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
513 (element BLOCKQUOTE
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
514 (make paragraph
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
515 font-size: (- %bf-size% 1pt)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
516 line-spacing: (- %bf-line-spacing% 1pt)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
517 space-before: %para-sep%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
518 start-indent: (+ %body-start-indent% 1em)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
519 end-indent: 1em
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
520 (process-children-trim)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
521
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
522 (define ($monopara$)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
523 (make paragraph
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
524 use: para-style
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
525 space-before: %para-sep%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
526 start-indent: %body-start-indent%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
527 lines: 'asis
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
528 font-family-name: %mono-font-family%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
529 font-size: %mf-size%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
530 input-whitespace-treatment: 'preserve
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
531 quadding: 'start
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
532 (process-children-trim)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
533
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
534 (element PRE ($monopara$))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
535 (element XMP ($monopara$))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
536 (element LISTING ($monopara$))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
537 (element PLAINTEXT ($monopara$))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
538
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
539 (element BR
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
540 (make display-group
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
541 (empty-sosofo)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
542
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
543
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
544 ;; ................... Lists: UL, OL, DIR, MENU, DL .....................
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
545
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
546 (define ($list-container$)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
547 (make display-group
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
548 space-before: (if (INLIST?) %para-sep% %block-sep%)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
549 space-after: (if (INLIST?) %para-sep% %block-sep%)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
550 start-indent: (if (INLIST?)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
551 (inherited-start-indent)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
552 %body-start-indent%)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
553
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
554 (define ($li-para$)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
555 (make paragraph
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
556 use: para-style
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
557 start-indent: (+ (inherited-start-indent) (OLSTEP))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
558 first-line-start-indent: (- (OLSTEP))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
559 (process-children-trim)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
560
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
561 (element UL ($list-container$))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
562
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
563 (element (UL LI)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
564 (let ((isnested (> (length (hierarchical-number-recursive "UL")) 1)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
565 (make paragraph
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
566 use: para-style
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
567 space-before:
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
568 (if (attribute-string "compact" (ancestor "UL")) 0pt %para-sep%)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
569 start-indent: (+ (inherited-start-indent) (ULSTEP))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
570 first-line-start-indent: (- (ULSTEP))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
571 (make line-field
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
572 font-family-name: %dingbat-font-family%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
573 font-size: (if isnested
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
574 (* %bullet-size% %bullet-size-factor%)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
575 %bullet-size%)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
576 field-width: (ULSTEP)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
577 (literal
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
578 (let
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
579 ((litype
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
580 (attribute-string "type"))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
581 (ultype
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
582 (attribute-string "type" (ancestor "UL"))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
583 (cond
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
584 ((string? litype) (BULLSTR (STRING-DOWNCASE litype)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
585 ((string? ultype) (BULLSTR (STRING-DOWNCASE ultype)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
586 (else %disk-bullet%)))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
587 (process-children-trim))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
588
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
589 (element (UL LI P) ($li-para$))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
590
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
591 (element OL ($list-container$))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
592
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
593 (element (OL LI)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
594 (make paragraph
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
595 use: para-style
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
596 space-before:
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
597 (if (attribute-string "compact" (ancestor "OL")) 0pt %para-sep%)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
598 start-indent: (+ (inherited-start-indent) (OLSTEP))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
599 first-line-start-indent: (- (OLSTEP))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
600 (make line-field
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
601 field-width: (OLSTEP)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
602 (literal
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
603 (case (modulo
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
604 (length (hierarchical-number-recursive "OL")) 4)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
605 ((1) (string-append
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
606 (format-number (child-number) "1") "."))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
607 ((2) (string-append
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
608 (format-number (child-number) "a") "."))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
609 ((3) (string-append
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
610 "(" (format-number (child-number) "i") ")"))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
611 ((0) (string-append
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
612 "(" (format-number (child-number) "a") ")")))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
613 (process-children-trim)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
614
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
615 (element (OL LI P) ($li-para$))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
616
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
617 ;; Note that DIR cannot properly have block children. Here DIR is
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
618 ;; interpreted as an unmarked list without extra vertical
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
619 ;; spacing.
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
620
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
621 (element DIR ($list-container$))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
622
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
623 (element (DIR LI)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
624 (make paragraph
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
625 use: para-style
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
626 start-indent: (+ (inherited-start-indent) (* 2.0 (ULSTEP)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
627 first-line-start-indent: (- (ULSTEP))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
628 (process-children-trim)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
629
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
630 ;; Note that MENU cannot properly have block children. Here MENU is
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
631 ;; interpreted as a small-bulleted list with no extra vertical
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
632 ;; spacing.
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
633
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
634 (element MENU ($list-container$))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
635
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
636 (element (MENU LI)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
637 (make paragraph
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
638 use: para-style
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
639 start-indent: (+ (inherited-start-indent) (ULSTEP))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
640 first-line-start-indent: (- (ULSTEP))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
641 (make line-field
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
642 font-family-name: %dingbat-font-family%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
643 font-size: %bullet-size%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
644 field-width: (ULSTEP)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
645 (literal %disk-bullet%))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
646 (process-children-trim)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
647
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
648 ;; This treatment of DLs doesn't apply a "compact" attribute set at one
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
649 ;; level to any nested DLs. To change this behavior so that nested
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
650 ;; DLs inherit the "compact" attribute from an ancestor DL, substitute
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
651 ;; "inherited-attribute-string" for "attribute-string" in the
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
652 ;; construction rules for DT and DD.
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
653
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
654
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
655 (element DL
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
656 (make display-group
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
657 space-before: (if (INLIST?) %para-sep% %block-sep%)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
658 space-after: (if (INLIST?) %para-sep% %block-sep%)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
659 start-indent: (if (INLIST?)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
660 (+ (inherited-start-indent) 2em)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
661 (+ %body-start-indent% 2em))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
662 (make paragraph)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
663
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
664 (element DT
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
665 (let ((compact (attribute-string "compact" (ancestor "DL"))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
666 (if compact
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
667 (make line-field
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
668 field-width: 3em
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
669 (process-children-trim))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
670 (make paragraph
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
671 use: para-style
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
672 space-before: %para-sep%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
673 first-line-start-indent: -1em
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
674 (process-children-trim)))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
675
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
676 (element DD
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
677 (let ((compact (attribute-string "compact" (ancestor "DL"))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
678 (if compact
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
679 (sosofo-append
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
680 (process-children-trim)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
681 (make paragraph-break))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
682 (make paragraph
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
683 use: para-style
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
684 start-indent: (+ (inherited-start-indent) 2em)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
685 (process-children-trim)))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
686
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
687
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
688 ;; ========================== INLINE ELEMENTS ===========================
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
689
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
690 (define ($bold-seq$)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
691 (make sequence
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
692 font-weight: 'bold
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
693 (process-children-trim)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
694
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
695 (element B ($bold-seq$))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
696 (element EM ($bold-seq$))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
697 (element STRONG ($bold-seq$))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
698
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
699 ;; ------------
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
700
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
701 (define ($italic-seq$)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
702 (make sequence
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
703 font-posture: 'italic
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
704 (process-children-trim)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
705
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
706 (element I ($italic-seq$))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
707 (element CITE ($italic-seq$))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
708 (element VAR ($italic-seq$))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
709
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
710 ;; ------------
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
711
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
712 (define ($bold-italic-seq$)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
713 (make sequence
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
714 font-weight: 'bold
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
715 font-posture: 'italic
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
716 (process-children-trim)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
717
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
718 (element DFN ($bold-italic-seq$))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
719 (element A
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
720 (if (INHEAD?)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
721 (process-children-trim)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
722 ($bold-italic-seq$)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
723
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
724 ;; ------------
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
725
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
726 (define ($mono-seq$)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
727 (make sequence
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
728 font-family-name: %mono-font-family%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
729 font-size: %mf-size%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
730 (process-children-trim)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
731
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
732 (element TT ($mono-seq$))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
733 (element CODE ($mono-seq$))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
734 (element KBD ($mono-seq$))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
735 (element SAMP ($mono-seq$))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
736
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
737 ;; ------------
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
738
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
739 (define ($score-seq$ stype)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
740 (make score
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
741 type: stype
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
742 (process-children-trim)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
743
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
744 (element STRIKE ($score-seq$ 'through))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
745 (element U ($score-seq$ 'after))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
746
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
747 ;; ------------
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
748
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
749 (define ($ss-seq$ plus-or-minus)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
750 (make sequence
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
751 font-size:
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
752 (* (inherited-font-size) %ss-size-factor%)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
753 position-point-shift:
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
754 (plus-or-minus (* (inherited-font-size) %ss-shift-factor%))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
755 (process-children-trim)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
756
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
757 (element SUP ($ss-seq$ +))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
758 (element SUB ($ss-seq$ -))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
759
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
760 ;; ------------
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
761
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
762 (define ($bs-seq$ div-or-mult)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
763 (make sequence
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
764 font-size:
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
765 (div-or-mult (inherited-font-size) %smaller-size-factor%)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
766 line-spacing:
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
767 (div-or-mult (inherited-line-spacing) %smaller-size-factor%)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
768
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
769 (element BIG ($bs-seq$ /))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
770 (element SMALL ($bs-seq$ *))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
771
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
772 ;; ------------
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
773
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
774 (element FONT
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
775 (let ((fsize (attribute-string "SIZE")))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
776 (make sequence
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
777 font-size:
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
778 (if fsize (PARSEDUNIT fsize) (inherited-font-size)))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
779
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
780
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
781 ;; ============================== RULES =================================
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
782
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
783 (element HR
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
784 (let ((align (attribute-string "ALIGN"))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
785 (noshade (attribute-string "NOSHADE"))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
786 (size (attribute-string "SIZE"))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
787 (width (attribute-string "WIDTH")))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
788 (make rule
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
789 orientation: 'horizontal
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
790 space-before: %block-sep%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
791 space-after: %block-sep%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
792 line-thickness: (if size (PARSEDUNIT size) 1pt)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
793 length: (if width (PARSEDUNIT width) %body-width%)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
794 display-alignment:
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
795 (case align
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
796 (("LEFT") 'start)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
797 (("CENTER") 'center)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
798 (("RIGHT") 'end)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
799 (else 'end)))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
800
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
801
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
802 ;; ============================= GRAPHICS ===============================
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
803
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
804 ;; Note that DSSSL does not currently support text flowed around an
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
805 ;; object, so the action of the ALIGN attribute is merely to shift the
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
806 ;; image to the left or right. An extension to add runarounds to DSSSL
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
807 ;; has been proposed and should be incorporated here when it becomes
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
808 ;; final.
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
809
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
810 (element IMG
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
811 (make external-graphic
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
812 entity-system-id: (attribute-string "src")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
813 display?: #t
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
814 space-before: 1em
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
815 space-after: 1em
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
816 display-alignment:
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
817 (case (attribute-string "align")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
818 (("LEFT") 'start)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
819 (("RIGHT") 'end)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
820 (else 'center))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
821
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
822 ;; ============================== TABLES ================================
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
823
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
824 (element TABLE
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
825 ;; number-of-columns is for future use
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
826 (let ((number-of-columns
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
827 (node-list-reduce (node-list-rest (children (current-node)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
828 (lambda (cols nd)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
829 (max cols
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
830 (node-list-length (children nd))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
831 0)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
832 (make display-group
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
833 space-before: %block-sep%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
834 space-after: %block-sep%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
835 start-indent: %body-start-indent%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
836 ;; for debugging:
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
837 ;; (make paragraph
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
838 ;; (literal
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
839 ;; (string-append
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
840 ;; "Number of columns: "
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
841 ;; (number->string number-of-columns))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
842 (with-mode table-caption-mode (process-first-descendant "CAPTION"))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
843 (make table
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
844 (process-children)))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
845
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
846 (mode table-caption-mode
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
847 (element CAPTION
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
848 (make paragraph
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
849 use: para-style
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
850 font-weight: 'bold
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
851 space-before: %block-sep%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
852 space-after: %para-sep%
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
853 start-indent: (inherited-start-indent)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
854 (literal
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
855 (string-append
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
856 "Table "
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
857 (format-number
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
858 (element-number) "1") ". "))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
859 (process-children-trim))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
860
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
861 (element CAPTION (empty-sosofo)) ; don't show caption inside the table
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
862
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
863 (element TR
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
864 (make table-row
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
865 (process-children-trim)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
866
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
867 (element TH
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
868 (make table-cell
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
869 n-rows-spanned: (string->number (attribute-string "COLSPAN"))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
870 (make paragraph
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
871 font-weight: 'bold
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
872 space-before: 0.25em
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
873 space-after: 0.25em
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
874 start-indent: 0.25em
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
875 end-indent: 0.25em
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
876 quadding: 'start
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
877 (process-children-trim))))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
878
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
879 (element TD
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
880 (make table-cell
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
881 n-rows-spanned: (string->number (attribute-string "COLSPAN"))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
882 (make paragraph
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
883 space-before: 0.25em
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
884 space-after: 0.25em
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
885 start-indent: 0.25em
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
886 end-indent: 0.25em
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
887 quadding: 'start
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 14
diff changeset
888 (process-children-trim))))