Blame Scripts/Functions/Render/Backends/Docbook/Styles/docbook2pdf.dsl

2fa604
2fa604
2fa604
2fa604
2fa604
2fa604
]]>
2fa604
2fa604
2fa604
2fa604
]]>
2fa604
]>
2fa604
2fa604
2fa604
;;#######################################################################
2fa604
;;#                                                                     #
2fa604
;;#                 The GNOME Documentation Project's                   #
2fa604
;;#                  Custion DocBook Stylesheet Layer                   #
2fa604
;;#                    by Dave Mason dcm@redhat.com                     #
2fa604
;;#            Based on Norman Walsh's Modular Stylesheets              #
2fa604
;;#                                                                     #
2fa604
;;#            This is intended as a drop-in replacement for            #
2fa604
;;#            the cygnus-both.dsl file in DocBook Tools.               #
2fa604
;;#           Just copy it to the location dbtools created              #
2fa604
;;#                   and rename it cygnus-both.dsl                     #
2fa604
;;#                                                                     #
2fa604
;;#                       This is Version 1.0-4                         #
2fa604
;;#                  patched to fix RTF output (#49677)                 #
2fa604
;;#                patched to work with docbook-dsssl-1.72              #
2fa604
;;#                 patched for ADDRESS output (#50605)                 #
2fa604
;;#                      removed comment and remark                     #
2fa604
;;#                      disabled use-id-as-filename                    #
2fa604
;;#               don't define %graphic-default-extension%              #
2fa604
;;#######################################################################
2fa604
-->
2fa604
2fa604
<style-sheet>
2fa604
2fa604
2fa604
<style-specification id="print" use="docbook">
2fa604
<style-specification-body> 
2fa604
2fa604
;;==========================================================================
2fa604
;;                               PRINT
2fa604
;;==========================================================================
2fa604
2fa604
;;======================================
2fa604
;;General Options
2fa604
;;======================================
2fa604
2fa604
;;Do you want to print on both sides of the paper?
2fa604
(define %two-side% 
2fa604
 #t)
2fa604
2fa604
;;Do you want enumerated sections? (E.g, 1.1, 1.1.1, 1.2, etc.)
2fa604
(define %section-autolabel% 
2fa604
 #f)
2fa604
2fa604
;;Show URL links? If the text of the link and the URL are identical,
2fa604
;;the parenthetical URL is suppressed.
2fa604
(define %show-ulinks%
2fa604
 #t)
2fa604
2fa604
;Make Ulinks footnotes to stop bleeding in the edges - this increases
2fa604
;'jade --> print' time tremendously keep this in mind before
2fa604
;complaining!
2fa604
(define %footnote-ulinks%
2fa604
  #t)
2fa604
2fa604
;;Tex Backend on
2fa604
(define tex-backend 
2fa604
 #t)
2fa604
2fa604
;;Define Line Spacing
2fa604
(define %line-spacing-factor% 1.1)
2fa604
2fa604
;;Define the Paragraph Style
2fa604
(define para-style
2fa604
  (style
2fa604
   font-size: %bf-size%
2fa604
   font-weight: 'medium
2fa604
   font-posture: 'upright
2fa604
   font-family-name: %body-font-family%
2fa604
   line-spacing: (* %bf-size% %line-spacing-factor%)))
2fa604
2fa604
(define ($object-titles-after$)
2fa604
  (list (normalize "figure")))
2fa604
2fa604
;;======================================
2fa604
;;Book Options
2fa604
;;======================================
2fa604
2fa604
2fa604
;;Do you want a title page for a Book?
2fa604
(define %generate-book-titlepage%
2fa604
 #t)
2fa604
2fa604
;;Do you want a separate page for the title?
2fa604
(define %generate-book-titlepage-on-separate-page%
2fa604
 #t)
2fa604
2fa604
;;Generate Book TOC?
2fa604
(define %generate-book-toc% 
2fa604
 #t)
2fa604
2fa604
;;What depth should the TOC generate?
2fa604
;;!Only top level of appendixes!
2fa604
(define (toc-depth nd)
2fa604
  (if (string=? (gi nd) (normalize "book"))
2fa604
      3
2fa604
      (if (string=? (gi nd) (normalize "appendix"))
2fa604
        0
2fa604
        1)))
2fa604
2fa604
;;Do you want a TOC for the element part?
2fa604
(define %generate-part-toc% 
2fa604
 #f)
2fa604
2fa604
;;Do you want the part toc on the part titlepage or separate?
2fa604
(define %generate-part-toc-on-titlepage%
2fa604
 #t)
2fa604
2fa604
;;Generate Part Title Page?
2fa604
(define %generate-part-titlepage% 
2fa604
  #f)
2fa604
2fa604
;;Do you want the Part intro on the part title page?
2fa604
(define %generate-partintro-on-titlepage%
2fa604
  #t)
2fa604
2fa604
;;What elements should have a LOT?
2fa604
(define ($generate-book-lot-list$)
2fa604
  (list (normalize "equation")))
2fa604
2fa604
;;Do you want chapters enumerated?
2fa604
(define %chapter-autolabel% 
2fa604
 #t)
2fa604
2fa604
;;Do you want Chapter's and Appendix's 
2fa604
;;to have automatic labels?
2fa604
(define %chap-app-running-head-autolabel% 
2fa604
  #t)
2fa604
2fa604
2fa604
;;======================================
2fa604
;;Article Options
2fa604
;;======================================
2fa604
2fa604
;;Do you want a title page for an Article?
2fa604
(define %generate-article-titlepage%
2fa604
 #t)
2fa604
2fa604
;;Generate Article TOC?
2fa604
(define %generate-article-toc% 
2fa604
 #t)
2fa604
2fa604
;;Do you want a separate page for the title?
2fa604
(define %generate-article-titlepage-on-separate-page%
2fa604
 #t)
2fa604
2fa604
;;Do you want the article toc on the titlepage or separate?
2fa604
(define %generate-article-toc-on-titlepage%
2fa604
 #t)
2fa604
2fa604
;;Do you want to start new page numbers with each article?
2fa604
(define %article-page-number-restart%
2fa604
 #f)
2fa604
2fa604
;;Titlepage Separate?
2fa604
(define (chunk-skip-first-element-list)
2fa604
  '())
2fa604
2fa604
;;Titlepage Not Separate
2fa604
;(define (chunk-skip-first-element-list)
2fa604
;  (list (normalize "sect1")
2fa604
;	(normalize "section")))
2fa604
2fa604
;;======================================
2fa604
;;Columns
2fa604
;;======================================
2fa604
2fa604
;;How many columns do you want?
2fa604
(define %page-n-columns%
2fa604
 1)
2fa604
2fa604
;;How much space between columns?
2fa604
(define %page-column-sep%
2fa604
 0.2in)
2fa604
2fa604
;;How many Columns on the titlepage?
2fa604
(define %titlepage-n-columns%
2fa604
  1)
2fa604
2fa604
;;Balance columns?
2fa604
(define %page-balance-colums%
2fa604
#t)
2fa604
2fa604
;;======================================
2fa604
;;Fonts
2fa604
;;======================================
2fa604
2fa604
;;Defines the general size of the text in the document. normal(10),
2fa604
;;presbyopic(12), and large-type(24). 
2fa604
(define %visual-acuity%
2fa604
 "normal")
2fa604
2fa604
;;What font would you like for titles?
2fa604
(define %title-font-family% 
2fa604
  "Helvetica")
2fa604
2fa604
;;What font would you like for the body?
2fa604
(define %body-font-family% 
2fa604
 "Palatino")
2fa604
2fa604
;;What font would you like for mono-seq?
2fa604
(define %mono-font-family% 
2fa604
 "Courier New")
2fa604
2fa604
;;If the base fontsize is 10pt, and '%hsize-bump-factor%' is
2fa604
;; 1.2, hsize 1 is 12pt, hsize 2 is 14.4pt, hsize 3 is 17.28pt, etc
2fa604
(define %hsize-bump-factor% 
2fa604
 1.1)
2fa604
2fa604
;;What size do you want the body fonts?
2fa604
(define %bf-size%
2fa604
 (case %visual-acuity%
2fa604
    (("tiny") 8pt)
2fa604
    (("normal") 10pt)
2fa604
    (("presbyopic") 12pt)
2fa604
    (("large-type") 24pt)))
2fa604
2fa604
(define-unit em %bf-size%)
2fa604
2fa604
;;======================================
2fa604
;;Margins
2fa604
;;======================================
2fa604
2fa604
(define %left-right-margin% 6pi)
2fa604
2fa604
;;How much indentation for the body?
2fa604
(define %body-start-indent% 
2fa604
 4pi)
2fa604
2fa604
;;How big is the left margin? (relative to physical page)
2fa604
(define %left-margin% 
2fa604
 8pi) ;white-paper-column
2fa604
2fa604
;;How big is the right margin? (relative to physical page)
2fa604
(define %right-margin% 
2fa604
 8pi) ;white-paper-column
2fa604
2fa604
;;How big do you want the margin at the top?
2fa604
(define %top-margin%
2fa604
(if (equal? %visual-acuity% "large-type")
2fa604
      7.5pi
2fa604
      6pi))
2fa604
2fa604
;;How big do you want the margin at the bottom?
2fa604
(define %bottom-margin% 
2fa604
 (if (equal? %visual-acuity% "large-type")
2fa604
      7.5pi 
2fa604
      5pi))
2fa604
2fa604
;;Define the text width. (Change the elements in the formula rather
2fa604
;;than the formula itself)
2fa604
;(define %text-width% (- %page-width% (* %left-right-margin% 2)))
2fa604
(define %text-width%  (- %page-width% (+ %left-margin% %right-margin%)))
2fa604
2fa604
;;Define the body width. (Change the elements in the formula rather
2fa604
;;than the formula itself)
2fa604
(define %body-width% 
2fa604
 (- %text-width% %body-start-indent%))
2fa604
2fa604
;;Define distance between paragraphs
2fa604
(define %para-sep% 
2fa604
 (/ %bf-size% 2.0))
2fa604
2fa604
;;Define distance between block elements (figures, tables, etc.).
2fa604
(define %block-sep% 
2fa604
 (* %para-sep% 2.0))
2fa604
2fa604
;;Indent block elements?
2fa604
(define %block-start-indent% 
2fa604
  0pt)
2fa604
;0pt
2fa604
2fa604
;;======================================
2fa604
;;Admon Graphics
2fa604
;;======================================
2fa604
2fa604
;;Do you want admon graohics on?
2fa604
(define %admon-graphics%
2fa604
 #f)
2fa604
2fa604
;;Where are the admon graphics?
2fa604
(define %admon-graphics-path%
2fa604
 "../images/")
2fa604
2fa604
;;======================================
2fa604
;;Quadding
2fa604
;;======================================
2fa604
2fa604
;;What quadding do you want by default; start, center, justify, or end?
2fa604
(define %default-quadding%
2fa604
 'justify)
2fa604
2fa604
;;What quadding for component titles(Chapter, Appendix, etc)?
2fa604
(define %component-title-quadding% 
2fa604
 'start)
2fa604
2fa604
;;What quadding for section titles?
2fa604
(define %section-title-quadding% 
2fa604
 'start)
2fa604
2fa604
;;What quadding for section sub-titles?
2fa604
(define %section-subtitle-quadding%
2fa604
 'start)
2fa604
2fa604
;;What quadding for article title?
2fa604
(define %article-title-quadding% 
2fa604
 'center)
2fa604
2fa604
;;What quadding for article sub-titles?
2fa604
(define %article-subtitle-quadding%
2fa604
 'center)
2fa604
2fa604
;;What quadding for division subtitles?
2fa604
(define %division-subtitle-quadding% 
2fa604
  'start)
2fa604
2fa604
;;What quadding for component subtitles?
2fa604
(define %component-subtitle-quadding% 
2fa604
  'start)
2fa604
2fa604
2fa604
2fa604
2fa604
;;======================================
2fa604
;;Paper Options
2fa604
;;======================================
2fa604
2fa604
;;What size paper do you need? A4, USletter, USlandscape, or RedHat?
2fa604
(define %paper-type%
2fa604
 "USletter")
2fa604
2fa604
;;Now define those paper types' width
2fa604
(define %page-width%
2fa604
 (case %paper-type%
2fa604
    (("A4") 210mm)
2fa604
    (("USletter") 8.5in)
2fa604
    (("USlandscape") 11in)))
2fa604
2fa604
;;Now define those paper types' height
2fa604
(define %page-height%
2fa604
 (case %paper-type%
2fa604
    (("A4") 297mm)
2fa604
    (("USletter") 11in)
2fa604
    (("USlandscape") 8.5in)))
2fa604
2fa604
;;======================================
2fa604
;;Functions
2fa604
;;======================================
2fa604
2fa604
(define (OLSTEP)
2fa604
  (case
2fa604
   (modulo (length (hierarchical-number-recursive "ORDEREDLIST")) 4)
2fa604
	((1) 1.2em)
2fa604
	((2) 1.2em)
2fa604
	((3) 1.6em)
2fa604
	((0) 1.4em)))
2fa604
2fa604
(define (ILSTEP) 1.0em)
2fa604
2fa604
(define (PROCSTEP ilvl)
2fa604
  (if (> ilvl 1) 1.8em 1.4em))
2fa604
2fa604
(define (PROCWID ilvl)
2fa604
  (if (> ilvl 1) 1.8em 1.4em))
2fa604
2fa604
2fa604
(define ($comptitle$)
2fa604
  (make paragraph
2fa604
	font-family-name: %title-font-family%
2fa604
	font-weight: 'bold
2fa604
	font-size: (HSIZE 2)
2fa604
	line-spacing: (* (HSIZE 2) %line-spacing-factor%)
2fa604
	space-before: (* (HSIZE 2) %head-before-factor%)
2fa604
	space-after: (* (HSIZE 2) %head-after-factor%)
2fa604
	start-indent: 0pt
2fa604
	first-line-start-indent: 0pt
2fa604
	quadding: 'start
2fa604
	keep-with-next?: #t
2fa604
	(process-children-trim)))
2fa604
2fa604
;;Callouts are confusing in Postscript... fix them.
2fa604
(define %callout-fancy-bug% 
2fa604
 #f)
2fa604
2fa604
2fa604
;;By default perils are centered and dropped into a box with a really
2fa604
;;big border - I have simply decreased the border thickness -
2fa604
;;unfortunately it takes all this to do it - sigh.
2fa604
(define ($peril$)
2fa604
  (let* ((title     (select-elements 
2fa604
		     (children (current-node)) (normalize "title")))
2fa604
	 (has-title (not (node-list-empty? title)))
2fa604
	 (adm-title (if has-title 
2fa604
			(make sequence
2fa604
			  (with-mode title-sosofo-mode
2fa604
			    (process-node-list (node-list-first title))))
2fa604
			(literal
2fa604
			 (gentext-element-name 
2fa604
			  (current-node)))))
2fa604
	 (hs (HSIZE 2)))
2fa604
  (if %admon-graphics%
2fa604
      ($graphical-admonition$)
2fa604
      (make display-group
2fa604
	space-before: %block-sep%
2fa604
	space-after: %block-sep%
2fa604
	font-family-name: %admon-font-family%
2fa604
	font-size: (- %bf-size% 1pt)
2fa604
	font-weight: 'medium
2fa604
	font-posture: 'upright
2fa604
	line-spacing: (* (- %bf-size% 1pt) %line-spacing-factor%)
2fa604
	(make box
2fa604
	  display?: #t
2fa604
	  box-type: 'border
2fa604
	  line-thickness: .5pt
2fa604
	  start-indent: (+ (inherited-start-indent) (* 2 (ILSTEP)) 2pt)
2fa604
	  end-indent: (inherited-end-indent)
2fa604
	  (make paragraph
2fa604
	    space-before: %para-sep%
2fa604
	    space-after: %para-sep%
2fa604
	    start-indent: 1em
2fa604
	    end-indent: 1em
2fa604
	    font-family-name: %title-font-family%
2fa604
	    font-weight: 'bold
2fa604
	    font-size: hs
2fa604
	    line-spacing: (* hs %line-spacing-factor%)
2fa604
	    quadding: 'center
2fa604
	    keep-with-next?: #t
2fa604
	    adm-title)
2fa604
	  (process-children))))))
2fa604
2fa604
2fa604
;;======================================
2fa604
;;Non-printing Elements
2fa604
;;======================================
2fa604
(element TITLEABBREV (empty-sosofo))
2fa604
(element SUBTITLE (empty-sosofo))
2fa604
(element SETINFO (empty-sosofo))
2fa604
(element BOOKINFO (empty-sosofo))
2fa604
(element BIBLIOENTRY (empty-sosofo))
2fa604
(element BIBLIOMISC (empty-sosofo))
2fa604
(element BOOKBIBLIO (empty-sosofo))
2fa604
(element SERIESINFO (empty-sosofo))
2fa604
(element DOCINFO (empty-sosofo))
2fa604
(element ARTHEADER (empty-sosofo))
2fa604
;;(element ADDRESS (empty-sosofo))
2fa604
2fa604
;;Show comment element?
2fa604
(define %show-comments%
2fa604
  #t)
2fa604
2fa604
;;======================================
2fa604
;;Formalpara titles
2fa604
;;======================================
2fa604
2fa604
2fa604
;;Change the way Formal Paragraph titles are displayed. The commented
2fa604
;;out section will run the titles in the paragraphs. 
2fa604
(element (formalpara title)
2fa604
  ;(make sequence
2fa604
  ;font-weight: 'bold
2fa604
  ;($runinhead$))
2fa604
  ($lowtitle$ 5 7))
2fa604
2fa604
;;======================================
2fa604
;;Inlines
2fa604
;;======================================
2fa604
2fa604
(element application ($mono-seq$))
2fa604
(element command ($bold-seq$))
2fa604
(element filename ($mono-seq$))
2fa604
(element function ($mono-seq$))
2fa604
(element guibutton ($bold-seq$))
2fa604
(element guiicon ($bold-seq$))
2fa604
(element guilabel ($italic-seq$))
2fa604
(element guimenu ($bold-seq$))
2fa604
(element guimenuitem ($bold-seq$))
2fa604
(element hardware ($bold-mono-seq$))
2fa604
(element keycap ($bold-seq$))
2fa604
(element literal ($mono-seq$))
2fa604
(element parameter ($italic-mono-seq$))
2fa604
(element prompt ($mono-seq$))
2fa604
(element symbol ($charseq$))
2fa604
(element emphasis ($italic-seq$))
2fa604
2fa604
</style-specification-body>
2fa604
</style-specification>
2fa604
2fa604
2fa604
2fa604
;;===========================================================================
2fa604
;;                                HTML
2fa604
;;===========================================================================
2fa604
-->
2fa604
2fa604
<style-specification id="html" use="docbook">
2fa604
<style-specification-body> 
2fa604
2fa604
;; this is necessary because right now jadetex does not understand
2fa604
;; symbolic entities, whereas things work well with numeric entities.
2fa604
(declare-characteristic preserve-sdata?
2fa604
          "UNREGISTERED::James Clark//Characteristic::preserve-sdata?"
2fa604
          #f)
2fa604
2fa604
2fa604
;;=========================
2fa604
;;Header HTML 4.0.1
2fa604
;;=========================
2fa604
2fa604
(define %html-pubid% "-//W3C//DTD HTML 4.01//EN")
2fa604
2fa604
;;=========================
2fa604
;;Common Stuff
2fa604
;;=========================
2fa604
2fa604
;;Should there be a link to the legalnotice?
2fa604
(define %generate-legalnotice-link%
2fa604
  #t)
2fa604
2fa604
;;What graphics extensions allowed?
2fa604
(define %graphic-extensions% 
2fa604
'("gif" "png" "jpg" "jpeg" "tif" "tiff" "eps" "epsf" ))
2fa604
2fa604
;;What is the default extension for images?
2fa604
(define %graphic-default-extension% "png")
2fa604
2fa604
;;Use element ids as filenames?
2fa604
(define %use-id-as-filename%
2fa604
 #f)
2fa604
2fa604
2fa604
;;=========================
2fa604
;;Book Stuff
2fa604
;;=========================
2fa604
2fa604
;;Do you want a TOC for Books?
2fa604
(define %generate-book-toc% 
2fa604
  #t)
2fa604
2fa604
;;What depth should the TOC generate?
2fa604
;;!Only top level of appendixes!
2fa604
(define (toc-depth nd)
2fa604
  (if (string=? (gi nd) (normalize "book"))
2fa604
      3
2fa604
      (if (string=? (gi nd) (normalize "appendix"))
2fa604
        0
2fa604
        1)))
2fa604
2fa604
;;What elements should have an LOT?
2fa604
(define ($generate-book-lot-list$)
2fa604
  (list (normalize "equation")))
2fa604
2fa604
;;Do you want a title page for your Book?
2fa604
(define %generate-book-titlepage%
2fa604
#t)
2fa604
2fa604
;;=========================
2fa604
;;Part Stuff
2fa604
;;=========================
2fa604
2fa604
;;Should parts have TOCs?
2fa604
(define %generate-part-toc% 
2fa604
  #t)
2fa604
2fa604
;;Should part TOCs be on their titlepages?
2fa604
(define %generate-part-toc-on-titlepage%
2fa604
  #t)
2fa604
2fa604
;;Do you want a title page for your part?
2fa604
(define %generate-part-titlepage% 
2fa604
  #t)
2fa604
2fa604
;;Should the Part intro be on the part title page?
2fa604
(define %generate-partintro-on-titlepage%
2fa604
 #t)
2fa604
2fa604
(define %para-autolabel%
2fa604
 #t)
2fa604
2fa604
;;========================
2fa604
;;Chapter Stuff
2fa604
;;=======================
2fa604
2fa604
;;No TOCs in Chapters
2fa604
(define $generate-chapter-toc$
2fa604
 (lambda ()
2fa604
    #f))
2fa604
2fa604
;;=========================
2fa604
;;Navigation
2fa604
;;=========================
2fa604
2fa604
;;Should there be navigation at top?
2fa604
(define %header-navigation%
2fa604
 #t)
2fa604
2fa604
;;Should there be navigation at bottom?
2fa604
(define %footer-navigation%
2fa604
  #t)
2fa604
2fa604
;;Use tables to create the navigation?
2fa604
(define %gentext-nav-use-tables%
2fa604
 #t)
2fa604
2fa604
;;If tables are used for navigation, 
2fa604
;;how wide should they be? 
2fa604
(define %gentext-nav-tblwidth% 
2fa604
"100%")
2fa604
2fa604
;;Add arrows to navigation (comment these 
2fa604
;;out if you want admon graphics here)
2fa604
(define (gentext-en-nav-prev prev) 
2fa604
  (make sequence (literal "<<< Previous")))
2fa604
2fa604
;;Add arrows to navigation (comment these 
2fa604
;;out if you want admon graphics here)
2fa604
(define (gentext-en-nav-next next)
2fa604
  (make sequence (literal "Next >>>")))
2fa604
2fa604
2fa604
;;=========================
2fa604
;;Tables and Lists
2fa604
;;=========================
2fa604
2fa604
;;Should Variable lists be tables?
2fa604
(define %always-format-variablelist-as-table%
2fa604
 #f)
2fa604
2fa604
;;What is the length of the 'Term' in a variablelist?
2fa604
(define %default-variablelist-termlength%
2fa604
  20)
2fa604
2fa604
;;When true | If the terms are shorter than 
2fa604
;;the termlength above then the variablelist 
2fa604
;;will be formatted as a table.
2fa604
(define %may-format-variablelist-as-table%
2fa604
#f)
2fa604
2fa604
;;This overrides the tgroup definition 
2fa604
;;(copied from 1.20, dbtable.dsl).
2fa604
;;It changes the table background color, 
2fa604
;;cell spacing and cell padding.
2fa604
;;This is based on gtk-doc additions - thanks!
2fa604
2fa604
(element tgroup
2fa604
  (let* ((wrapper   (parent (current-node)))
2fa604
	 (frameattr (attribute-string (normalize "frame") wrapper))
2fa604
	 (pgwide    (attribute-string (normalize "pgwide") wrapper))
2fa604
	 (footnotes (select-elements (descendants (current-node)) 
2fa604
				     (normalize "footnote")))
2fa604
	 (border (if (equal? frameattr (normalize "none"))
2fa604
		     '(("BORDER" "0"))
2fa604
		     '(("BORDER" "1"))))
2fa604
	 (bgcolor '(("BGCOLOR" "#E0E0E0")))
2fa604
	 (width (if (equal? pgwide "1")
2fa604
		    (list (list "WIDTH" ($table-width$)))
2fa604
		    '()))
2fa604
	 (head (select-elements (children (current-node)) (normalize "thead")))
2fa604
	 (body (select-elements (children (current-node)) (normalize "tbody")))
2fa604
	 (feet (select-elements (children (current-node)) (normalize "tfoot"))))
2fa604
    (make element gi: "TABLE"
2fa604
	  attributes: (append
2fa604
		       border
2fa604
		       width
2fa604
		       bgcolor
2fa604
		       '(("CELLSPACING" "0"))
2fa604
		       '(("CELLPADDING" "4"))
2fa604
		       (if %cals-table-class%
2fa604
			   (list (list "CLASS" %cals-table-class%))
2fa604
			   '()))
2fa604
	  (process-node-list head)
2fa604
	  (process-node-list body)
2fa604
	  (process-node-list feet)
2fa604
	  (make-table-endnotes))))
2fa604
2fa604
;;===================
2fa604
;; Admon Graphics
2fa604
;;===================
2fa604
2fa604
;;Should Admon Graphics be used?
2fa604
(define %admon-graphics%
2fa604
  #t)
2fa604
2fa604
;;Where are those admon graphics?
2fa604
(define %admon-graphics-path%
2fa604
  "./stylesheet-images/")
2fa604
2fa604
;;Given an admonition node, returns the 
2fa604
;;name of the graphic that should
2fa604
;;be used for that admonition.
2fa604
;;Define admon graphics usage
2fa604
;;NOTE these will change to pngs 
2fa604
;;soon in the GDP when Tigert gets 
2fa604
;;the time to make special ones for us!
2fa604
(define ($admon-graphic$ #!optional (nd (current-node)))
2fa604
  (cond ((equal? (gi nd) (normalize "tip"))
2fa604
	 (string-append %admon-graphics-path% "tip.gif"))
2fa604
	((equal? (gi nd) (normalize "note"))
2fa604
	 (string-append %admon-graphics-path% "note.gif"))
2fa604
	((equal? (gi nd) (normalize "important"))
2fa604
	 (string-append %admon-graphics-path% "important.gif"))
2fa604
	((equal? (gi nd) (normalize "caution"))
2fa604
	 (string-append %admon-graphics-path% "caution.gif"))
2fa604
	((equal? (gi nd) (normalize "warning"))
2fa604
	 (string-append %admon-graphics-path% "warning.gif"))
2fa604
	(else (error (string-append (gi nd) " is not an admonition.")))))
2fa604
2fa604
;;Given an admonition node, returns 
2fa604
;;the width of the graphic that will
2fa604
;;be used for that admonition.
2fa604
(define ($admon-graphic-width$ #!optional (nd (current-node)))
2fa604
  "25")
2fa604
2fa604
;;=========================
2fa604
;;Labels
2fa604
;;=========================
2fa604
2fa604
;;Enumerate Chapters?
2fa604
(define %chapter-autolabel% 
2fa604
 #f)
2fa604
2fa604
;;Enumerate Sections?
2fa604
(define %section-autolabel%
2fa604
 #f)
2fa604
2fa604
;;=========================
2fa604
;;    HTML Attributes
2fa604
;;=========================
2fa604
2fa604
;;What attributes should be hung off 
2fa604
;;of 'body'?
2fa604
(define %body-attr%
2fa604
 (list
2fa604
   (list "BGCOLOR" "#FFFFFF")
2fa604
   (list "TEXT" "#000000")
2fa604
   (list "LINK" "#0000FF")
2fa604
   (list "VLINK" "#840084")
2fa604
   (list "ALINK" "#0000FF")))
2fa604
2fa604
;;Default extension for filenames?
2fa604
(define %html-ext% 
2fa604
  ".html")
2fa604
2fa604
;;Use a CSS stylesheet?
2fa604
;;Which one? Should work on 
2fa604
;;this one soon
2fa604
;(define %stylesheet% 
2fa604
;        "./gnome.css")
2fa604
2fa604
;;Use it
2fa604
;(define %stylesheet-type% 
2fa604
;"text/css")
2fa604
2fa604
2fa604
;;========================
2fa604
;;Title Pages for Books
2fa604
;;=======================
2fa604
2fa604
(define (book-titlepage-recto-elements)
2fa604
  (list (normalize "title")
2fa604
	(normalize "subtitle")
2fa604
	(normalize "corpauthor")
2fa604
	(normalize "authorgroup")
2fa604
	(normalize "author")
2fa604
	(normalize "orgname")
2fa604
	(normalize "graphic")
2fa604
	(normalize "copyright")
2fa604
	(normalize "legalnotice")
2fa604
	(normalize "releaseinfo")
2fa604
	(normalize "publisher")
2fa604
	(normalize "isbn")))
2fa604
2fa604
;;========================
2fa604
;;Title Pages for Articles
2fa604
;;========================
2fa604
2fa604
;;Should Articles have a TOC?
2fa604
(define %generate-article-toc% 
2fa604
  #t)
2fa604
2fa604
;;Which elements should appear 
2fa604
;;on title page?
2fa604
(define (article-titlepage-recto-elements)
2fa604
  (list (normalize "title")
2fa604
	(normalize "subtitle")
2fa604
        (normalize "authorgroup")
2fa604
        (normalize "copyright")
2fa604
        (normalize "legalnotice")
2fa604
        (normalize "abstract")))
2fa604
2fa604
;;How should elements on title page look?
2fa604
(mode article-titlepage-recto-mode
2fa604
2fa604
;;Author name is too big - change it!
2fa604
  (element author
2fa604
    (let ((author-name  (author-string))
2fa604
	  (author-affil (select-elements (children (current-node)) 
2fa604
					 (normalize "affiliation"))))
2fa604
      (make sequence      
2fa604
	(make element gi: "H4"
2fa604
	      attributes: (list (list "CLASS" (gi)))
2fa604
	      (make element gi: "A"
2fa604
		    attributes: (list (list "NAME" (element-id)))
2fa604
		    (literal author-name)))
2fa604
	(process-node-list author-affil))))
2fa604
2fa604
;;Address?
2fa604
  (element address 
2fa604
    (make sequence
2fa604
      (make element gi: "DIV"
2fa604
            attributes: (list (list "CLASS" (gi)))
2fa604
            (process-children))))
2fa604
2fa604
;;Get rid of spam-producing "mailto" links
2fa604
;;and get rid of email indentation  
2fa604
  (element email
2fa604
    (make sequence
2fa604
      (make element gi: "DIV"
2fa604
            attributes: (list (list "CLASS" (gi)))
2fa604
            (process-children))))
2fa604
2fa604
;;Point Abstract to custom table function 
2fa604
;;(See $dcm-abstract-object$ below. For default
2fa604
;;use $semiformal-object$
2fa604
  (element abstract
2fa604
    (make element gi: "DIV"
2fa604
          ($dcm-abstract-object$)))
2fa604
2fa604
  (element (abstract title) (empty-sosofo))
2fa604
2fa604
;;subtitle sizing
2fa604
(element subtitle 
2fa604
  (make element gi: "H4"
2fa604
        attributes: (list (list "CLASS" (gi)))
2fa604
        (process-children-trim))))
2fa604
2fa604
;;=================
2fa604
;;    INLINES
2fa604
;;=================
2fa604
2fa604
;Define my own series of fonts for various elements
2fa604
(element application ($mono-seq$))
2fa604
(element command ($bold-seq$))
2fa604
(element filename ($mono-seq$))
2fa604
(element function ($mono-seq$))
2fa604
(element guibutton ($bold-seq$))
2fa604
(element guiicon ($bold-seq$))
2fa604
(element guilabel ($bold-mono-seq$))
2fa604
(element guimenu ($bold-seq$))
2fa604
(element guimenuitem ($bold-seq$))
2fa604
(element guisubmenu ($bold-seq$))
2fa604
(element hardware ($bold-mono-seq$))
2fa604
(element keycap ($bold-seq$))
2fa604
(element literal ($mono-seq$))
2fa604
(element parameter ($italic-mono-seq$))
2fa604
(element prompt ($mono-seq$))
2fa604
(element symbol ($charseq$))
2fa604
(element emphasis ($italic-seq$))
2fa604
2fa604
;;Show comment element?
2fa604
(define %show-comments%
2fa604
  #t)
2fa604
2fa604
;;====================
2fa604
;; General Formatting
2fa604
;;====================
2fa604
2fa604
;;Formal Paras are ugly by default!
2fa604
;;Make the title run in - otherwise 
2fa604
;;you should use a sect!
2fa604
(element formalpara
2fa604
  (make element gi: "DIV"
2fa604
	attributes: (list
2fa604
		     (list "CLASS" (gi)))
2fa604
  	(make element gi: "P"
2fa604
	      (process-children))))
2fa604
2fa604
;;This is the old one 
2fa604
;(element (formalpara title) 
2fa604
;($lowtitle$ 5))
2fa604
2fa604
;;This is the new one
2fa604
(element (formalpara title) 
2fa604
  (make element gi: "B"
2fa604
	($runinhead$)))
2fa604
2fa604
;;Make captions come after objects in the list
2fa604
(define ($object-titles-after$)
2fa604
  (list (normalize "figure")))
2fa604
2fa604
2fa604
;; Handle qanda labelling with Q: A:
2fa604
(define (qanda-defaultlabel)
2fa604
  (normalize "qanda"))
2fa604
2fa604
;;From FreeBSD Sheets (Thanks!) Display Q and A in bigger bolder fonts
2fa604
2fa604
(element question
2fa604
  (let* ((chlist   (children (current-node)))
2fa604
	 (firstch  (node-list-first chlist))
2fa604
	 (restch   (node-list-rest chlist)))
2fa604
    (make element gi: "DIV"
2fa604
	  attributes: (list (list "CLASS" (gi)))
2fa604
	  (make element gi: "P" 
2fa604
		(make element gi: "BIG"
2fa604
		      (make element gi: "A"
2fa604
			    attributes: (list
2fa604
					 (list "NAME" (element-id)))
2fa604
			    (empty-sosofo))
2fa604
		      (make element gi: "B"
2fa604
			    (literal (question-answer-label
2fa604
				      (current-node)) " ")
2fa604
			    (process-node-list (children firstch)))))
2fa604
	  (process-node-list restch))))
2fa604
2fa604
;;Literal Elements
2fa604
2fa604
;;Indent Literal layouts?
2fa604
(define %indent-literallayout-lines% 
2fa604
  #f)
2fa604
2fa604
;;Indent Programlistings?
2fa604
(define %indent-programlisting-lines%
2fa604
  #f)
2fa604
2fa604
;;Number lines in Programlistings?
2fa604
(define %number-programlisting-lines%
2fa604
 #f)
2fa604
2fa604
;;Should verbatim items be 'shaded' with a table?
2fa604
(define %shade-verbatim% 
2fa604
 #t)
2fa604
2fa604
;;Define shade-verbatim attributes
2fa604
(define ($shade-verbatim-attr$)
2fa604
 (list
2fa604
  (list "BORDER" "0")
2fa604
  (list "BGCOLOR" "#E0E0E0")
2fa604
  (list "WIDTH" ($table-width$))))
2fa604
2fa604
;;===================
2fa604
;;    Entities
2fa604
;;===================
2fa604
2fa604
;;Netscape doesn't handle trademark 
2fa604
;;entity right at all!! Get rid of it.
2fa604
;;Make a TM in a superscipt font.
2fa604
(element trademark
2fa604
  (make sequence
2fa604
    (process-children)
2fa604
    (make element gi: "sup"
2fa604
    (literal "TM"))))
2fa604
2fa604
2fa604
;;===================
2fa604
;; New Definitions
2fa604
;;==================
2fa604
2fa604
(define ($dcm-abstract-object$)
2fa604
   (make element gi: "TABLE"
2fa604
        attributes: '(("BORDER" "0")
2fa604
                      ("BGCOLOR" "#E0E0E0")
2fa604
                      ("WIDTH" "50%")
2fa604
                      ("CELLSPACING" "0")
2fa604
                      ("CELLPADDING" "0")
2fa604
                      ("ALIGN" "CENTER"))
2fa604
        (make element gi: "TR"
2fa604
              (make element gi: "TD"
2fa604
                    attributes: '(("VALIGN" "TOP"))
2fa604
                    (make element gi: "B"
2fa604
                    (literal "Abstract"))))
2fa604
        (make element gi: "TR"
2fa604
              (make element gi: "TD"
2fa604
                    attributes: '(("VALIGN" "TOP"))
2fa604
                    (process-children)))))
2fa604
2fa604
;;Redefine Titlepage Separator on Articles
2fa604
2fa604
(define (article-titlepage-separator side)
2fa604
  (make empty-element gi: "HR"
2fa604
  attributes: '(("WIDTH" "75%")
2fa604
                 ("ALIGN" "CENTER")
2fa604
                 ("COLOR" "#000000")
2fa604
                 ("SIZE" "1"))))
2fa604
2fa604
2fa604
2fa604
2fa604
(define (chunk-element-list)
2fa604
  (list (normalize "preface")
2fa604
	(normalize "chapter")
2fa604
	(normalize "appendix") 
2fa604
	(normalize "article")
2fa604
	(normalize "glossary")
2fa604
	(normalize "bibliography")
2fa604
	(normalize "index")
2fa604
	(normalize "colophon")
2fa604
	(normalize "setindex")
2fa604
	(normalize "reference")
2fa604
	(normalize "refentry")
2fa604
	(normalize "part")
2fa604
	(normalize "sect1") 
2fa604
	(normalize "section") 
2fa604
	(normalize "book") ;; just in case nothing else matches...
2fa604
	(normalize "set")  ;; sets are definitely chunks...
2fa604
	))
2fa604
2fa604
;;Do you want Callouts to be graphics?
2fa604
(define %callout-graphics%
2fa604
#f)
2fa604
2fa604
2fa604
;;Make Callout graphics PNGs
2fa604
(define %callout-graphics-path%
2fa604
  "./imagelib/callouts/")
2fa604
2fa604
  ;; Redefine $callout-bug$ to support the %callout-graphic-ext%
2fa604
  ;; variable.
2fa604
  (define ($callout-bug$ conumber)
2fa604
    (let ((number (if conumber (format-number conumber "1") "0")))
2fa604
      (if conumber
2fa604
          (if %callout-graphics%
2fa604
              (if (<= conumber %callout-graphics-number-limit%)
2fa604
                  (make empty-element gi: "IMG"
2fa604
                        attributes: (list (list "SRC"
2fa604
                                                (root-rel-path
2fa604
                                                 (string-append
2fa604
                                                  %callout-graphics-path%
2fa604
                                                  number
2fa604
                                                  %callout-graphics-ext%)))
2fa604
                                          (list "HSPACE" "0")
2fa604
                                          (list "VSPACE" "0")
2fa604
                                          (list "BORDER" "0")
2fa604
                                          (list "ALT"
2fa604
                                                (string-append
2fa604
                                                 "(" number ")"))))
2fa604
                  (make element gi: "B"
2fa604
                        (literal "(" (format-number conumber "1") ")")))
2fa604
              (make element gi: "B"
2fa604
                    (literal "(" (format-number conumber "1") ")")))
2fa604
          (make element gi: "B"
2fa604
         (literal "(??)")))))
2fa604
2fa604
</style-specification-body>
2fa604
</style-specification>
2fa604
2fa604
<external-specification id="docbook" document="docbook.dsl">
2fa604
2fa604
</style-sheet>