1148
|
1 <!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
|
|
2 <!ENTITY % html "IGNORE">
|
|
3 <![%html;[
|
|
4 <!ENTITY % print "IGNORE">
|
|
5 <!ENTITY docbook.dsl PUBLIC "-//Norman Walsh//DOCUMENT DocBook HTML Stylesheet//EN" CDATA dsssl>
|
|
6 ]]>
|
|
7 <!ENTITY % print "INCLUDE">
|
|
8 <![%print;[
|
|
9 <!ENTITY docbook.dsl PUBLIC "-//Norman Walsh//DOCUMENT DocBook Print Stylesheet//EN" CDATA dsssl>
|
|
10 ]]>
|
|
11 ]>
|
|
12
|
|
13 <!--
|
|
14 ;;#######################################################################
|
|
15 ;;# #
|
|
16 ;;# The GNOME Documentation Project's #
|
|
17 ;;# Custion DocBook Stylesheet Layer #
|
|
18 ;;# by Dave Mason dcm@redhat.com #
|
|
19 ;;# Based on Norman Walsh's Modular Stylesheets #
|
|
20 ;;# #
|
|
21 ;;# This is intended as a drop-in replacement for #
|
|
22 ;;# the cygnus-both.dsl file in DocBook Tools. #
|
|
23 ;;# Just copy it to the location dbtools created #
|
|
24 ;;# and rename it cygnus-both.dsl #
|
|
25 ;;# #
|
|
26 ;;# This is Version 1.0-4 #
|
|
27 ;;# patched to fix RTF output (#49677) #
|
|
28 ;;# patched to work with docbook-dsssl-1.72 #
|
|
29 ;;# patched for ADDRESS output (#50605) #
|
|
30 ;;# removed comment and remark #
|
|
31 ;;# disabled use-id-as-filename #
|
|
32 ;;# don't define %graphic-default-extension% #
|
|
33 ;;#######################################################################
|
|
34 -->
|
|
35
|
|
36 <style-sheet>
|
|
37
|
|
38
|
|
39 <style-specification id="print" use="docbook">
|
|
40 <style-specification-body>
|
|
41
|
|
42 ;;==========================================================================
|
|
43 ;; PRINT
|
|
44 ;;==========================================================================
|
|
45
|
|
46 ;;======================================
|
|
47 ;;General Options
|
|
48 ;;======================================
|
|
49
|
|
50 ;;Do you want to print on both sides of the paper?
|
|
51 (define %two-side%
|
|
52 #t)
|
|
53
|
|
54 ;;Do you want enumerated sections? (E.g, 1.1, 1.1.1, 1.2, etc.)
|
|
55 (define %section-autolabel%
|
|
56 #t)
|
|
57
|
|
58 ;;Show URL links? If the text of the link and the URL are identical,
|
|
59 ;;the parenthetical URL is suppressed.
|
|
60 (define %show-ulinks%
|
|
61 #t)
|
|
62
|
|
63 ;Make Ulinks footnotes to stop bleeding in the edges - this increases
|
|
64 ;'jade --> print' time tremendously keep this in mind before
|
|
65 ;complaining!
|
|
66 (define %footnote-ulinks%
|
|
67 #t)
|
|
68
|
|
69 ;;Tex Backend on
|
|
70 (define tex-backend
|
|
71 #t)
|
|
72
|
|
73 ;;Define Line Spacing
|
|
74 (define %line-spacing-factor% 1.1)
|
|
75
|
|
76 ;;Define the Paragraph Style
|
|
77 (define para-style
|
|
78 (style
|
|
79 font-size: %bf-size%
|
|
80 font-weight: 'medium
|
|
81 font-posture: 'upright
|
|
82 font-family-name: %body-font-family%
|
|
83 line-spacing: (* %bf-size% %line-spacing-factor%)))
|
|
84
|
|
85 (define ($object-titles-after$)
|
|
86 (list (normalize "figure")))
|
|
87
|
|
88 ;;======================================
|
|
89 ;;Book Options
|
|
90 ;;======================================
|
|
91
|
|
92
|
|
93 ;;Do you want a title page for a Book?
|
|
94 (define %generate-book-titlepage%
|
|
95 #t)
|
|
96
|
|
97 ;;Do you want a separate page for the title?
|
|
98 (define %generate-book-titlepage-on-separate-page%
|
|
99 #t)
|
|
100
|
|
101 ;;Generate Book TOC?
|
|
102 (define %generate-book-toc%
|
|
103 #t)
|
|
104
|
|
105 ;;What depth should the TOC generate?
|
|
106 ;;!Only top level of appendixes!
|
|
107 (define (toc-depth nd)
|
|
108 (if (string=? (gi nd) (normalize "book"))
|
|
109 3
|
|
110 (if (string=? (gi nd) (normalize "appendix"))
|
|
111 0
|
|
112 1)))
|
|
113
|
|
114 ;;Do you want a TOC for the element part?
|
|
115 (define %generate-part-toc%
|
|
116 #f)
|
|
117
|
|
118 ;;Do you want the part toc on the part titlepage or separate?
|
|
119 (define %generate-part-toc-on-titlepage%
|
|
120 #t)
|
|
121
|
|
122 ;;Generate Part Title Page?
|
|
123 (define %generate-part-titlepage%
|
|
124 #f)
|
|
125
|
|
126 ;;Do you want the Part intro on the part title page?
|
|
127 (define %generate-partintro-on-titlepage%
|
|
128 #t)
|
|
129
|
|
130 ;;What elements should have a LOT?
|
|
131 (define ($generate-book-lot-list$)
|
|
132 (list (normalize "equation")))
|
|
133
|
|
134 ;;Do you want chapters enumerated?
|
|
135 (define %chapter-autolabel%
|
|
136 #t)
|
|
137
|
|
138 ;;Do you want Chapter's and Appendix's
|
|
139 ;;to have automatic labels?
|
|
140 (define %chap-app-running-head-autolabel%
|
|
141 #t)
|
|
142
|
|
143
|
|
144 ;;======================================
|
|
145 ;;Article Options
|
|
146 ;;======================================
|
|
147
|
|
148 ;;Do you want a title page for an Article?
|
|
149 (define %generate-article-titlepage%
|
|
150 #t)
|
|
151
|
|
152 ;;Generate Article TOC?
|
|
153 (define %generate-article-toc%
|
|
154 #t)
|
|
155
|
|
156 ;;Do you want a separate page for the title?
|
|
157 (define %generate-article-titlepage-on-separate-page%
|
|
158 #f)
|
|
159
|
|
160 ;;Do you want the article toc on the titlepage or separate?
|
|
161 (define %generate-article-toc-on-titlepage%
|
|
162 #t)
|
|
163
|
|
164 ;;Do you want to start new page numbers with each article?
|
|
165 (define %article-page-number-restart%
|
|
166 #f)
|
|
167
|
|
168 ;;Titlepage Separate?
|
|
169 (define (chunk-skip-first-element-list)
|
|
170 '())
|
|
171
|
|
172 ;;Titlepage Not Separate
|
|
173 ;(define (chunk-skip-first-element-list)
|
|
174 ; (list (normalize "sect1")
|
|
175 ; (normalize "section")))
|
|
176
|
|
177 ;;======================================
|
|
178 ;;Columns
|
|
179 ;;======================================
|
|
180
|
|
181 ;;How many columns do you want?
|
|
182 (define %page-n-columns%
|
|
183 1)
|
|
184
|
|
185 ;;How much space between columns?
|
|
186 (define %page-column-sep%
|
|
187 0.2in)
|
|
188
|
|
189 ;;How many Columns on the titlepage?
|
|
190 (define %titlepage-n-columns%
|
|
191 1)
|
|
192
|
|
193 ;;Balance columns?
|
|
194 (define %page-balance-colums%
|
|
195 #t)
|
|
196
|
|
197 ;;======================================
|
|
198 ;;Fonts
|
|
199 ;;======================================
|
|
200
|
|
201 ;;Defines the general size of the text in the document. normal(10),
|
|
202 ;;presbyopic(12), and large-type(24).
|
|
203 (define %visual-acuity%
|
|
204 "normal")
|
|
205
|
|
206 ;;What font would you like for titles?
|
|
207 (define %title-font-family%
|
|
208 "Helvetica")
|
|
209
|
|
210 ;;What font would you like for the body?
|
|
211 (define %body-font-family%
|
|
212 "Palatino")
|
|
213
|
|
214 ;;What font would you like for mono-seq?
|
|
215 (define %mono-font-family%
|
|
216 "Courier New")
|
|
217
|
|
218 ;;If the base fontsize is 10pt, and '%hsize-bump-factor%' is
|
|
219 ;; 1.2, hsize 1 is 12pt, hsize 2 is 14.4pt, hsize 3 is 17.28pt, etc
|
|
220 (define %hsize-bump-factor%
|
|
221 1.1)
|
|
222
|
|
223 ;;What size do you want the body fonts?
|
|
224 (define %bf-size%
|
|
225 (case %visual-acuity%
|
|
226 (("tiny") 8pt)
|
|
227 (("normal") 10pt)
|
|
228 (("presbyopic") 12pt)
|
|
229 (("large-type") 24pt)))
|
|
230
|
|
231 (define-unit em %bf-size%)
|
|
232
|
|
233 ;;======================================
|
|
234 ;;Margins
|
|
235 ;;======================================
|
|
236
|
|
237 (define %left-right-margin% 6pi)
|
|
238
|
|
239 ;;How much indentation for the body?
|
|
240 (define %body-start-indent%
|
|
241 4pi)
|
|
242
|
|
243 ;;How big is the left margin? (relative to physical page)
|
|
244 (define %left-margin%
|
|
245 8pi) ;white-paper-column
|
|
246
|
|
247 ;;How big is the right margin? (relative to physical page)
|
|
248 (define %right-margin%
|
|
249 8pi) ;white-paper-column
|
|
250
|
|
251 ;;How big do you want the margin at the top?
|
|
252 (define %top-margin%
|
|
253 (if (equal? %visual-acuity% "large-type")
|
|
254 7.5pi
|
|
255 6pi))
|
|
256
|
|
257 ;;How big do you want the margin at the bottom?
|
|
258 (define %bottom-margin%
|
|
259 (if (equal? %visual-acuity% "large-type")
|
|
260 7.5pi
|
|
261 5pi))
|
|
262
|
|
263 ;;Define the text width. (Change the elements in the formula rather
|
|
264 ;;than the formula itself)
|
|
265 ;(define %text-width% (- %page-width% (* %left-right-margin% 2)))
|
|
266 (define %text-width% (- %page-width% (+ %left-margin% %right-margin%)))
|
|
267
|
|
268 ;;Define the body width. (Change the elements in the formula rather
|
|
269 ;;than the formula itself)
|
|
270 (define %body-width%
|
|
271 (- %text-width% %body-start-indent%))
|
|
272
|
|
273 ;;Define distance between paragraphs
|
|
274 (define %para-sep%
|
|
275 (/ %bf-size% 2.0))
|
|
276
|
|
277 ;;Define distance between block elements (figures, tables, etc.).
|
|
278 (define %block-sep%
|
|
279 (* %para-sep% 2.0))
|
|
280
|
|
281 ;;Indent block elements?
|
|
282 (define %block-start-indent%
|
|
283 0pt)
|
|
284 ;0pt
|
|
285
|
|
286 ;;======================================
|
|
287 ;;Admon Graphics
|
|
288 ;;======================================
|
|
289
|
|
290 ;;Do you want admon graohics on?
|
|
291 (define %admon-graphics%
|
|
292 #f)
|
|
293
|
|
294 ;;Where are the admon graphics?
|
|
295 (define %admon-graphics-path%
|
|
296 "../images/")
|
|
297
|
|
298 ;;======================================
|
|
299 ;;Quadding
|
|
300 ;;======================================
|
|
301
|
|
302 ;;What quadding do you want by default; start, center, justify, or end?
|
|
303 (define %default-quadding%
|
|
304 'justify)
|
|
305
|
|
306 ;;What quadding for component titles(Chapter, Appendix, etc)?
|
|
307 (define %component-title-quadding%
|
|
308 'start)
|
|
309
|
|
310 ;;What quadding for section titles?
|
|
311 (define %section-title-quadding%
|
|
312 'start)
|
|
313
|
|
314 ;;What quadding for section sub-titles?
|
|
315 (define %section-subtitle-quadding%
|
|
316 'start)
|
|
317
|
|
318 ;;What quadding for article title?
|
|
319 (define %article-title-quadding%
|
|
320 'center)
|
|
321
|
|
322 ;;What quadding for article sub-titles?
|
|
323 (define %article-subtitle-quadding%
|
|
324 'center)
|
|
325
|
|
326 ;;What quadding for division subtitles?
|
|
327 (define %division-subtitle-quadding%
|
|
328 'start)
|
|
329
|
|
330 ;;What quadding for component subtitles?
|
|
331 (define %component-subtitle-quadding%
|
|
332 'start)
|
|
333
|
|
334
|
|
335
|
|
336
|
|
337 ;;======================================
|
|
338 ;;Paper Options
|
|
339 ;;======================================
|
|
340
|
|
341 ;;What size paper do you need? A4, USletter, USlandscape, or RedHat?
|
|
342 (define %paper-type%
|
|
343 "USletter")
|
|
344
|
|
345 ;;Now define those paper types' width
|
|
346 (define %page-width%
|
|
347 (case %paper-type%
|
|
348 (("A4") 210mm)
|
|
349 (("USletter") 8.5in)
|
|
350 (("USlandscape") 11in)))
|
|
351
|
|
352 ;;Now define those paper types' height
|
|
353 (define %page-height%
|
|
354 (case %paper-type%
|
|
355 (("A4") 297mm)
|
|
356 (("USletter") 11in)
|
|
357 (("USlandscape") 8.5in)))
|
|
358
|
|
359 ;;======================================
|
|
360 ;;Functions
|
|
361 ;;======================================
|
|
362
|
|
363 (define (OLSTEP)
|
|
364 (case
|
|
365 (modulo (length (hierarchical-number-recursive "ORDEREDLIST")) 4)
|
|
366 ((1) 1.2em)
|
|
367 ((2) 1.2em)
|
|
368 ((3) 1.6em)
|
|
369 ((0) 1.4em)))
|
|
370
|
|
371 (define (ILSTEP) 1.0em)
|
|
372
|
|
373 (define (PROCSTEP ilvl)
|
|
374 (if (> ilvl 1) 1.8em 1.4em))
|
|
375
|
|
376 (define (PROCWID ilvl)
|
|
377 (if (> ilvl 1) 1.8em 1.4em))
|
|
378
|
|
379
|
|
380 (define ($comptitle$)
|
|
381 (make paragraph
|
|
382 font-family-name: %title-font-family%
|
|
383 font-weight: 'bold
|
|
384 font-size: (HSIZE 2)
|
|
385 line-spacing: (* (HSIZE 2) %line-spacing-factor%)
|
|
386 space-before: (* (HSIZE 2) %head-before-factor%)
|
|
387 space-after: (* (HSIZE 2) %head-after-factor%)
|
|
388 start-indent: 0pt
|
|
389 first-line-start-indent: 0pt
|
|
390 quadding: 'start
|
|
391 keep-with-next?: #t
|
|
392 (process-children-trim)))
|
|
393
|
|
394 ;;Callouts are confusing in Postscript... fix them.
|
|
395 (define %callout-fancy-bug%
|
|
396 #f)
|
|
397
|
|
398
|
|
399 ;;By default perils are centered and dropped into a box with a really
|
|
400 ;;big border - I have simply decreased the border thickness -
|
|
401 ;;unfortunately it takes all this to do it - sigh.
|
|
402 (define ($peril$)
|
|
403 (let* ((title (select-elements
|
|
404 (children (current-node)) (normalize "title")))
|
|
405 (has-title (not (node-list-empty? title)))
|
|
406 (adm-title (if has-title
|
|
407 (make sequence
|
|
408 (with-mode title-sosofo-mode
|
|
409 (process-node-list (node-list-first title))))
|
|
410 (literal
|
|
411 (gentext-element-name
|
|
412 (current-node)))))
|
|
413 (hs (HSIZE 2)))
|
|
414 (if %admon-graphics%
|
|
415 ($graphical-admonition$)
|
|
416 (make display-group
|
|
417 space-before: %block-sep%
|
|
418 space-after: %block-sep%
|
|
419 font-family-name: %admon-font-family%
|
|
420 font-size: (- %bf-size% 1pt)
|
|
421 font-weight: 'medium
|
|
422 font-posture: 'upright
|
|
423 line-spacing: (* (- %bf-size% 1pt) %line-spacing-factor%)
|
|
424 (make box
|
|
425 display?: #t
|
|
426 box-type: 'border
|
|
427 line-thickness: .5pt
|
|
428 start-indent: (+ (inherited-start-indent) (* 2 (ILSTEP)) 2pt)
|
|
429 end-indent: (inherited-end-indent)
|
|
430 (make paragraph
|
|
431 space-before: %para-sep%
|
|
432 space-after: %para-sep%
|
|
433 start-indent: 1em
|
|
434 end-indent: 1em
|
|
435 font-family-name: %title-font-family%
|
|
436 font-weight: 'bold
|
|
437 font-size: hs
|
|
438 line-spacing: (* hs %line-spacing-factor%)
|
|
439 quadding: 'center
|
|
440 keep-with-next?: #t
|
|
441 adm-title)
|
|
442 (process-children))))))
|
|
443
|
|
444
|
|
445 ;;======================================
|
|
446 ;;Non-printing Elements
|
|
447 ;;======================================
|
|
448 (element TITLEABBREV (empty-sosofo))
|
|
449 (element SUBTITLE (empty-sosofo))
|
|
450 (element SETINFO (empty-sosofo))
|
|
451 (element BOOKINFO (empty-sosofo))
|
|
452 (element BIBLIOENTRY (empty-sosofo))
|
|
453 (element BIBLIOMISC (empty-sosofo))
|
|
454 (element BOOKBIBLIO (empty-sosofo))
|
|
455 (element SERIESINFO (empty-sosofo))
|
|
456 (element DOCINFO (empty-sosofo))
|
|
457 (element ARTHEADER (empty-sosofo))
|
|
458 ;;(element ADDRESS (empty-sosofo))
|
|
459
|
|
460 ;;Show comment element?
|
|
461 (define %show-comments%
|
|
462 #t)
|
|
463
|
|
464 ;;======================================
|
|
465 ;;Formalpara titles
|
|
466 ;;======================================
|
|
467
|
|
468
|
|
469 ;;Change the way Formal Paragraph titles are displayed. The commented
|
|
470 ;;out section will run the titles in the paragraphs.
|
|
471 (element (formalpara title)
|
|
472 ;(make sequence
|
|
473 ;font-weight: 'bold
|
|
474 ;($runinhead$))
|
|
475 ($lowtitle$ 5 7))
|
|
476
|
|
477 ;;======================================
|
|
478 ;;Inlines
|
|
479 ;;======================================
|
|
480
|
|
481 (element application ($mono-seq$))
|
|
482 (element command ($bold-seq$))
|
|
483 (element filename ($mono-seq$))
|
|
484 (element function ($mono-seq$))
|
|
485 (element guibutton ($bold-seq$))
|
|
486 (element guiicon ($bold-seq$))
|
|
487 (element guilabel ($italic-seq$))
|
|
488 (element guimenu ($bold-seq$))
|
|
489 (element guimenuitem ($bold-seq$))
|
|
490 (element hardware ($bold-mono-seq$))
|
|
491 (element keycap ($bold-seq$))
|
|
492 (element literal ($mono-seq$))
|
|
493 (element parameter ($italic-mono-seq$))
|
|
494 (element prompt ($mono-seq$))
|
|
495 (element symbol ($charseq$))
|
|
496 (element emphasis ($italic-seq$))
|
|
497
|
|
498 </style-specification-body>
|
|
499 </style-specification>
|
|
500
|
|
501
|
|
502 <!--
|
|
503 ;;===========================================================================
|
|
504 ;; HTML
|
|
505 ;;===========================================================================
|
|
506 -->
|
|
507
|
|
508 <style-specification id="html" use="docbook">
|
|
509 <style-specification-body>
|
|
510
|
|
511 ;; this is necessary because right now jadetex does not understand
|
|
512 ;; symbolic entities, whereas things work well with numeric entities.
|
|
513 (declare-characteristic preserve-sdata?
|
|
514 "UNREGISTERED::James Clark//Characteristic::preserve-sdata?"
|
|
515 #f)
|
|
516
|
|
517
|
|
518 ;;=========================
|
|
519 ;;Header HTML 4.0.1
|
|
520 ;;=========================
|
|
521
|
|
522 (define %html-pubid% "-//W3C//DTD HTML 4.01//EN")
|
|
523
|
|
524 ;;=========================
|
|
525 ;;Common Stuff
|
|
526 ;;=========================
|
|
527
|
|
528 ;;Should there be a link to the legalnotice?
|
|
529 (define %generate-legalnotice-link%
|
|
530 #t)
|
|
531
|
|
532 ;;What graphics extensions allowed?
|
|
533 (define %graphic-extensions%
|
|
534 '("gif" "png" "jpg" "jpeg" "tif" "tiff" "eps" "epsf" ))
|
|
535
|
|
536 ;;What is the default extension for images?
|
|
537 (define %graphic-default-extension% "png")
|
|
538
|
|
539 ;;Use element ids as filenames?
|
|
540 (define %use-id-as-filename%
|
|
541 #t)
|
|
542
|
|
543
|
|
544 ;;=========================
|
|
545 ;;Book Stuff
|
|
546 ;;=========================
|
|
547
|
|
548 ;;Do you want a TOC for Books?
|
|
549 (define %generate-book-toc%
|
|
550 #t)
|
|
551
|
|
552 ;;What depth should the TOC generate?
|
|
553 ;;!Only top level of appendixes!
|
|
554 (define (toc-depth nd)
|
|
555 (if (string=? (gi nd) (normalize "book"))
|
|
556 3
|
|
557 (if (string=? (gi nd) (normalize "appendix"))
|
|
558 0
|
|
559 1)))
|
|
560
|
|
561 ;;What elements should have an LOT?
|
|
562 (define ($generate-book-lot-list$)
|
|
563 (list (normalize "equation")))
|
|
564
|
|
565 ;;Do you want a title page for your Book?
|
|
566 (define %generate-book-titlepage%
|
|
567 #t)
|
|
568
|
|
569 ;;=========================
|
|
570 ;;Part Stuff
|
|
571 ;;=========================
|
|
572
|
|
573 ;;Should parts have TOCs?
|
|
574 (define %generate-part-toc%
|
|
575 #t)
|
|
576
|
|
577 ;;Should part TOCs be on their titlepages?
|
|
578 (define %generate-part-toc-on-titlepage%
|
|
579 #t)
|
|
580
|
|
581 ;;Do you want a title page for your part?
|
|
582 (define %generate-part-titlepage%
|
|
583 #t)
|
|
584
|
|
585 ;;Should the Part intro be on the part title page?
|
|
586 (define %generate-partintro-on-titlepage%
|
|
587 #t)
|
|
588
|
|
589 (define %para-autolabel%
|
|
590 #t)
|
|
591
|
|
592 ;;========================
|
|
593 ;;Chapter Stuff
|
|
594 ;;=======================
|
|
595
|
|
596 ;;No TOCs in Chapters
|
|
597 (define $generate-chapter-toc$
|
|
598 (lambda ()
|
|
599 #f))
|
|
600
|
|
601 ;;=========================
|
|
602 ;;Navigation
|
|
603 ;;=========================
|
|
604
|
|
605 ;;Should there be navigation at top?
|
|
606 (define %header-navigation%
|
|
607 #t)
|
|
608
|
|
609 ;;Should there be navigation at bottom?
|
|
610 (define %footer-navigation%
|
|
611 #t)
|
|
612
|
|
613 ;;Use tables to create the navigation?
|
|
614 (define %gentext-nav-use-tables%
|
|
615 #t)
|
|
616
|
|
617 ;;If tables are used for navigation,
|
|
618 ;;how wide should they be?
|
|
619 (define %gentext-nav-tblwidth%
|
|
620 "100%")
|
|
621
|
|
622 ;;Add arrows to navigation (comment these
|
|
623 ;;out if you want admon graphics here)
|
|
624 (define (gentext-en-nav-prev prev)
|
|
625 (make sequence (literal "<<< Previous")))
|
|
626
|
|
627 ;;Add arrows to navigation (comment these
|
|
628 ;;out if you want admon graphics here)
|
|
629 (define (gentext-en-nav-next next)
|
|
630 (make sequence (literal "Next >>>")))
|
|
631
|
|
632
|
|
633 ;;=========================
|
|
634 ;;Tables and Lists
|
|
635 ;;=========================
|
|
636
|
|
637 ;;Should Variable lists be tables?
|
|
638 (define %always-format-variablelist-as-table%
|
|
639 #f)
|
|
640
|
|
641 ;;What is the length of the 'Term' in a variablelist?
|
|
642 (define %default-variablelist-termlength%
|
|
643 20)
|
|
644
|
|
645 ;;When true | If the terms are shorter than
|
|
646 ;;the termlength above then the variablelist
|
|
647 ;;will be formatted as a table.
|
|
648 (define %may-format-variablelist-as-table%
|
|
649 #f)
|
|
650
|
|
651 ;;This overrides the tgroup definition
|
|
652 ;;(copied from 1.20, dbtable.dsl).
|
|
653 ;;It changes the table background color,
|
|
654 ;;cell spacing and cell padding.
|
|
655 ;;This is based on gtk-doc additions - thanks!
|
|
656
|
|
657 (element tgroup
|
|
658 (let* ((wrapper (parent (current-node)))
|
|
659 (frameattr (attribute-string (normalize "frame") wrapper))
|
|
660 (pgwide (attribute-string (normalize "pgwide") wrapper))
|
|
661 (footnotes (select-elements (descendants (current-node))
|
|
662 (normalize "footnote")))
|
|
663 (border (if (equal? frameattr (normalize "none"))
|
|
664 '(("BORDER" "0"))
|
|
665 '(("BORDER" "1"))))
|
|
666 (bgcolor '(("BGCOLOR" "#E0E0E0")))
|
|
667 (width (if (equal? pgwide "1")
|
|
668 (list (list "WIDTH" ($table-width$)))
|
|
669 '()))
|
|
670 (head (select-elements (children (current-node)) (normalize "thead")))
|
|
671 (body (select-elements (children (current-node)) (normalize "tbody")))
|
|
672 (feet (select-elements (children (current-node)) (normalize "tfoot"))))
|
|
673 (make element gi: "TABLE"
|
|
674 attributes: (append
|
|
675 border
|
|
676 width
|
|
677 bgcolor
|
|
678 '(("CELLSPACING" "0"))
|
|
679 '(("CELLPADDING" "4"))
|
|
680 (if %cals-table-class%
|
|
681 (list (list "CLASS" %cals-table-class%))
|
|
682 '()))
|
|
683 (process-node-list head)
|
|
684 (process-node-list body)
|
|
685 (process-node-list feet)
|
|
686 (make-table-endnotes))))
|
|
687
|
|
688 ;;===================
|
|
689 ;; Admon Graphics
|
|
690 ;;===================
|
|
691
|
|
692 ;;Should Admon Graphics be used?
|
|
693 (define %admon-graphics%
|
|
694 #t)
|
|
695
|
|
696 ;;Where are those admon graphics?
|
|
697 (define %admon-graphics-path%
|
|
698 "./stylesheet-images/")
|
|
699
|
|
700 ;;Given an admonition node, returns the
|
|
701 ;;name of the graphic that should
|
|
702 ;;be used for that admonition.
|
|
703 ;;Define admon graphics usage
|
|
704 ;;NOTE these will change to pngs
|
|
705 ;;soon in the GDP when Tigert gets
|
|
706 ;;the time to make special ones for us!
|
|
707 (define ($admon-graphic$ #!optional (nd (current-node)))
|
|
708 (cond ((equal? (gi nd) (normalize "tip"))
|
|
709 (string-append %admon-graphics-path% "tip.gif"))
|
|
710 ((equal? (gi nd) (normalize "note"))
|
|
711 (string-append %admon-graphics-path% "note.gif"))
|
|
712 ((equal? (gi nd) (normalize "important"))
|
|
713 (string-append %admon-graphics-path% "important.gif"))
|
|
714 ((equal? (gi nd) (normalize "caution"))
|
|
715 (string-append %admon-graphics-path% "caution.gif"))
|
|
716 ((equal? (gi nd) (normalize "warning"))
|
|
717 (string-append %admon-graphics-path% "warning.gif"))
|
|
718 (else (error (string-append (gi nd) " is not an admonition.")))))
|
|
719
|
|
720 ;;Given an admonition node, returns
|
|
721 ;;the width of the graphic that will
|
|
722 ;;be used for that admonition.
|
|
723 (define ($admon-graphic-width$ #!optional (nd (current-node)))
|
|
724 "25")
|
|
725
|
|
726 ;;=========================
|
|
727 ;;Labels
|
|
728 ;;=========================
|
|
729
|
|
730 ;;Enumerate Chapters?
|
|
731 (define %chapter-autolabel%
|
|
732 #t)
|
|
733
|
|
734 ;;Enumerate Sections?
|
|
735 (define %section-autolabel%
|
|
736 #t)
|
|
737
|
|
738 ;;=========================
|
|
739 ;; HTML Attributes
|
|
740 ;;=========================
|
|
741
|
|
742 ;;What attributes should be hung off
|
|
743 ;;of 'body'?
|
|
744 (define %body-attr%
|
|
745 (list
|
|
746 (list "BGCOLOR" "#FFFFFF")
|
|
747 (list "TEXT" "#000000")
|
|
748 (list "LINK" "#0000FF")
|
|
749 (list "VLINK" "#840084")
|
|
750 (list "ALINK" "#0000FF")))
|
|
751
|
|
752 ;;Default extension for filenames?
|
|
753 (define %html-ext%
|
|
754 ".html")
|
|
755
|
|
756 ;;Use a CSS stylesheet?
|
|
757 ;;Which one? Should work on
|
|
758 ;;this one soon
|
|
759 ;(define %stylesheet%
|
|
760 ; "./gnome.css")
|
|
761
|
|
762 ;;Use it
|
|
763 ;(define %stylesheet-type%
|
|
764 ;"text/css")
|
|
765
|
|
766
|
|
767 ;;========================
|
|
768 ;;Title Pages for Books
|
|
769 ;;=======================
|
|
770
|
|
771 (define (book-titlepage-recto-elements)
|
|
772 (list (normalize "title")
|
|
773 (normalize "subtitle")
|
|
774 (normalize "corpauthor")
|
|
775 (normalize "authorgroup")
|
|
776 (normalize "author")
|
|
777 (normalize "orgname")
|
|
778 (normalize "graphic")
|
|
779 (normalize "copyright")
|
|
780 (normalize "legalnotice")
|
|
781 (normalize "releaseinfo")
|
|
782 (normalize "publisher")
|
|
783 (normalize "isbn")))
|
|
784
|
|
785 ;;========================
|
|
786 ;;Title Pages for Articles
|
|
787 ;;========================
|
|
788
|
|
789 ;;Should Articles have a TOC?
|
|
790 (define %generate-article-toc%
|
|
791 #t)
|
|
792
|
|
793 ;;Which elements should appear
|
|
794 ;;on title page?
|
|
795 (define (article-titlepage-recto-elements)
|
|
796 (list (normalize "title")
|
|
797 (normalize "subtitle")
|
|
798 (normalize "authorgroup")
|
|
799 (normalize "copyright")
|
|
800 (normalize "legalnotice")
|
|
801 (normalize "abstract")))
|
|
802
|
|
803 ;;How should elements on title page look?
|
|
804 (mode article-titlepage-recto-mode
|
|
805
|
|
806 ;;Author name is too big - change it!
|
|
807 (element author
|
|
808 (let ((author-name (author-string))
|
|
809 (author-affil (select-elements (children (current-node))
|
|
810 (normalize "affiliation"))))
|
|
811 (make sequence
|
|
812 (make element gi: "H4"
|
|
813 attributes: (list (list "CLASS" (gi)))
|
|
814 (make element gi: "A"
|
|
815 attributes: (list (list "NAME" (element-id)))
|
|
816 (literal author-name)))
|
|
817 (process-node-list author-affil))))
|
|
818
|
|
819 ;;Address?
|
|
820 (element address
|
|
821 (make sequence
|
|
822 (make element gi: "DIV"
|
|
823 attributes: (list (list "CLASS" (gi)))
|
|
824 (process-children))))
|
|
825
|
|
826 ;;Get rid of spam-producing "mailto" links
|
|
827 ;;and get rid of email indentation
|
|
828 (element email
|
|
829 (make sequence
|
|
830 (make element gi: "DIV"
|
|
831 attributes: (list (list "CLASS" (gi)))
|
|
832 (process-children))))
|
|
833
|
|
834 ;;Point Abstract to custom table function
|
|
835 ;;(See $dcm-abstract-object$ below. For default
|
|
836 ;;use $semiformal-object$
|
|
837 (element abstract
|
|
838 (make element gi: "DIV"
|
|
839 ($dcm-abstract-object$)))
|
|
840
|
|
841 (element (abstract title) (empty-sosofo))
|
|
842
|
|
843 ;;subtitle sizing
|
|
844 (element subtitle
|
|
845 (make element gi: "H4"
|
|
846 attributes: (list (list "CLASS" (gi)))
|
|
847 (process-children-trim))))
|
|
848
|
|
849 ;;=================
|
|
850 ;; INLINES
|
|
851 ;;=================
|
|
852
|
|
853 ;Define my own series of fonts for various elements
|
|
854 (element application ($mono-seq$))
|
|
855 (element command ($bold-seq$))
|
|
856 (element filename ($mono-seq$))
|
|
857 (element function ($mono-seq$))
|
|
858 (element guibutton ($bold-seq$))
|
|
859 (element guiicon ($bold-seq$))
|
|
860 (element guilabel ($bold-mono-seq$))
|
|
861 (element guimenu ($bold-seq$))
|
|
862 (element guimenuitem ($bold-seq$))
|
|
863 (element guisubmenu ($bold-seq$))
|
|
864 (element hardware ($bold-mono-seq$))
|
|
865 (element keycap ($bold-seq$))
|
|
866 (element literal ($mono-seq$))
|
|
867 (element parameter ($italic-mono-seq$))
|
|
868 (element prompt ($mono-seq$))
|
|
869 (element symbol ($charseq$))
|
|
870 (element emphasis ($italic-seq$))
|
|
871
|
|
872 ;;Show comment element?
|
|
873 (define %show-comments%
|
|
874 #t)
|
|
875
|
|
876 ;;====================
|
|
877 ;; General Formatting
|
|
878 ;;====================
|
|
879
|
|
880 ;;Formal Paras are ugly by default!
|
|
881 ;;Make the title run in - otherwise
|
|
882 ;;you should use a sect!
|
|
883 (element formalpara
|
|
884 (make element gi: "DIV"
|
|
885 attributes: (list
|
|
886 (list "CLASS" (gi)))
|
|
887 (make element gi: "P"
|
|
888 (process-children))))
|
|
889
|
|
890 ;;This is the old one
|
|
891 ;(element (formalpara title)
|
|
892 ;($lowtitle$ 5))
|
|
893
|
|
894 ;;This is the new one
|
|
895 (element (formalpara title)
|
|
896 (make element gi: "B"
|
|
897 ($runinhead$)))
|
|
898
|
|
899 ;;Make captions come after objects in the list
|
|
900 (define ($object-titles-after$)
|
|
901 (list (normalize "figure")))
|
|
902
|
|
903
|
|
904 ;; Handle qanda labelling with Q: A:
|
|
905 (define (qanda-defaultlabel)
|
|
906 (normalize "qanda"))
|
|
907
|
|
908 ;;From FreeBSD Sheets (Thanks!) Display Q and A in bigger bolder fonts
|
|
909
|
|
910 (element question
|
|
911 (let* ((chlist (children (current-node)))
|
|
912 (firstch (node-list-first chlist))
|
|
913 (restch (node-list-rest chlist)))
|
|
914 (make element gi: "DIV"
|
|
915 attributes: (list (list "CLASS" (gi)))
|
|
916 (make element gi: "P"
|
|
917 (make element gi: "BIG"
|
|
918 (make element gi: "A"
|
|
919 attributes: (list
|
|
920 (list "NAME" (element-id)))
|
|
921 (empty-sosofo))
|
|
922 (make element gi: "B"
|
|
923 (literal (question-answer-label
|
|
924 (current-node)) " ")
|
|
925 (process-node-list (children firstch)))))
|
|
926 (process-node-list restch))))
|
|
927
|
|
928 ;;Literal Elements
|
|
929
|
|
930 ;;Indent Literal layouts?
|
|
931 (define %indent-literallayout-lines%
|
|
932 #f)
|
|
933
|
|
934 ;;Indent Programlistings?
|
|
935 (define %indent-programlisting-lines%
|
|
936 #f)
|
|
937
|
|
938 ;;Number lines in Programlistings?
|
|
939 (define %number-programlisting-lines%
|
|
940 #f)
|
|
941
|
|
942 ;;Should verbatim items be 'shaded' with a table?
|
|
943 (define %shade-verbatim%
|
|
944 #t)
|
|
945
|
|
946 ;;Define shade-verbatim attributes
|
|
947 (define ($shade-verbatim-attr$)
|
|
948 (list
|
|
949 (list "BORDER" "0")
|
|
950 (list "BGCOLOR" "#E0E0E0")
|
|
951 (list "WIDTH" ($table-width$))))
|
|
952
|
|
953 ;;===================
|
|
954 ;; Entities
|
|
955 ;;===================
|
|
956
|
|
957 ;;Netscape doesn't handle trademark
|
|
958 ;;entity right at all!! Get rid of it.
|
|
959 ;;Make a TM in a superscipt font.
|
|
960 (element trademark
|
|
961 (make sequence
|
|
962 (process-children)
|
|
963 (make element gi: "sup"
|
|
964 (literal "TM"))))
|
|
965
|
|
966
|
|
967 ;;===================
|
|
968 ;; New Definitions
|
|
969 ;;==================
|
|
970
|
|
971 (define ($dcm-abstract-object$)
|
|
972 (make element gi: "TABLE"
|
|
973 attributes: '(("BORDER" "0")
|
|
974 ("BGCOLOR" "#E0E0E0")
|
|
975 ("WIDTH" "50%")
|
|
976 ("CELLSPACING" "0")
|
|
977 ("CELLPADDING" "0")
|
|
978 ("ALIGN" "CENTER"))
|
|
979 (make element gi: "TR"
|
|
980 (make element gi: "TD"
|
|
981 attributes: '(("VALIGN" "TOP"))
|
|
982 (make element gi: "B"
|
|
983 (literal "Abstract"))))
|
|
984 (make element gi: "TR"
|
|
985 (make element gi: "TD"
|
|
986 attributes: '(("VALIGN" "TOP"))
|
|
987 (process-children)))))
|
|
988
|
|
989 ;;Redefine Titlepage Separator on Articles
|
|
990
|
|
991 (define (article-titlepage-separator side)
|
|
992 (make empty-element gi: "HR"
|
|
993 attributes: '(("WIDTH" "75%")
|
|
994 ("ALIGN" "CENTER")
|
|
995 ("COLOR" "#000000")
|
|
996 ("SIZE" "1"))))
|
|
997
|
|
998
|
|
999
|
|
1000
|
|
1001 (define (chunk-element-list)
|
|
1002 (list (normalize "preface")
|
|
1003 (normalize "chapter")
|
|
1004 (normalize "appendix")
|
|
1005 (normalize "article")
|
|
1006 (normalize "glossary")
|
|
1007 (normalize "bibliography")
|
|
1008 (normalize "index")
|
|
1009 (normalize "colophon")
|
|
1010 (normalize "setindex")
|
|
1011 (normalize "reference")
|
|
1012 (normalize "refentry")
|
|
1013 (normalize "part")
|
|
1014 (normalize "sect1")
|
|
1015 (normalize "section")
|
|
1016 (normalize "book") ;; just in case nothing else matches...
|
|
1017 (normalize "set") ;; sets are definitely chunks...
|
|
1018 ))
|
|
1019
|
|
1020 ;;Do you want Callouts to be graphics?
|
|
1021 (define %callout-graphics%
|
|
1022 #f)
|
|
1023
|
|
1024
|
|
1025 ;;Make Callout graphics PNGs
|
|
1026 (define %callout-graphics-path%
|
|
1027 "./imagelib/callouts/")
|
|
1028
|
|
1029 ;; Redefine $callout-bug$ to support the %callout-graphic-ext%
|
|
1030 ;; variable.
|
|
1031 (define ($callout-bug$ conumber)
|
|
1032 (let ((number (if conumber (format-number conumber "1") "0")))
|
|
1033 (if conumber
|
|
1034 (if %callout-graphics%
|
|
1035 (if (<= conumber %callout-graphics-number-limit%)
|
|
1036 (make empty-element gi: "IMG"
|
|
1037 attributes: (list (list "SRC"
|
|
1038 (root-rel-path
|
|
1039 (string-append
|
|
1040 %callout-graphics-path%
|
|
1041 number
|
|
1042 %callout-graphics-ext%)))
|
|
1043 (list "HSPACE" "0")
|
|
1044 (list "VSPACE" "0")
|
|
1045 (list "BORDER" "0")
|
|
1046 (list "ALT"
|
|
1047 (string-append
|
|
1048 "(" number ")"))))
|
|
1049 (make element gi: "B"
|
|
1050 (literal "(" (format-number conumber "1") ")")))
|
|
1051 (make element gi: "B"
|
|
1052 (literal "(" (format-number conumber "1") ")")))
|
|
1053 (make element gi: "B"
|
|
1054 (literal "(??)")))))
|
|
1055
|
|
1056 </style-specification-body>
|
|
1057 </style-specification>
|
|
1058
|
|
1059 <external-specification id="docbook" document="docbook.dsl">
|
|
1060
|
|
1061 </style-sheet>
|