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

878a2b
878a2b
878a2b
878a2b
    
878a2b
]]>
878a2b
]>
878a2b
878a2b
878a2b
$Id$
878a2b
-->
878a2b
878a2b
<style-sheet>
878a2b
<style-specification id="print" use="docbook">
878a2b
<style-specification-body> 
878a2b
;;======================================
878a2b
;;General Options
878a2b
;;======================================
878a2b
878a2b
;;Do you want to print on both sides of the paper?
878a2b
(define %two-side% 
878a2b
 #t)
878a2b
878a2b
;;Do you want enumerated sections? (E.g, 1.1, 1.1.1, 1.2, etc.)
878a2b
(define %section-autolabel% 
878a2b
 #t)
878a2b
878a2b
;;Show URL links? If the text of the link and the URL are identical,
878a2b
;;the parenthetical URL is suppressed.
878a2b
(define %show-ulinks%
878a2b
 #t)
878a2b
878a2b
;Make Ulinks footnotes to stop bleeding in the edges - this increases
878a2b
;'jade --> print' time tremendously keep this in mind before
878a2b
;complaining!
878a2b
(define %footnote-ulinks%
878a2b
 #t)
878a2b
878a2b
;;Tex Backend on
878a2b
(define tex-backend 
878a2b
 #t)
878a2b
878a2b
;;Define Line Spacing
878a2b
(define %line-spacing-factor% 1.3)
878a2b
878a2b
;;Define the Paragraph Style
878a2b
(define para-style
878a2b
  (style
878a2b
   font-size: %bf-size%
878a2b
   font-weight: 'medium
878a2b
   font-posture: 'upright
878a2b
   font-family-name: %body-font-family%
878a2b
   line-spacing: (* %bf-size% %line-spacing-factor%)))
878a2b
878a2b
(define ($object-titles-after$)
878a2b
  (list (normalize "figure")))
878a2b
878a2b
;;======================================
878a2b
;;Book Options
878a2b
;;======================================
878a2b
878a2b
878a2b
;;Do you want a title page for a Book?
878a2b
(define %generate-book-titlepage%
878a2b
 #t)
878a2b
878a2b
;;Do you want a separate page for the title?
878a2b
(define %generate-book-titlepage-on-separate-page%
878a2b
 #t)
878a2b
878a2b
;;Generate Book TOC?
878a2b
(define %generate-book-toc% 
878a2b
 #t)
878a2b
878a2b
;;What depth should the TOC generate?
878a2b
;;!Only top level of appendixes!
878a2b
(define (toc-depth nd)
878a2b
  (if (string=? (gi nd) (normalize "book"))
878a2b
      3
878a2b
      (if (string=? (gi nd) (normalize "appendix"))
878a2b
        0
878a2b
        1)))
878a2b
878a2b
;;Do you want a TOC for the element part?
878a2b
(define %generate-part-toc% 
878a2b
 #t)
878a2b
878a2b
;;Do you want the part toc on the part titlepage or separate?
878a2b
(define %generate-part-toc-on-titlepage%
878a2b
 #t)
878a2b
878a2b
;;Generate Part Title Page?
878a2b
(define %generate-part-titlepage% 
878a2b
 #t)
878a2b
878a2b
;;Do you want the Part intro on the part title page?
878a2b
(define %generate-partintro-on-titlepage%
878a2b
 #t)
878a2b
878a2b
;;What elements should have a LOT?
878a2b
(define ($generate-book-lot-list$)
878a2b
  (list (normalize "equation")))
878a2b
878a2b
;;Do you want chapters enumerated?
878a2b
(define %chapter-autolabel% 
878a2b
 #t)
878a2b
878a2b
;;Do you want Chapter's and Appendix's 
878a2b
;;to have automatic labels?
878a2b
(define %chap-app-running-head-autolabel% 
878a2b
 #t)
878a2b
878a2b
;;======================================
878a2b
;;Article Options
878a2b
;;======================================
878a2b
878a2b
;;Do you want a title page for an Article?
878a2b
(define %generate-article-titlepage%
878a2b
 #t)
878a2b
878a2b
;;Generate Article TOC?
878a2b
(define %generate-article-toc% 
878a2b
 #t)
878a2b
878a2b
;;Do you want a separate page for the title?
878a2b
(define %generate-article-titlepage-on-separate-page%
878a2b
 #t)
878a2b
878a2b
;;Do you want the article toc on the titlepage or separate?
878a2b
(define %generate-article-toc-on-titlepage%
878a2b
 #t)
878a2b
878a2b
;;Do you want to start new page numbers with each article?
878a2b
(define %article-page-number-restart%
878a2b
 #f)
878a2b
878a2b
;;Titlepage Separate?
878a2b
(define (chunk-skip-first-element-list)
878a2b
  '())
878a2b
878a2b
;;Titlepage Not Separate
878a2b
;(define (chunk-skip-first-element-list)
878a2b
;  (list (normalize "sect1")
878a2b
;	(normalize "section")))
878a2b
878a2b
;;======================================
878a2b
;;Columns
878a2b
;;======================================
878a2b
878a2b
;;How many columns do you want?
878a2b
(define %page-n-columns%
878a2b
 1)
878a2b
878a2b
;;How much space between columns?
878a2b
(define %page-column-sep%
878a2b
 0.2in)
878a2b
878a2b
;;How many Columns on the titlepage?
878a2b
(define %titlepage-n-columns%
878a2b
 1)
878a2b
878a2b
;;Balance columns?
878a2b
(define %page-balance-colums%
878a2b
 #t)
878a2b
878a2b
;;======================================
878a2b
;;Fonts
878a2b
;;======================================
878a2b
878a2b
;;Defines the general size of the text in the document. normal(10),
878a2b
;;presbyopic(12), and large-type(24). 
878a2b
(define %visual-acuity%
878a2b
 "presbyopic")
878a2b
878a2b
;;What font would you like for titles?
878a2b
(define %title-font-family% 
878a2b
  "Helvetica")
878a2b
878a2b
;;What font would you like for the body?
878a2b
(define %body-font-family% 
878a2b
 "Palatino")
878a2b
878a2b
;;What font would you like for mono-seq?
878a2b
(define %mono-font-family% 
878a2b
 "Courier New")
878a2b
878a2b
;;If the base fontsize is 10pt, and '%hsize-bump-factor%' is
878a2b
;; 1.2, hsize 1 is 12pt, hsize 2 is 14.4pt, hsize 3 is 17.28pt, etc
878a2b
(define %hsize-bump-factor% 
878a2b
 1.1)
878a2b
878a2b
;;What size do you want the body fonts?
878a2b
(define %bf-size%
878a2b
 (case %visual-acuity%
878a2b
    (("tiny") 8pt)
878a2b
    (("normal") 10pt)
878a2b
    (("presbyopic") 12pt)
878a2b
    (("large-type") 24pt)))
878a2b
878a2b
(define-unit em %bf-size%)
878a2b
878a2b
;;======================================
878a2b
;;Margins
878a2b
;;======================================
878a2b
878a2b
(define %left-right-margin% 6pi)
878a2b
878a2b
;;How much indentation for the body?
878a2b
(define %body-start-indent% 
878a2b
 0pi)
878a2b
878a2b
;;How big is the left margin? (relative to physical page)
878a2b
(define %left-margin% 
878a2b
 8pi) ;white-paper-column
878a2b
878a2b
;;How big is the right margin? (relative to physical page)
878a2b
(define %right-margin% 
878a2b
 8pi) ;white-paper-column
878a2b
878a2b
;;How big do you want the margin at the top?
878a2b
(define %top-margin%
878a2b
 (if (equal? %visual-acuity% "large-type")
878a2b
      7.5pi
878a2b
      8pi))
878a2b
878a2b
;;How big do you want the margin at the bottom?
878a2b
(define %bottom-margin% 
878a2b
 (if (equal? %visual-acuity% "large-type")
878a2b
      7.5pi 
878a2b
      8pi))
878a2b
878a2b
;;Define the text width. (Change the elements in the formula rather
878a2b
;;than the formula itself)
878a2b
;(define %text-width% (- %page-width% (* %left-right-margin% 2)))
878a2b
(define %text-width%  (- %page-width% (+ %left-margin% %right-margin%)))
878a2b
878a2b
;;Define the body width. (Change the elements in the formula rather
878a2b
;;than the formula itself)
878a2b
(define %body-width% 
878a2b
 (- %text-width% %body-start-indent%))
878a2b
878a2b
;;Define distance between paragraphs
878a2b
(define %para-sep% 
878a2b
 (/ %bf-size% 1.0))
878a2b
878a2b
;;Define distance between block elements (figures, tables, etc.).
878a2b
(define %block-sep% 
878a2b
 (* %para-sep% 1.0))
878a2b
878a2b
;;Indent block elements?
878a2b
(define %block-start-indent% 
878a2b
 0pt)
878a2b
;0pt
878a2b
878a2b
;;======================================
878a2b
;;Admon Graphics
878a2b
;;======================================
878a2b
878a2b
;;Do you want admon graohics on?
878a2b
(define %admon-graphics%
878a2b
 #f)
878a2b
878a2b
;;Where are the admon graphics?
878a2b
(define %admon-graphics-path%
878a2b
 "../images/")
878a2b
878a2b
;;======================================
878a2b
;;Quadding
878a2b
;;======================================
878a2b
878a2b
;;What quadding do you want by default; start, center, justify, or end?
878a2b
(define %default-quadding%
878a2b
 'justify)
878a2b
878a2b
;;What quadding for component titles(Chapter, Appendix, etc)?
878a2b
(define %component-title-quadding% 
878a2b
 'start)
878a2b
878a2b
;;What quadding for section titles?
878a2b
(define %section-title-quadding% 
878a2b
 'start)
878a2b
878a2b
;;What quadding for section sub-titles?
878a2b
(define %section-subtitle-quadding%
878a2b
 'start)
878a2b
878a2b
;;What quadding for article title?
878a2b
(define %article-title-quadding% 
878a2b
 'center)
878a2b
878a2b
;;What quadding for article sub-titles?
878a2b
(define %article-subtitle-quadding%
878a2b
 'center)
878a2b
878a2b
;;What quadding for division subtitles?
878a2b
(define %division-subtitle-quadding% 
878a2b
  'start)
878a2b
878a2b
;;What quadding for component subtitles?
878a2b
(define %component-subtitle-quadding% 
878a2b
  'start)
878a2b
878a2b
;;======================================
878a2b
;;Paper Options
878a2b
;;======================================
878a2b
878a2b
;;What size paper do you need? A4, USletter, USlandscape, or RedHat?
878a2b
(define %paper-type%
878a2b
 "USletter")
878a2b
878a2b
;;Now define those paper types' width
878a2b
(define %page-width%
878a2b
 (case %paper-type%
878a2b
    (("A4") 210mm)
878a2b
    (("USletter") 8.5in)
878a2b
    (("USlandscape") 11in)))
878a2b
878a2b
;;Now define those paper types' height
878a2b
(define %page-height%
878a2b
 (case %paper-type%
878a2b
    (("A4") 297mm)
878a2b
    (("USletter") 11in)
878a2b
    (("USlandscape") 8.5in)))
878a2b
878a2b
;;======================================
878a2b
;;Functions
878a2b
;;======================================
878a2b
878a2b
(define (OLSTEP)
878a2b
  (case
878a2b
   (modulo (length (hierarchical-number-recursive "ORDEREDLIST")) 4)
878a2b
	((1) 1.2em)
878a2b
	((2) 1.2em)
878a2b
	((3) 1.6em)
878a2b
	((0) 1.4em)))
878a2b
878a2b
(define (ILSTEP) 1.0em)
878a2b
878a2b
(define (PROCSTEP ilvl)
878a2b
  (if (> ilvl 1) 1.8em 1.4em))
878a2b
878a2b
(define (PROCWID ilvl)
878a2b
  (if (> ilvl 1) 1.8em 1.4em))
878a2b
878a2b
(define ($comptitle$)
878a2b
  (make paragraph
878a2b
	font-family-name: %title-font-family%
878a2b
	font-weight: 'bold
878a2b
	font-size: (HSIZE 2)
878a2b
	line-spacing: (* (HSIZE 2) %line-spacing-factor%)
878a2b
	space-before: (* (HSIZE 2) %head-before-factor%)
878a2b
	space-after: (* (HSIZE 2) %head-after-factor%)
878a2b
	start-indent: 0pt
878a2b
	first-line-start-indent: 0pt
878a2b
	quadding: 'start
878a2b
	keep-with-next?: #t
878a2b
	(process-children-trim)))
878a2b
878a2b
;;Callouts are confusing in Postscript... fix them.
878a2b
(define %callout-fancy-bug% 
878a2b
 #f)
878a2b
878a2b
;;By default perils are centered and dropped into a box with a really
878a2b
;;big border - I have simply decreased the border thickness -
878a2b
;;unfortunately it takes all this to do it - sigh.
878a2b
(define ($peril$)
878a2b
  (let* ((title     (select-elements 
878a2b
		     (children (current-node)) (normalize "title")))
878a2b
	 (has-title (not (node-list-empty? title)))
878a2b
	 (adm-title (if has-title 
878a2b
			(make sequence
878a2b
			  (with-mode title-sosofo-mode
878a2b
			    (process-node-list (node-list-first title))))
878a2b
			(literal
878a2b
			 (gentext-element-name 
878a2b
			  (current-node)))))
878a2b
	 (hs (HSIZE 2)))
878a2b
  (if %admon-graphics%
878a2b
      ($graphical-admonition$)
878a2b
      (make display-group
878a2b
	space-before: %block-sep%
878a2b
	space-after: %block-sep%
878a2b
	font-family-name: %admon-font-family%
878a2b
	font-size: (- %bf-size% 1pt)
878a2b
	font-weight: 'medium
878a2b
	font-posture: 'upright
878a2b
	line-spacing: (* (- %bf-size% 1pt) %line-spacing-factor%)
878a2b
	(make box
878a2b
	  display?: #t
878a2b
	  box-type: 'border
878a2b
	  line-thickness: .5pt
878a2b
	  start-indent: (+ (inherited-start-indent) (* 2 (ILSTEP)) 2pt)
878a2b
	  end-indent: (inherited-end-indent)
878a2b
	  (make paragraph
878a2b
	    space-before: %para-sep%
878a2b
	    space-after: %para-sep%
878a2b
	    start-indent: 1em
878a2b
	    end-indent: 1em
878a2b
	    font-family-name: %title-font-family%
878a2b
	    font-weight: 'bold
878a2b
	    font-size: hs
878a2b
	    line-spacing: (* hs %line-spacing-factor%)
878a2b
	    quadding: 'center
878a2b
	    keep-with-next?: #t
878a2b
	    adm-title)
878a2b
	  (process-children))))))
878a2b
878a2b
;;======================================
878a2b
;;Non-printing Elements
878a2b
;;======================================
878a2b
(element TITLEABBREV (empty-sosofo))
878a2b
(element SUBTITLE (empty-sosofo))
878a2b
(element SETINFO (empty-sosofo))
878a2b
(element BOOKINFO (empty-sosofo))
878a2b
(element BIBLIOENTRY (empty-sosofo))
878a2b
(element BIBLIOMISC (empty-sosofo))
878a2b
(element BOOKBIBLIO (empty-sosofo))
878a2b
(element SERIESINFO (empty-sosofo))
878a2b
(element DOCINFO (empty-sosofo))
878a2b
(element ARTHEADER (empty-sosofo))
878a2b
;;(element ADDRESS (empty-sosofo))
878a2b
878a2b
;;Show comment element?
878a2b
(define %show-comments%
878a2b
  #t)
878a2b
878a2b
;;======================================
878a2b
;;Formalpara titles
878a2b
;;======================================
878a2b
878a2b
;;Change the way Formal Paragraph titles are displayed. The commented
878a2b
;;out section will run the titles in the paragraphs. 
878a2b
(element (formalpara title)
878a2b
  ;(make sequence
878a2b
  ;font-weight: 'bold
878a2b
  ;($runinhead$))
878a2b
  ($lowtitle$ 5 7))
878a2b
878a2b
;;======================================
878a2b
;;Inlines
878a2b
;;======================================
878a2b
878a2b
(element application ($mono-seq$))
878a2b
(element command ($bold-seq$))
878a2b
(element filename ($mono-seq$))
878a2b
(element function ($mono-seq$))
878a2b
(element guibutton ($bold-seq$))
878a2b
(element guiicon ($bold-seq$))
878a2b
(element guilabel ($italic-seq$))
878a2b
(element guimenu ($bold-seq$))
878a2b
(element guimenuitem ($bold-seq$))
878a2b
(element hardware ($bold-mono-seq$))
878a2b
(element keycap ($bold-seq$))
878a2b
(element literal ($mono-seq$))
878a2b
(element parameter ($italic-mono-seq$))
878a2b
(element prompt ($mono-seq$))
878a2b
(element symbol ($charseq$))
878a2b
(element emphasis ($italic-seq$))
878a2b
878a2b
</style-specification-body>
878a2b
</style-specification>
878a2b
878a2b
<external-specification id="docbook" document="docbook.dsl">
878a2b
878a2b
</style-sheet>