annotate lisp/w3/html32.dsl @ 14:9ee227acff29 r19-15b90

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