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