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