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