<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
<!ENTITY % html "IGNORE">
<![%html;[
<!ENTITY % print "IGNORE">
<!ENTITY docbook.dsl PUBLIC "-//Norman Walsh//DOCUMENT DocBook HTML Stylesheet//EN" CDATA dsssl>
]]>
<!ENTITY % print "INCLUDE">
<![%print;[
<!ENTITY docbook.dsl PUBLIC "-//Norman Walsh//DOCUMENT DocBook Print Stylesheet//EN" CDATA dsssl>
]]>
]>

<!--
Changelog
* Oct 2001 Tammy Fox <tfox@redhat.com>
- Added print stylesheet specification
- Updated html stylesheet specification with new stuff in docbook-utils.dsl from RHL 7.2
- Renamed redhat.dsl
- Removed ulinks from index
- Enumurate sections in print version
- Added section to format title page
- Changed body indention to 0
- Made article and book titlepages more spaced out
- Added [] around keycap in print version
- Made part divider page have larger text and centered
- Changed paper size, margins, and font sizes

* Feb 2001 Ed Bailey <ed@redhat.com>
- Further hacked

* Nov 2000 Tammy Fox <tfox@redhat.com>
- Tried to make html and print stylesheets more similar
- Fixed address formatting on first html page
- Added stuff to make html for articles look ok

* Dave Mason <dcm@redhat.com>
- original creator of stylesheet based on Norman Walsh's Modular Stylesheets
-->

<style-sheet>

<style-specification id="print" use="docbook">
<style-specification-body> 

;;==========================================================================
;;                               PRINT
;;==========================================================================

;;======================================
;;General Options
;;======================================

;;Do you want to print on both sides of the paper?
(define %two-side% 
 #t)

;;Do you want enumerated sections? (E.g, 1.1, 1.1.1, 1.2, etc.)
(define %section-autolabel% 
 #t)

;;What is the default extension for graphics?
(define %graphic-default-extension% 
  "eps")

;;Show URL links? If the text of the link and the URL are identical,
;;the parenthetical URL is suppressed.
(define %show-ulinks%
 #t)

;Make Ulinks footnotes to stop bleeding in the edges - this increases
;'jade --> print' time tremendously keep this in mind before
;complaining!
;changed to f - tfox oct2001
(define %footnote-ulinks%
  #f)

;;Tex Backend on
(define tex-backend 
 #t)

;;Define Line Spacing
(define %line-spacing-factor% 1.1)

;;Define the Paragraph Style
(define para-style
  (style
   font-size: %bf-size%
   font-weight: 'medium
   font-posture: 'upright
   font-family-name: %body-font-family%
   line-spacing: (* %bf-size% %line-spacing-factor%)))

(define ($object-titles-after$)
  (list (normalize "figure")))

;;======================================
;;Book Options
;;======================================


;;Do you want a title page for a Book?
(define %generate-book-titlepage%
 #t)

;;Do you want a separate page for the title?
(define %generate-book-titlepage-on-separate-page%
 #t)

;;Generate Book TOC?
(define %generate-book-toc% 
 #t)

;;What depth should the TOC generate?
;;!Only top level of appendixes!
(define (toc-depth nd)
  (if (string=? (gi nd) (normalize "book"))
      3
      (if (string=? (gi nd) (normalize "appendix"))
        0
        1)))

;;Do you want a TOC for the element part?
(define %generate-part-toc% 
 #f)

;;Do you want the part toc on the part titlepage or separate?
(define %generate-part-toc-on-titlepage%
 #t)

;;Generate Part Title Page?
(define %generate-part-titlepage% 
  #f)

;;Do you want the Part intro on the part title page?
(define %generate-partintro-on-titlepage%
  #t)

;;What elements should have a LOT?
(define ($generate-book-lot-list$)
  (list (normalize "equation")))

;;Do you want chapters enumerated?
(define %chapter-autolabel% 
 #t)

;;Do you want Chapter's and Appendix's 
;;to have automatic labels?
(define %chap-app-running-head-autolabel% 
  #t)

;;======================================
;;Book Title Page
;;======================================

(define (book-titlepage-recto-elements)
  (list (normalize "title")
        (normalize "subtitle")))

(mode book-titlepage-recto-mode
  (element title 
    (make paragraph
      use: set-titlepage-recto-style
      font-size: (HSIZE 10)
      font-posture: 'italic
      font-family-name: %title-font-family%
      line-spacing: (* (HSIZE 10) %line-spacing-factor%)
      space-before: (* (HSIZE 5) %head-before-factor%)
      quadding: 'end
      keep-with-next?: #t
      (with-mode title-mode
        (process-children-trim))))
  (element subtitle 
    (make paragraph
      use: set-titlepage-recto-style
      font-size: (HSIZE 10)
      font-family-name: %title-font-family%
      line-spacing: (* (HSIZE 10) %line-spacing-factor%)
      space-before: (* (HSIZE 30) %head-before-factor%)
      quadding: %division-title-quadding%
      keep-with-next?: #t
      (with-mode title-mode
        (process-children-trim))))

)

;;======================================
;;Part Title
;;======================================

(define ($parttitle$)
  (make simple-page-sequence
	top-margin: %top-margin%
	bottom-margin: %bottom-margin%
	left-margin: %left-right-margin%
	right-margin: %left-right-margin%
	input-whitespace-treatment: 'collapse
	(make paragraph
	      font-family-name: %title-font-family%
	      font-weight: 'bold
	      font-size: (HSIZE 5)
	      line-spacing: (* (HSIZE 5) %line-spacing-factor%)
	      space-before: (* (HSIZE 50) %head-before-factor%)
	      space-after: (* (HSIZE 3) %head-after-factor% 4)
	      quadding: 'center
	      keep-with-next?: #t
	      (process-children-trim))))

(element (part title) ($parttitle$))

<!--
;;======================================
;;Book Chapter Title Page
;;======================================

(define ($chaptertitle$) 
  (make simple-page-sequence
	top-margin: %top-margin%
	bottom-margin: %bottom-margin%
	left-margin: %left-right-margin%
	right-margin: %left-right-margin%
	input-whitespace-treatment: 'collapse
	(make paragraph
	  use: set-titlepage-recto-style
	  font-size: (HSIZE 5)
	  line-spacing: (* (HSIZE 10) %line-spacing-factor%)
	  ;;      space-before: (* (HSIZE 5) %head-before-factor%)
	  quadding: %division-title-quadding%
	  keep-with-next?: #t
	    (process-children-trim))))

(element (chapter title) ($chaptertitle$))
-->

;;======================================
;;Article Options
;;======================================

;;Do you want a title page for an Article?
(define %generate-article-titlepage%
 #t)

;;Generate Article TOC?
(define %generate-article-toc% 
 #t)

;;Do you want a separate page for the title?
(define %generate-article-titlepage-on-separate-page%
 #t)

;;Do you want the article toc on the titlepage or separate?
(define %generate-article-toc-on-titlepage%
 #f)

;;Do you want to start new page numbers with each article?
(define %article-page-number-restart%
 #f)

;;Titlepage Separate?
(define (chunk-skip-first-element-list)
  '())

;;Titlepage Not Separate
;(define (chunk-skip-first-element-list)
;  (list (normalize "sect1")
;	(normalize "section")))

;;========================
;;Title Pages for Articles
;;========================
;;added tfox

;;Which elements should appear 
;;on title page?
(define (article-titlepage-recto-elements)
  (list (normalize "title")
	(normalize "subtitle")
        (normalize "copyright")
        (normalize "authorgroup")
	(normalize "revhistory")
	(normalize "abstract")
	))
;;removed for now until I can figure
;;out how to make a new page for legalnotice
;;        (normalize "legalnotice"))) 

(mode article-titlepage-recto-mode
  (element title 
    (make paragraph
      use: set-titlepage-recto-style
      font-size: (HSIZE 10)
      line-spacing: (* (HSIZE 10) %line-spacing-factor%)
      space-before: (* (HSIZE 5) %head-before-factor%)
      quadding: %division-title-quadding%
      keep-with-next?: #t
      (with-mode title-mode
        (process-children-trim))))
  (element subtitle 
    (make paragraph
      use: set-titlepage-recto-style
      font-size: (HSIZE 10)
      line-spacing: (* (HSIZE 10) %line-spacing-factor%)
      space-before: (* (HSIZE 10) %head-before-factor%)
      quadding: %division-title-quadding%
      keep-with-next?: #t
      (with-mode title-mode
        (process-children-trim))))
  (element copyright
    (make paragraph
      use: article-titlepage-recto-style
      space-before: (* (HSIZE 10) %head-before-factor%)
      quadding: %article-title-quadding%
      (literal (gentext-element-name (current-node)))
      (literal "\no-break-space;")
      (literal (dingbat "copyright"))
      (literal "\no-break-space;")
      (process-children)))
  (element (copyright year)
    (make sequence
      (process-children)
      (if (not (last-sibling? (current-node)))
          (literal ", ")
          (literal (string-append " " (gentext-by) " ")))))
  (element (copyright holder) ($charseq$))
  (element authorgroup
    (make paragraph
      use: set-titlepage-recto-style
      font-size: (HSIZE 3)
      line-spacing: (* (HSIZE 10) %line-spacing-factor%)
      space-before: (* (HSIZE 5) %head-before-factor%)
      quadding: %division-title-quadding%
      keep-with-next?: #t
      (with-mode title-mode
        (process-children-trim))))
  (element abstract
    (make display-group
      use: article-titlepage-verso-style ;; EVEN THOUGH IT'S RECTO!
      quadding: 'start
      start-indent: (+ (inherited-start-indent) 0.5in)
      end-indent: (+ (inherited-end-indent) 0.5in)
      ($semiformal-object$)))
  (element (abstract title) (empty-sosofo))

;;end of article-titlepage-recto-mode 
)

;;======================================
;;Columns
;;======================================

;;How many columns do you want?
(define %page-n-columns%
 1)

;;How much space between columns?
(define %page-column-sep%
 0.2in)

;;How many Columns on the titlepage?
(define %titlepage-n-columns%
  1)

;;Balance columns?
(define %page-balance-colums%
#t)

;;======================================
;;Divisions
;;======================================


(define ($divtitlepage$)
  (make simple-page-sequence
	top-margin: %top-margin%
	bottom-margin: %bottom-margin%
	left-margin: %left-right-margin%
	right-margin: %left-right-margin%
	input-whitespace-treatment: 'collapse
	(make paragraph
	      font-family-name: %title-font-family%
	      font-weight: 'bold
	      font-size: (HSIZE 10)
	      line-spacing: (* (HSIZE 3) %line-spacing-factor%)
	      space-before: (* (HSIZE 3) %head-before-factor%)
	      space-after: (* (HSIZE 3) %head-after-factor% 4)
	      quadding: 'start
	      keep-with-next?: #t
	      (process-children-trim))))

(element (SET TITLE) ($divtitlepage$))
(element (BOOK TITLE) ($divtitlepage$))
(element (ARTHEADER TITLE) ($divtitlepage$))
(element (ARTICLEINFO TITLE) ($divtitlepage$))
;;(element (PART TITLE) ($divtitlepage$))

;;======================================
;;Fonts
;;======================================

;;Defines the general size of the text in the document. normal(10),
;;presbyopic(12), and large-type(24). 
(define %visual-acuity%
 "normal")

;;What font would you like for titles?
(define %title-font-family% 
  "Helvetica")

;;What font would you like for the body?
(define %body-font-family% 
 "Palatino")

;;What font would you like for mono-seq?
(define %mono-font-family% 
 "Courier New")

;;If the base fontsize is 10pt, and '%hsize-bump-factor%' is
;; 1.2, hsize 1 is 12pt, hsize 2 is 14.4pt, hsize 3 is 17.28pt, etc
(define %hsize-bump-factor% 
 1.1)

;;What size do you want the body fonts?
(define %bf-size%
 (case %visual-acuity%
    (("tiny") 6pt)
    (("normal") 8pt)
    (("presbyopic") 10pt)
    (("large-type") 20pt)))

;;(define %bf-size%
;; (case %visual-acuity%
;;    (("tiny") 8pt)
;;    (("normal") 10pt)
;;    (("presbyopic") 12pt)
;;    (("large-type") 24pt)))

(define-unit em %bf-size%)

;;======================================
;;Margins
;;======================================
;;default margins defined in /usr/share/sgml/docbook/dsssl-stylesheets/print/dbparam.dsl
;;6pi is approximately 1 in with RedHat page size

(define %left-right-margin% 6pi)

;;How much indentation for the body?
(define %body-start-indent% 
 0pi)

;;How big is the left margin? (relative to physical page)
(define %left-margin% 
 4pi) ;white-paper-column

;;How big is the right margin? (relative to physical page)
(define %right-margin% 
 4pi) ;white-paper-column

;;How big do you want the margin at the top?
(define %top-margin%
(if (equal? %visual-acuity% "large-type")
      4pi
      2pi))

;;How big do you want the margin at the bottom?
(define %bottom-margin% 
 (if (equal? %visual-acuity% "large-type")
      4pi 
      2pi))

;;Define the text width. (Change the elements in the formula rather
;;than the formula itself)
;(define %text-width% (- %page-width% (* %left-right-margin% 2)))
(define %text-width%  (- %page-width% (+ %left-margin% %right-margin%)))

;;Define the body width. (Change the elements in the formula rather
;;than the formula itself)
(define %body-width% 
 (- %text-width% %body-start-indent%))

;;Define distance between paragraphs
(define %para-sep% 
 (/ %bf-size% 2.0))

;;Define distance between block elements (figures, tables, etc.).
(define %block-sep% 
 (* %para-sep% 2.0))

;;Indent block elements?
(define %block-start-indent% 
  0pt)
;0pt

;;Define distance above sections

;;======================================
;;Admon Graphics
;;======================================

;;Do you want admon graohics on?
(define %admon-graphics%
 #t)

;;Where are the admon graphics?
(define %admon-graphics-path%
 "./rh-sgml/stylesheet-images/")

;;======================================
;;Quadding
;;======================================

;;What quadding do you want by default; start, center, justify, or end?
(define %default-quadding%
 'justify)

;;What quadding for component titles(Chapter, Appendix, etc)?
(define %component-title-quadding% 
 'start)

;;What quadding for section titles?
(define %section-title-quadding% 
 'start)

;;What quadding for section sub-titles?
(define %section-subtitle-quadding%
 'start)

;;What quadding for article title?
(define %article-title-quadding% 
 'center)

;;What quadding for article sub-titles?
(define %article-subtitle-quadding%
 'center)

;;What quadding for division subtitles?
(define %division-subtitle-quadding% 
  'start)

;;What quadding for component subtitles?
(define %component-subtitle-quadding% 
  'start)

;;======================================
;;Paper Options
;;======================================

;;What size paper do you need? A4, USletter, USlandscape, or RedHat?
(define %paper-type%
 "RedHat")
;; "USletter")

;;Now define those paper types' width
(define %page-width%
 (case %paper-type%
    (("A4") 210mm)
    (("USletter") 8.5in)
    (("USlandscape") 11in)
;;    (("RedHat") 7.25in)))
    (("RedHat") 5.875in)))

;;Now define those paper types' height
(define %page-height%
 (case %paper-type%
    (("A4") 297mm)
    (("USletter") 11in)
    (("USlandscape") 8.5in)
;;    (("RedHat") 9.25in)))
    (("RedHat") 8.25in)))

;;======================================
;;Functions
;;======================================

(define (OLSTEP)
  (case
   (modulo (length (hierarchical-number-recursive "ORDEREDLIST")) 4)
	((1) 1.2em)
	((2) 1.2em)
	((3) 1.6em)
	((0) 1.4em)))

(define (ILSTEP) 1.0em)

(define (PROCSTEP ilvl)
  (if (> ilvl 1) 1.8em 1.4em))

(define (PROCWID ilvl)
  (if (> ilvl 1) 1.8em 1.4em))


(define ($comptitle$)
  (make paragraph
	font-family-name: %title-font-family%
	font-weight: 'bold
	font-size: (HSIZE 2)
	line-spacing: (* (HSIZE 2) %line-spacing-factor%)
	space-before: (* (HSIZE 2) %head-before-factor%)
	space-after: (* (HSIZE 2) %head-after-factor%)
	start-indent: 0pt
	first-line-start-indent: 0pt
	quadding: 'start
	keep-with-next?: #t
	(process-children-trim)))

;;Callouts are confusing in Postscript... fix them.
(define %callout-fancy-bug% 
 #f)


;;By default perils are centered and dropped into a box with a really
;;big border - I have simply decreased the border thickness -
;;unfortunately it takes all this to do it - sigh.
(define ($peril$)
  (let* ((title     (select-elements 
		     (children (current-node)) (normalize "title")))
	 (has-title (not (node-list-empty? title)))
	 (adm-title (if has-title 
			(make sequence
			  (with-mode title-sosofo-mode
			    (process-node-list (node-list-first title))))
			(literal
			 (gentext-element-name 
			  (current-node)))))
	 (hs (HSIZE 2)))
  (if %admon-graphics%
      ($graphical-admonition$)
      (make display-group
	space-before: %block-sep%
	space-after: %block-sep%
	font-family-name: %admon-font-family%
	font-size: (- %bf-size% 1pt)
	font-weight: 'medium
	font-posture: 'upright
	line-spacing: (* (- %bf-size% 1pt) %line-spacing-factor%)
	(make box
	  display?: #t
	  box-type: 'border
	  line-thickness: .5pt
	  start-indent: (+ (inherited-start-indent) (* 2 (ILSTEP)) 2pt)
	  end-indent: (inherited-end-indent)
	  (make paragraph
	    space-before: %para-sep%
	    space-after: %para-sep%
	    start-indent: 1em
	    end-indent: 1em
	    font-family-name: %title-font-family%
	    font-weight: 'bold
	    font-size: hs
	    line-spacing: (* hs %line-spacing-factor%)
	    quadding: 'center
	    keep-with-next?: #t
	    adm-title)
	  (process-children))))))


;;======================================
;;Non-printing Elements
;;======================================
(element TITLEABBREV (empty-sosofo))
(element SUBTITLE (empty-sosofo))
(element SETINFO (empty-sosofo))
(element BOOKINFO (empty-sosofo))
(element BIBLIOENTRY (empty-sosofo))
(element BIBLIOMISC (empty-sosofo))
(element BOOKBIBLIO (empty-sosofo))
(element SERIESINFO (empty-sosofo))
(element DOCINFO (empty-sosofo))
(element ARTHEADER (empty-sosofo))
(element ADDRESS (empty-sosofo))

;;Show comment element?
(define %show-comments%
  #t)

;;Redefine comment for LSB
(element comment
  (if %show-comments%
      (make paragraph
	start-indent: 0pt
	first-line-start-indent: -10pt
	font-posture: 'italic
	font-size: (* (inherited-font-size) 0.9)
	(make sequence
	  (make line-field 
	    field-width: 10pt
	    quadding: 'center
	    (literal "BEGIN RATIONALE:   "))
	  (process-children))
	(literal "END RATIONALE:   "))
      (empty-sosofo)))

;; In DocBook V4.0 comment became remark
(element remark
  (if %show-comments%
      (make paragraph
	start-indent: 0pt
	first-line-start-indent: -10pt
	font-posture: 'italic
	font-size: (* (inherited-font-size) 0.9)
	(make sequence
	  (make line-field 
	    field-width: 10pt
	    quadding: 'center
	    (literal "BEGIN RATIONALE:   "))
	  (process-children))
	(literal "END RATIONALE:   "))
      (empty-sosofo)))

;;======================================
;;Formalpara titles
;;======================================


;;Change the way Formal Paragraph titles are displayed. The commented
;;out section will run the titles in the paragraphs. 
(element (formalpara title)
  ;(make sequence
  ;font-weight: 'bold
  ;($runinhead$))
  ($lowtitle$ 5))

;;======================================
;;Inlines
;;======================================

;;Define Red Hat element attributes
(element application ($bold-seq$))
(element command ($mono-seq$))
(element filename ($mono-seq$))
(element function ($mono-seq$))
(element guibutton ($bold-seq$))
(element guiicon ($bold-seq$))
(element guilabel ($bold-seq$))
(element guimenu ($bold-seq$))
(element guimenuitem ($bold-seq$))
(element hardware ($bold-seq$))
(element keycap 
   (make sequence
    (literal "[")
    ($charseq$)
    (literal "]")))
(element literal ($mono-seq$))
(element parameter ($italic-mono-seq$))
(element prompt ($mono-seq$))
(element symbol ($charseq$))
(element emphasis ($italic-seq$))

</style-specification-body>
</style-specification>


<!-- 
;;===========================================================================
;;                                HTML
;;===========================================================================
-->

<style-specification id="html" use="docbook">
<style-specification-body>

;; this is necessary because right now jadetex does not understand
;; symbolic entities, whereas things work well with numeric entities.
(declare-characteristic preserve-sdata?
          "UNREGISTERED::James Clark//Characteristic::preserve-sdata?"
          #f)

;;=========================
;;Header HTML 4.0.1
;;=========================

(define %html-pubid% "-//W3C//DTD HTML 4.01 Transitional//EN")


;;=========================
;;General Items
;;=========================

;;Should there be a link to the legalnotice?
(define %generate-legalnotice-link%
  #t)

;;Should Admon Graphics be used?
(define %admon-graphics%
  #t)

;;Where are those admon graphics?
(define %admon-graphics-path%
  "./stylesheet-images/")

;;define which images to use
(define ($admon-graphic$ #!optional (nd (current-node)))
  (cond ((equal? (gi nd) (normalize "tip"))
     (string-append %admon-graphics-path% "tip.gif"))
    ((equal? (gi nd) (normalize "note"))
     (string-append %admon-graphics-path% "note.gif"))
    ((equal? (gi nd) (normalize "important"))
     (string-append %admon-graphics-path% "important.gif"))
    ((equal? (gi nd) (normalize "caution"))
     (string-append %admon-graphics-path% "caution.gif"))
    ((equal? (gi nd) (normalize "warning"))
     (string-append %admon-graphics-path% "warning.gif"))
    (else (error (string-append (gi nd) " is not an admonition.")))))

;;Given an admonition node, returns 
;;the width of the graphic that will
;;be used for that admonition.
(define ($admon-graphic-width$ #!optional (nd (current-node)))
  "25")

;;What graphics extensions allowed?
(define %graphic-extensions% 
'("gif" "png" "jpg" "jpeg" "tif" "tiff" "eps" "epsf" ))

;;What is the default extension for images?
(define %graphic-default-extension% "gif")

;;Use element ids as filenames?
(define %use-id-as-filename%
 #t)

;;Make titles of formal objects appear 
;;after the objects defined in the list
(define ($object-titles-after$)
  (list (normalize "figure")))

;;=========================
;;HTML Attributes
;;=========================

;;What attributes should be hung off of 'body'?
(define %body-attr%
 (list
   (list "BGCOLOR" "#FFFFFF")
   (list "TEXT" "#000000")
   (list "LINK" "#0000FF")
   (list "VLINK" "#840084")
   (list "ALINK" "#0000FF")))

;;Default extension for filenames?
(define %html-ext% 
  ".html")

;;=========================
;;Legalnotice
;;=========================
;; From Tim Waugh
;; Use id for HTML filename

(define ($legalnotice-link-file$ legalnotice)
  (if (and %use-id-as-filename%
           (attribute-string (normalize "id") legalnotice))
      (string-append (case-fold-down (attribute-string (normalize "id")
                                                       legalnotice))
                     %html-ext%)
      (string-append "ln"
                     (number->string (all-element-number legalnotice))
                     %html-ext%)))


;;=========================
;;Book Stuff
;;=========================

;;Do you want a TOC for Books?
(define %generate-book-toc% 
  #t)

;;What depth does the TOC reach? 
;; This depends on the elements used 
;; and which is the highest level.
;; part(1), chapter(2), sect(3) -
;; chapter(1), sect1(2), sect2(3) - etc
(define (toc-depth nd)
  (if (string=? (gi nd) (normalize "book"))
      3 ;this is the important one!
      1))

;;What elements should have an LOT? 
(define ($generate-book-lot-list$)
  (list (normalize "equation")))

;;Do you want a title page for your Book?
(define %generate-book-titlepage%
#t)

;;=========================
;;Part Stuff
;;=========================

;;Should parts have TOCs?
(define %generate-part-toc% 
  #t)

;;Should part TOCs be on their titlepages?
(define %generate-part-toc-on-titlepage%
  #t)

;;Do you want a title page for your parts?
(define %generate-part-titlepage% 
  #t)

;;Should the Part intro be on the part title page?
(define %generate-partintro-on-titlepage%
 #t)

(define %para-autolabel%
 #t)

;;=========================
;;Article Stuff
;;=========================

;;Should Articles have a TOC?
(define %generate-article-toc% 
  #t)

;;========================
;;Title Pages for Articles
;;========================

;;This allows you to define what elements you 
;;wish to have on the article titlepage. 
;;Any element allowed in artheader is available.

(define (article-titlepage-recto-elements)
  (list (normalize "title")
	(normalize "subtitle")
        (normalize "authorgroup")
	(normalize "author")
	(normalize "releaseinfo")
        (normalize "pubdate")
	(normalize "revhistory")
        (normalize "affiliation")
        (normalize "copyright")
	(normalize "legalnotice")
	(normalize "abstract")
	))

;;Redefine Titlepage Separator on Articles
(define (article-titlepage-separator side)
  (make empty-element gi: "HR"
	attributes: '(("WIDTH" "75%")
                 ("ALIGN" "CENTER")
                 ("COLOR" "#000000")
                 ("SIZE" "1"))))
(mode article-titlepage-recto-mode

  (element abstract
    (make element gi: "DIV"
	  ($dcm-abstract-object$)))
  
  (element (abstract title) (empty-sosofo))

;;Author name is too big - change it!
(element author
    (let ((author-name  (author-string))
      (author-affil (select-elements (children (current-node)) 
                     (normalize "affiliation"))))
      (make sequence      
    (make element gi: "H4"
attributes: (list (list "CLASS" (gi)))
          (make element gi: "A"
attributes: (list (list "NAME" (element-id)))
            (literal author-name)))
    (process-node-list author-affil))))


) <!-- end of article mode -->

;;Stole this from Dave's stylesheet so the
;;above puts the abstract instead an artheader
;;in a pretty gray box
(define ($dcm-abstract-object$)
  (make element gi: "TABLE"
	attributes: '(("BORDER" "0")
                      ("BGCOLOR" "#E0E0E0")
                      ("WIDTH" "50%")
                      ("CELLSPACING" "0")
                      ("CELLPADDING" "0")
                      ("ALIGN" "CENTER"))
        (make element gi: "TR"
	      (make element gi: "TD"
		    attributes: '(("VALIGN" "TOP"))
                    (make element gi: "B"
			  (literal "Abstract"))))
        (make element gi: "TR"
	      (make element gi: "TD"
		    attributes: '(("VALIGN" "TOP"))
		    (process-children)))))



;;========================
;;Chapter Stuff
;;=======================

;;Should Chapters have a small TOC?
(define $generate-chapter-toc$
 (lambda ()
    #f))

;;=========================
;;Navigation
;;=========================

;;Should there be navigation at top?
(define %header-navigation%
 #t)

;;Should there be navigation at bottom?
(define %footer-navigation%
  #t)

;;Use tables to create the navigation? 
;;Please make #t if you have any taste ;)
(define %gentext-nav-use-tables%
 #t)

;;If tables are used for navigation, how wide should they be? 
(define %gentext-nav-tblwidth% 
"100%")


;;=========================
;;Tables and Lists
;;=========================

;;Should Variable lists be tables?
(define %always-format-variablelist-as-table%
 #f)

;;What is the length of the 'Term' in a variablelist?
(define %default-variablelist-termlength%
  20)

;;When true::If the terms are shorter than the termlength above then
;;the variablelist will be formatted as a table.
(define %may-format-variablelist-as-table%
#f)

;; This is a personal preference of how tables should look. 
;; It also handles the tables better for use in Netscape
;; It changes the table background color, cell spacing and cell padding.
(element tgroup
  (let* ((wrapper   (parent (current-node)))
	 (frameattr (attribute-string (normalize "frame") wrapper))
	 (pgwide    (attribute-string (normalize "pgwide") wrapper))
	 (footnotes (select-elements (descendants (current-node)) 
				     (normalize "footnote")))
	 (border (if (equal? frameattr (normalize "none"))
		     '(("BORDER" "0"))
		     '(("BORDER" "1"))))
	 (bgcolor '(("BGCOLOR" "#E0E0E0")))
	 (width (if (equal? pgwide "1")
		    (list (list "WIDTH" ($table-width$)))
		    '()))
	 (head (select-elements (children (current-node)) (normalize "thead")))
	 (body (select-elements (children (current-node)) (normalize "tbody")))
	 (feet (select-elements (children (current-node)) (normalize "tfoot"))))
    (make element gi: "TABLE"
	  attributes: (append
		       border
		       width
		       bgcolor
		       '(("CELLSPACING" "0"))
		       '(("CELLPADDING" "4"))
		       (if %cals-table-class%
			   (list (list "CLASS" %cals-table-class%))
			   '()))
	  (process-node-list head)
	  (process-node-list body)
	  (process-node-list feet)
	  (make-table-endnotes))))



;;=========================
;;Elements
;;=========================

;;Indent Literal layouts?
(define %indent-literallayout-lines% 
  #f)

;;Indent Programlistings?
(define %indent-programlisting-lines%
  #f)

;;Number lines in Programlistings?
(define %number-programlisting-lines%
 #f)

;;Should verbatim items be 'shaded' with a table?
(define %shade-verbatim% 
 #t)

;;Define shade-verbatim attributes
(define ($shade-verbatim-attr$)
 (list
  (list "BORDER" "0")
  (list "BGCOLOR" "#E0E0E0")
  (list "WIDTH" ($table-width$))))


;;=================INLINES====================


;;Define your own series of fonts 
;;and font formatting for various elements
(element application ($bold-seq$))
(element command ($mono-seq$))
(element filename ($mono-seq$))
(element function ($mono-seq$))
(element guibutton ($bold-seq$))
(element guiicon ($bold-seq$))
(element guilabel ($bold-seq$))
(element guimenu ($bold-seq$))
(element guimenuitem ($bold-seq$))
(element hardware ($bold-seq$))
(element keycap 
  ($charseq$
   (make element  
    (literal "[")
    (process-children)
    (literal "]"))))
(element literal ($mono-seq$))
(element parameter ($italic-mono-seq$))
(element prompt ($mono-seq$))
(element symbol ($charseq$))
(element emphasis ($italic-seq$))

;;Netscape doesn't handle trademark entity; at all!!
;;Make it a superscript "TM"
(element trademark
  (make sequence
    (process-children)
    (make element gi: "sup"
    (literal "TM"))))

;=============================================

;;========================
;;Title Pages for Books
;;=======================

;;This allows you to define what elements you 
;;wish to have on the book titlepage. 
;;Any element allowed in bookinfo is available.

(define (book-titlepage-recto-elements)
  (list (normalize "title")
	(normalize "mediaobject")
	(normalize "subtitle")
        (normalize "copyright")
        (normalize "legalnotice")
	(normalize "corpauthor")
	(normalize "authorgroup")
	(normalize "author")
	(normalize "orgname")
	(normalize "publisher")
	(normalize "isbn")))

(mode book-titlepage-recto-mode

;;Prepend ISBN to ISBN number
;;tfox@redhat.com
(element isbn
  ($charseq$
   (make sequence
    (make element
	  attributes: (list
		       (list "CLASS" (gi)))
	  (literal "ISBN: ")
	  (process-children)))))

;;Make publishername bold
;;tfox@redhat.com

(element publishername
  ($bold-seq$
  (make sequence
    (make element
	  attributes: (list
		       (list "CLASS" (gi)))
	  (process-children)))))

;;Format address on titlepage
;;tfox@redhat.com

(element (publisher address)
    (let (       

         (street     (select-elements (children (current-node)) (normalize "STREET")))
         (city       (select-elements (children (current-node)) (normalize"CITY")))
         (state      (select-elements (children (current-node)) (normalize "STATE")))
         (postcode   (select-elements (children (current-node)) (normalize "POSTCODE")))
         (country    (select-elements (children (current-node)) (normalize "COUNTRY")))
         (phone      (select-elements (children (current-node)) (normalize "PHONE")))
         (fax        (select-elements (children (current-node)) (normalize "FAX")))
         (email      (select-elements (children (current-node)) (normalize "EMAIL")))
         (pob        (select-elements (children (current-node)) (normalize "POB")))
         (otheraddr  (select-elements (children (current-node)) (normalize "OTHERADDR")))
         )

      (make sequence
	(make paragraph
	  (if(node-list-empty? street)
	     (empty-sosofo)
	     (make element gi: "BR"
		   (process-node-list street)))
	  
	  (if(node-list-empty? pob)
	     (empty-sosofo)
	     (make element gi: "BR"
		   (literal "PO Box  ")
		   (process-node-list pob)))
	  
	  (make paragraph
	    (if(node-list-empty? city)
	       (empty-sosofo)
	       (make sequence
		 (process-node-list city)
		 (literal ", ")))
	    
	    (if(node-list-empty? state)
	       (empty-sosofo)
	       (make sequence
		 (process-node-list state)
		 (literal " ")))
	    
	    (make sequence
	      (process-node-list postcode)))
	  
	  (make element gi: "BR"
		(process-node-list country))
	  
	  (if(node-list-empty? phone)
	     (empty-sosofo)
	     (make paragraph
	       (literal "Phone: ")
	       (process-node-list phone)))
	  
	  (if(node-list-empty? otheraddr)
	     (empty-sosofo)
	     (make element gi: "BR"
		   (literal "Phone: ")
		   (process-node-list otheraddr)))
	  
	  (make paragraph
	    (if(node-list-empty? fax)
	       (empty-sosofo)
	       (make sequence
		 (literal "Fax: ")
		 (process-node-list fax))))
	  
	  (if(node-list-empty? email)
	     (empty-sosofo)
	     (make element gi: "BR"
		   (literal "Email: ")
		   (process-node-list email))) 
	  ))))

) <!--end of mode-->

;;============================
;;Title for Formal Paragraphs
;;============================

;;The way formal paragraphs are displayed by default 
;;is ugly! This makes it a much more useful element!

(element formalpara
  (make element gi: "DIV"
	attributes: (list
		     (list "CLASS" (gi)))
  	(make element gi: "P"
	      (process-children))))

;(element (formalpara title) ($lowtitle$ 5))
(element (formalpara title) 
  (make element gi: "B"
	($runinhead$)))

;;====================
;; General Formatting
;;====================

;; Handle qanda labelling with Q: A:
(define (qanda-defaultlabel)
  (normalize "qanda"))

;;From FreeBSD Sheets (Thanks!) Display Q and A in bigger bolder fonts

(element question
  (let* ((chlist   (children (current-node)))
	 (firstch  (node-list-first chlist))
	 (restch   (node-list-rest chlist)))
    (make element gi: "DIV"
	  attributes: (list (list "CLASS" (gi)))
	  (make element gi: "P" 
		(make element gi: "BIG"
		      (make element gi: "A"
			    attributes: (list
					 (list "NAME" (element-id)))
			    (empty-sosofo))
		      (make element gi: "B"
			    (literal (question-answer-label
				      (current-node)) " ")
			    (process-node-list (children firstch)))))
	  (process-node-list restch))))

</style-specification-body>
</style-specification>
<external-specification id="docbook" document="docbook.dsl">
</style-sheet>
