Blame Scripts/centos-art/Functions/Render/Docbook/Styles/docbook2pdf.dsl

2fa604
2fa604
2fa604
41e747
    
2fa604
]]>
2fa604
]>
2fa604
41e747
41e747
$Id$
2fa604
-->
2fa604
2fa604
<style-sheet>
2fa604
<style-specification id="print" use="docbook">
2fa604
<style-specification-body> 
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% 
3b95a5
 #t)
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%
3b95a5
 #t)
2fa604
2fa604
;;Tex Backend on
2fa604
(define tex-backend 
2fa604
 #t)
2fa604
2fa604
;;Define Line Spacing
3b95a5
(define %line-spacing-factor% 1.3)
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% 
3b95a5
 #t)
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% 
3b95a5
 #t)
2fa604
2fa604
;;Do you want the Part intro on the part title page?
2fa604
(define %generate-partintro-on-titlepage%
3b95a5
 #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% 
3b95a5
 #t)
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%
3b95a5
 1)
2fa604
2fa604
;;Balance columns?
2fa604
(define %page-balance-colums%
3b95a5
 #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%
3b95a5
 "presbyopic")
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% 
3b95a5
 0pi)
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%
3b95a5
 (if (equal? %visual-acuity% "large-type")
2fa604
      7.5pi
3b95a5
      8pi))
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 
3b95a5
      8pi))
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% 
3b95a5
 (/ %bf-size% 1.0))
2fa604
2fa604
;;Define distance between block elements (figures, tables, etc.).
2fa604
(define %block-sep% 
3b95a5
 (* %para-sep% 1.0))
2fa604
2fa604
;;Indent block elements?
2fa604
(define %block-start-indent% 
3b95a5
 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
;;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
(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
;;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
;;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
;;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
<external-specification id="docbook" document="docbook.dsl">
2fa604
2fa604
</style-sheet>