]> (define %generate-article-toc% ;; Should a Table of Contents be produced for Articles? #t) (define (toc-depth nd) (if (string=? (gi nd) (normalize "book")) ;; ;; Docbook default is 1 level deep ;; I don't understand "normalize book" but ;; it doesn't seem to affect if we use ;; articles. I changed it to 2 deep. ;; 3 2)) (define %generate-article-titlepage% ;; Should an article title page be produced? #t) (define %titlepage-in-info-order% ;; Place elements on title page in document order? #f) (define preferred-mediaobject-notations (list "PDF" "EPS" "PS" "JPG" "JPEG" "PNG" "linespecific")) (define preferred-mediaobject-extensions (list "pdf" "eps" "ps" "jpg" "jpeg" "png")) (define %graphic-default-extension% ;; REFENTRY graphic-default-extension ;; PURP Default extension for graphic FILEREFs ;; DESC ;; The '%graphic-default-extension%' will be ;; added to the end of all 'fileref' filenames on ;; 'Graphic's if they do not end in one of the ;; '%graphic-extensions%'. Set this to '#f' ;; to turn off this feature. ;; /DESC ;; AUTHOR N/A ;; /REFENTRY ;; #f) "png") (define %graphic-extensions% ;; REFENTRY graphic-extensions ;; PURP List of graphic filename extensions ;; DESC ;; The list of extensions which may appear on a 'fileref' ;; on a 'Graphic' which are indicative of graphic formats. ;; ;; Filenames that end in one of these extensions will not have ;; the '%graphic-default-extension%' added to them. ;; /DESC ;; AUTHOR N/A ;; /REFENTRY '("gif" "jpg" "jpeg" "png" "tif" "tiff" "eps" "epsf" "pdf" "tex")) (define %admon-graphics% ;; Use graphics in admonitions? #t) (define %admon-graphics-path% ;; Path to admonition graphics ;; Sets the path, probably relative to the directory ;; where the HTML files are created, to the admonition ;; graphics. ;; ;; This needs to be "./images/" for tar distributed articles ;; This needs to be "../images/" for tar distributed Newbiedoc book ;; This needs to be "../images/" for individual articles on our website "./images/") (define %callout-graphics% ;; If true, callouts are presented with graphics (e.g., reverse-video ;; circled numbers instead of "(1)", "(2)", etc.). ;; Default graphics are provided in the distribution. #t) (define %callout-graphics-path% ;; Sets the path, probably relative to the directory where the HTML ;; files are created, to the callout graphics. "./images/callouts/") (define %callout-graphics-extension% ;; REFENTRY callout-graphics-extension ;; PURP Extension for callout graphics ;; DESC ;; Sets the extension to use on callout graphics. ;; /DESC ;; AUTHOR N/A ;; /REFENTRY ".png") (define %callout-graphics-number-limit% ;; If '%callout-graphics%' is true, graphics are used to represent ;; callout numbers. The value of '%callout-graphics-number-limit%' is ;; the largest number for which a graphic exists. If the callout number ;; exceeds this limit, the default presentation "(nnn)" will always ;; be used. 10) ;;(define ($admon-graphic$ #!optional (nd (current-node))) ;; ;; Admonition graphic file ;; ;; Given an admonition node, returns the name of the ;; ;; graphic that should be used for that admonition. ;; (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."))))) (define ($admon-graphic$ #!optional (nd (current-node))) ;; Admonition graphic file ;; Given an admonition node, returns the name of the ;; graphic that should be used for that admonition. (cond ((equal? (gi nd) (normalize "tip")) (string-append %admon-graphics-path% "tip." %graphic-default-extension%)) ((equal? (gi nd) (normalize "note")) (string-append %admon-graphics-path% "note." %graphic-default-extension%)) ((equal? (gi nd) (normalize "important")) (string-append %admon-graphics-path% "important." %graphic-default-extension%)) ((equal? (gi nd) (normalize "caution")) (string-append %admon-graphics-path% "caution." %graphic-default-extension%)) ((equal? (gi nd) (normalize "warning")) (string-append %admon-graphics-path% "warning." %graphic-default-extension%)) (else (error (string-append (gi nd) " is not an admonition."))))) (define ($admon-graphic-width$ #!optional (nd (current-node))) "25") (define %number-programlisting-lines% ;; Enumerate lines in a 'ProgramListing'? #t) (define %linenumber-length% ;; Width of line numbers in enumerated environments ;; Line numbers will be padded to %linenumber-length% characters. 0) (define %linenumber-mod% ;; Controls line-number frequency in enumerated environments. ;; Every %linenumber-mod% line will be enumerated. 1) (define %linenumber-padchar% ;; Pad character in line numbers ;; Line numbers will be padded (on the left) with %linenumber-padchar% " ") (define %shade-verbatim% ;; Should verbatim environments be shaded? #t) (define ($shade-verbatim-attr$) ;; Attributes used to create a shaded verbatim environment. (list (list "BORDER" "0") (list "BGCOLOR" "#BBDDFF") (list "WIDTH" ($table-width$)))) (define %section-autolabel% ;; Are sections enumerated? #t) (define %body-attr% ;; What attributes should be hung off of BODY? (list (list "BGCOLOR" "#FFFFFF") (list "TEXT" "#000000") (list "LINK" "#0000FF") (list "VLINK" "#800080") (list "ALINK" "#FF0000"))) (define %stylesheet% ;; Name of the stylesheet to use ;;#f) "ck-style.css") (define %stylesheet-type% ;; The type of the stylesheet to use "text/css") (define %html40% ;; Generate HTML 4.0 #t) (define %use-id-as-filename% ;; Use ID attributes as name for component HTML files? #t) ;;Default extension for filenames? (define %html-ext% ".html") (define nochunks ;; Suppress chunking of output pages ;; If true, the entire source document is formatted ;; as a single HTML document and output on stdout. #t) (define ($table-width$) ;; REFENTRY table-width ;; PURP Calculate table width ;; DESC ;; This function is called to calculate the width of tables that should ;; theoretically be "100%" wide. Unfortunately, in HTML, a 100% width ;; table in a list hangs off the right side of the browser window. (Who's ;; mistake was that!). So this function provides a way to massage ;; the width appropriately. ;; ;; This version is fairly dumb. ;; /DESC ;; AUTHOR N/A ;; /REFENTRY (if (has-ancestor-member? (current-node) '("LISTITEM")) "70%" "95%")) ;; Chris: I have stolen the following from ldp.dsl ;; If you copy this whole part to print.dsl, ;; it will not work for the print versions! ;; (element emphasis ;; make role=strong equate to bold for emphasis tag (if (equal? (attribute-string "role") "strong") (make element gi: "STRONG" (process-children)) (make element gi: "EM" (process-children)))) (define (book-titlepage-recto-elements) ;; elements on a book's titlepage ;; note: added revhistory to the default list ;; note: added othercredit to the default list ;; note: added releaseinfo to the default list ;; note: added publisher to the default list (list (normalize "title") (normalize "subtitle") (normalize "graphic") (normalize "mediaobject") (normalize "corpauthor") (normalize "authorgroup") (normalize "author") (normalize "othercredit") (normalize "releaseinfo") (normalize "publisher") (normalize "editor") (normalize "copyright") (normalize "pubdate") (normalize "revhistory") (normalize "abstract") (normalize "legalnotice"))) (define (article-titlepage-recto-elements) ;; elements on an article's titlepage ;; note: added othercredit to the default list (list (normalize "title") (normalize "subtitle") (normalize "authorgroup") (normalize "author") (normalize "othercredit") (normalize "releaseinfo") (normalize "copyright") (normalize "pubdate") (normalize "revhistory") (normalize "abstract") (normalize "legalnotice"))) (define (process-contrib #!optional (sosofo (process-children))) ;; print out with othercredit information; for translators, etc. (make sequence (make element gi: "SPAN" attributes: (list (list "CLASS" (gi))) (process-children)))) (define (process-othercredit #!optional (sosofo (process-children))) ;; print out othercredit information; for translators, etc. (let ((author-name (author-string)) (author-contrib (select-elements (children (current-node)) (normalize "contrib")))) (make element gi: "P" attributes: (list (list "CLASS" (gi))) (make element gi: "B" (literal author-name) (literal " - ")) (process-node-list author-contrib)))) (mode article-titlepage-recto-mode (element contrib (process-contrib)) (element othercredit (process-othercredit)) ) (mode book-titlepage-recto-mode (element contrib (process-contrib)) (element othercredit (process-othercredit)) ) (define (article-title nd) (let* ((artchild (children nd)) (artheader (select-elements artchild (normalize "artheader"))) (artinfo (select-elements artchild (normalize "articleinfo"))) (ahdr (if (node-list-empty? artheader) artinfo artheader)) (ahtitles (select-elements (children ahdr) (normalize "title"))) (artitles (select-elements artchild (normalize "title"))) (titles (if (node-list-empty? artitles) ahtitles artitles))) (if (node-list-empty? titles) "" (node-list-first titles)))) (mode subtitle-mode ;; do not print subtitle on subsequent pages (element subtitle (empty-sosofo))) ;; Chris: end of theft ;; Mathematics ;; Code taken and adapted from the HTMLMath.dsl file ;; of the DBTeXMath package of Allin Cottrell ;; User-configurable options (define $latexopt$ ;; Option(s) to pass in relation to LaTeX article document class ;; Set to empty string "" for no option "12pt") (define $usepackage$ ;; LaTeX packages to load? ;; Set to empty string "" for no packages ;; Can use, e.g., "mathtime" to use MathTime fonts ;; "mathtime") ;; "amsmath") "") (define $density$ ;; Density specification for equation bitmaps ;; This will be passed to the "convert" program "96x96") ;; End of user-configurable options ;; Mathematics ;; ;; Original of root is in docbook.dsl ;; We only insert the line ;; ;; (process-math) ;; (root (make sequence ; (literal ; (debug (node-property 'gi ; (node-property 'document-element (current-node))))) ;(define (docelem node) ; (node-propety 'document-element ; (node-property 'grove-root node))) (process-children) (process-math) (with-mode manifest (process-children)) (if html-index (with-mode htmlindex (process-children)) (empty-sosofo)))) ;; How to write out an equation into the equation listing file (define (write-eqn nd) (let ((texmath (select-elements (children (current-node)) (normalize "alt"))) (graphic (select-elements (children (current-node)) (normalize "graphic")))) (make element gi: "texequation" attributes: (list (list "fileref" (attribute-string (normalize "fileref") graphic))) (literal (data texmath))))) ;; Special processing mode to extract equations (mode htmlmath (default (let ((infeqns (select-elements (descendants (current-node)) (normalize "informalequation"))) (eqns (select-elements (descendants (current-node)) (normalize "equation"))) (inleqns (select-elements (descendants (current-node)) (normalize "inlineequation")))) (with-mode htmlmath (process-node-list (node-list infeqns eqns inleqns))))) (element equation (write-eqn (current-node))) (element informalequation (write-eqn (current-node))) (element inlineequation (write-eqn (current-node)))) ;; Write equation info to equation-list.sgml (define (process-math) (make entity system-id: "equation-list.sgml" (make element gi: "equation-set" attributes: (list (list "latexopt" $latexopt$) (list "density" $density$) (list "usepackage" $usepackage$)) (with-mode htmlmath (process-children))))) ;; End of Mathematics part ;; RefDB part ;; ;; Taken from the infodir/dsssl/html/docbook-refdb.dsl file of ;; the RefDB package (where infodir is whatever you told ;; ./configure to use during installation of the RefDB package, ;; in my system: /usr/share/refdb). ;; RefDB is Copyright 2003 Markus Hoenicka ;; See http://refdb.sourceforge.net for details. ;;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ;; include common stuff &refdblib; &refdbvar; ;; refdb defines (define fold-multixref ;; REFENTRY fold-multixref ;; PURP Should consecutive numbered citations be folded to a range? ;; DESC ;; Some numeric citation formats demand that consecutive citations be ;; folded into a range. This looks cool in printed media, but it breaks ;; the benefit of a link to each of the cited references. If this ;; value is set to #f, all single citations will be displayed instead ;; with the correct links to the references, regardless of what the ;; citation style suggests. You buy increased functionality by departing ;; from the canonical citation style. ;; /DESC ;; EXAMPLE ;; if fold-multixref is set to #t, a citation of references (1,2,3,4,6) ;; will be formatted as (1-4,6) if the citation style suggests so. If ;; set to #f, it is displayed as is. ;; AUTHOR N/A ;; /REFENTRY #t) (define (refdb-process-inline token) ;; REFENTRY refdb-process-inline ;; PURP process inline elements with refdb formatting instructions ;; DESC ;; uses the command line parameters to apply custom formatting to ;; inline elements ;; ARGS ;; ARG 'token' ;; this is roughly equivalent to an element, but the name of the token ;; stems from the name in the database, not from the DocBook element ;; /ARG ;; /ARGS ;; /DESC ;; EXAMPLE ;; (refdb-process-inline "VOLUMESTYLE") will process the current element ;; and its children with the formatting instructions in the variable ;; VOLUMESTYLE ;; /EXAMPLE ;; /REFENTRY (make sequence (if (refdb-underline? token) (make formatting-instruction data: "<U>") (empty-sosofo)) (if (equal? (refdb-getfontweight token) 'bold) (make formatting-instruction data: "<B>") (empty-sosofo)) (if (equal? (refdb-getfontposture token) 'italic) (make formatting-instruction data: "<I>") (empty-sosofo)) (cond ((equal? (refdb-getsubsup token) "SUB") (make formatting-instruction data: "<SUB>")) ((equal? (refdb-getsubsup token) "SUP") (make formatting-instruction data: "<SUP>")) (else (empty-sosofo))) (process-children) (cond ((equal? (refdb-getsubsup token) "SUB") (make formatting-instruction data: "</SUB>")) ((equal? (refdb-getsubsup token) "SUP") (make formatting-instruction data: "</SUP>")) (else (empty-sosofo))) (if (equal? (refdb-getfontposture token) 'italic) (make formatting-instruction data: "</I>") (empty-sosofo)) (if (equal? (refdb-getfontweight token) 'bold) (make formatting-instruction data: "</B>") (empty-sosofo)) (if (refdb-underline? token) (make formatting-instruction data: "</U>") (empty-sosofo)))) (define (refdb-literal string token) ;; REFENTRY refdb-literal ;; PURP display literal string with refdb formatting instructions ;; DESC ;; uses the command line parameters to apply custom formatting to ;; literals ;; ARGS ;; ARG 'string' ;; the string to print ;; /ARG ;; ARG 'token' ;; this is roughly equivalent to an element, but the name of the token ;; stems from the name in the database, not from the DocBook element ;; /ARG ;; /ARGS ;; /DESC ;; EXAMPLE ;; (refdb-process-inline "VOLUMESTYLE") will process the current element ;; and its children with the formatting instructions in the variable ;; VOLUMESTYLE ;; /EXAMPLE ;; /REFENTRY (make sequence (if (refdb-underline? token) (make formatting-instruction data: "<U>") (empty-sosofo)) (if (equal? (refdb-getfontweight token) 'bold) (make formatting-instruction data: "<B>") (empty-sosofo)) (if (equal? (refdb-getfontposture token) 'italic) (make formatting-instruction data: "<I>") (empty-sosofo)) (cond ((equal? (refdb-getsubsup token) "SUB") (make formatting-instruction data: "<SUB>")) ((equal? (refdb-getsubsup token) "SUP") (make formatting-instruction data: "<SUP>")) (else (empty-sosofo))) (literal string) (cond ((equal? (refdb-getsubsup token) "SUB") (make formatting-instruction data: "</SUB>")) ((equal? (refdb-getsubsup token) "SUP") (make formatting-instruction data: "</SUP>")) (else (empty-sosofo))) (if (equal? (refdb-getfontposture token) 'italic) (make formatting-instruction data: "</I>") (empty-sosofo)) (if (equal? (refdb-getfontweight token) 'bold) (make formatting-instruction data: "</B>") (empty-sosofo)) (if (refdb-underline? token) (make formatting-instruction data: "</U>") (empty-sosofo)))) (define (refdb-getsubsup token) ;; REFENTRY refdb-getsubsup ;; PURP retrieves the font shift (for sub/superscript) ;; DESC ;; determines whether the current element should be displayed ;; as superscript/subscript/normal ;; ARGS ;; ARG 'token' ;; this is roughly equivalent to an element, but the name of the token ;; stems from the name in the database, not from the DocBook element ;; /ARG ;; /ARGS ;; /DESC ;; EXAMPLE ;; (refdb-getsubsup "VOLUMESTYLE") will return "SUB" if we are in a ;; "bibliomixed" element with the role attribute "JOUR" and the variable ;; "JOURVOLUMESTYLE" has the value "SUPER" ;; /EXAMPLE ;; /REFENTRY (let* ((pointshift (refdb-getstyle token))) (cond ((equal? pointshift "SUB") "SUB") ((equal? pointshift "SUPER") "SUP") (else "")))) ;;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ;; docbook overrides: bibliography stuff (define (refdb-bibliography-content) ;; Note that the code below works for both the case where the bibliography ;; has BIBLIODIVs and the case where it doesn't, by the slightly subtle ;; fact that if it does, then allentries will be (empty-node-list). (let* ((allbibcontent (children (current-node))) (prebibcontent (node-list-filter-by-not-gi allbibcontent (list (normalize "biblioentry") (normalize "bibliomixed")))) (allentries (node-list-filter-by-gi allbibcontent (list (normalize "biblioentry") (normalize "bibliomixed")))) (entries (if biblio-filter-used (biblio-filter allentries) allentries))) (make sequence (with-mode refdb-mode (process-node-list prebibcontent)) (if (bibliography-table) (make element gi: "TABLE" attributes: '(("BORDER" "0")) (with-mode refdb-mode (process-node-list entries))) (with-mode refdb-mode (process-node-list entries)))))) (define (refdb-nontable-bibliomixed xreflabel leading-abbrev inline-children) (let* ((has-leading-abbrev? (not (node-list-empty? leading-abbrev)))) (make element gi: "P" attributes: (list (list "CLASS" (gi))) (make empty-element gi: "A" attributes: (list (list "NAME" (attribute-string (normalize "id"))))) (with-mode biblioentry-inline-refdb-mode (process-node-list inline-children))))) (define (refdb-table-bibliomixed xreflabel leading-abbrev inline-children) (let* ((has-leading-abbrev? (not (node-list-empty? leading-abbrev)))) (make element gi: "TR" (make element gi: "TD" attributes: '(("ALIGN" "LEFT") ("VALIGN" "TOP") ("WIDTH" "10%")) (make element gi: "TD" attributes: '(("ALIGN" "LEFT") ("VALIGN" "TOP") ("WIDTH" "90%")) (make empty-element gi: "A" attributes: (list (list "NAME" (attribute-string (normalize "id"))))) (with-mode biblioentry-inline-refdb-mode (process-node-list inline-children))))))) (mode refdb-mode (element bibliomixed (if (equal? (normalize (attribute-string (normalize "role"))) (normalize "multixref")) (empty-sosofo) (let* ((xreflabel (attribute-string (normalize "xreflabel")))) (if (bibliography-table) (refdb-table-bibliomixed xreflabel (empty-node-list) (children(current-node))) (refdb-nontable-bibliomixed xreflabel (empty-node-list) (children (current-node))))))) ) ;; bibliography is the entry point where we fork off the RefDB-specific ;; formatting (element (book bibliography) (let ((title (element-title-sosofo (current-node))) (body (make sequence (make element gi: "A" attributes: (list (list "NAME" (element-id))) (empty-sosofo)) ($component-separator$) ($component-title$) (if (equal? (normalize (attribute-string (normalize "role"))) (normalize "refdb")) (refdb-bibliography-content) (bibliography-content))))) (html-document title body))) (element (article bibliography) (let ((title (element-title-sosofo (current-node))) (body (make sequence (make element gi: "A" attributes: (list (list "NAME" (element-id))) (empty-sosofo)) ($component-separator$) ($component-title$) (if (equal? (normalize (attribute-string (normalize "role"))) (normalize "refdb")) (refdb-bibliography-content) (bibliography-content))))) (html-document title body))) (element bibliography ;; A bibliography that's inside something else...or root (if (sgml-root-element? (current-node)) (let ((title (element-title-sosofo (current-node))) (body (make sequence (make element gi: "A" attributes: (list (list "NAME" (element-id))) (empty-sosofo)) ($component-separator$) ($component-title$) (if (equal? (normalize (attribute-string (normalize "role"))) "REFDB") (refdb-bibliography-content) (bibliography-content))))) (html-document title body)) (let* ((sect (ancestor-member (current-node) (append (section-element-list) (component-element-list)))) (hlevel (+ (SECTLEVEL sect) 1)) (helem (string-append "H" (number->string (+ hlevel 1))))) (make sequence (make element gi: helem (make element gi: "A" attributes: (list (list "NAME" (element-id))) (element-title-sosofo (current-node)))) (if (equal? (normalize (attribute-string (normalize "role"))) (normalize "refdb")) (refdb-bibliography-content) (bibliography-content)))))) (mode biblioentry-inline-refdb-mode (element abbrev (refdb-process-inline "REFNUMBERSTYLE")) (element abstract (refdb-process-inline "ABSTRACTSTYLE")) (element address (refdb-process-inline "ADDRESSSTYLE")) (element affiliation (let ((inline-children (node-list-filter-by-not-gi (children (current-node)) (list (normalize "address"))))) (let loop ((nl inline-children)) (if (node-list-empty? nl) (empty-sosofo) (make sequence (process-node-list (node-list-first nl)) (if (node-list-empty? (node-list-rest nl)) (empty-sosofo) (literal ", ")) (loop (node-list-rest nl))))))) (element artpagenums (make sequence (process-children))) (element author (make sequence (process-children))) (element authorgroup (process-children)) (element authorinitials (make sequence (process-children))) (element (address city) (refdb-process-inline "PUBPLACESTYLE")) (element collab (let* ((nl (children (current-node))) (collabname (node-list-first nl)) (affil (node-list-rest nl))) (make sequence (process-node-list collabname) (if (node-list-empty? affil) (empty-sosofo) (let loop ((nl affil)) (if (node-list-empty? nl) (empty-sosofo) (make sequence (literal ", ") (process-node-list (node-list-first nl)) (loop (node-list-rest nl))))))))) (element (collab collabname) (process-children)) (element confgroup (let ((inline-children (node-list-filter-by-not-gi (children (current-node)) (list (normalize "address"))))) (let loop ((nl inline-children)) (if (node-list-empty? nl) (empty-sosofo) (make sequence (process-node-list (node-list-first nl)) (if (node-list-empty? (node-list-rest nl)) (empty-sosofo) (literal ", ")) (loop (node-list-rest nl))))))) (element contractnum (process-children)) (element contractsponsor (process-children)) (element contrib (process-children)) (element copyright ;; Just print the year(s) (let ((years (select-elements (children (current-node)) (normalize "year")))) (process-node-list years))) (element (copyright year) (make sequence (process-children) (if (not (last-sibling? (current-node))) (literal ", ") (empty-sosofo)))) (element corpauthor (make sequence (process-children))) (element corpname (make sequence (process-children))) (element date (make sequence (process-children))) (element edition (make sequence (process-children))) (element editor (make element gi: "SPAN" attributes: '(("CLASS" "EDITOR")) (if (first-sibling?) (make sequence (literal (gentext-edited-by)) (literal " ")) (empty-sosofo)) (literal (author-list-string)))) (element firstname (let ((relation (normalize (inherited-attribute-string (normalize "relation"))))) (cond ((equal? relation (normalize "author")) (refdb-process-inline "AUTHORLISTSTYLE")) ((equal? relation (normalize "editor")) (refdb-process-inline "EDITORLISTSTYLE")) ((equal? relation (normalize "seditor")) (refdb-process-inline "SEDITORLISTSTYLE")) (else (refdb-process-inline "ALLALISTSTYLE"))))) (element honorific (let ((relation (normalize (inherited-attribute-string (normalize "relation"))))) (cond ((equal? relation (normalize "author")) (refdb-process-inline "AUTHORLISTSTYLE")) ((equal? relation (normalize "editor")) (refdb-process-inline "EDITORLISTSTYLE")) ((equal? relation (normalize "seditor")) (refdb-process-inline "SEDITORLISTSTYLE")) (else (refdb-process-inline "ALLALISTSTYLE"))))) (element invpartnumber (make sequence (process-children))) (element isbn (refdb-process-inline "SERIALSTYLE")) (element issn (refdb-process-inline "SERIALSTYLE")) (element issuenum (refdb-process-inline "ISSUESTYLE")) (element lineage (let ((relation (normalize (inherited-attribute-string (normalize "relation"))))) (cond ((equal? relation (normalize "author")) (refdb-process-inline "AUTHORLISTSTYLE")) ((equal? relation (normalize "editor")) (refdb-process-inline "EDITORLISTSTYLE")) ((equal? relation (normalize "seditor")) (refdb-process-inline "SEDITORLISTSTYLE")) (else (refdb-process-inline "ALLALISTSTYLE"))))) (element orgname (make sequence (process-children))) (element othercredit (make element gi: "SPAN" attributes: '(("CLASS" "OTHERCREDIT")) (literal (author-list-string)))) (element othername (let ((relation (normalize (inherited-attribute-string (normalize "relation"))))) (cond ((equal? relation (normalize "author")) (refdb-process-inline "AUTHORLISTSTYLE")) ((equal? relation (normalize "editor")) (refdb-process-inline "EDITORLISTSTYLE")) ((equal? relation (normalize "seditor")) (refdb-process-inline "SEDITORLISTSTYLE")) (else (refdb-process-inline "ALLALISTSTYLE"))))) (element pagenums (refdb-process-inline "PAGESSTYLE")) (element productname (make sequence ($charseq$) ; this is actually a problem since "trade" is the default value for ; the class attribute. we can put this back in in DocBook 5.0, when ; class becomes #IMPLIED ; (if (equal? (attribute-string "class") (normalize "trade")) ; (dingbat-sosofo "trademark") ; (empty-sosofo)) )) (element productnumber (make sequence (process-children))) (element pubdate (let ((role (normalize (attribute-string (normalize "role"))))) (cond ((equal? role (normalize "primary")) (refdb-process-inline "PUBDATESTYLE")) ((equal? role (normalize "secondary")) (refdb-process-inline "PUBDATESECSTYLE")) (else (refdb-process-inline "PUBDATEALLSTYLE"))))) (element publisher (let ((pubname (select-elements (children (current-node)) (normalize "publishername"))) (cities (select-elements (descendants (current-node)) (normalize "city")))) (make sequence (process-node-list pubname) (if (node-list-empty? cities) (empty-sosofo) (literal ", ")) (process-node-list cities)))) (element publishername (refdb-process-inline "PUBLISHERSTYLE")) (element (publisher address city) (make sequence (process-children) (if (not (last-sibling? (current-node))) (literal ", ") (empty-sosofo)))) (element pubsnumber (make sequence (process-children))) (element releaseinfo (make sequence (process-children))) (element seriesvolnums (make sequence (process-children))) (element subtitle (make element gi: "I" (process-children))) (element surname (let ((relation (normalize (inherited-attribute-string (normalize "relation"))))) (cond ((equal? relation (normalize "author")) (refdb-process-inline "AUTHORLISTSTYLE")) ((equal? relation (normalize "editor")) (refdb-process-inline "EDITORLISTSTYLE")) ((equal? relation (normalize "seditor")) (refdb-process-inline "SEDITORLISTSTYLE")) (else (refdb-process-inline "ALLALISTSTYLE"))))) (element title (make element gi: "I" (process-children))) (element titleabbrev (make sequence (process-children))) (element ulink (let ((target (normalize (attribute-string (normalize "url"))))) (make element gi: "A" attributes: (list (list "HREF" target)) (refdb-process-inline "URLSTYLE")))) (element volumenum (refdb-process-inline "VOLUMESTYLE")) (element (bibliomixed title) (make element gi: "I" (process-children))) (element (bibliomixed subtitle) (make element gi: "I" (process-children))) (element (biblioset title) (let ((rel (normalize (inherited-attribute-string (normalize "relation"))))) (cond ((equal? rel (normalize "article")) (make sequence (literal (gentext-start-quote)) (process-children) (literal (gentext-end-quote)))) (else (make element gi: "I" (process-children)))))) (element (bibliomset title) (let ((rel (normalize (inherited-attribute-string (normalize "relation"))))) (cond ((equal? rel (normalize "article")) (refdb-process-inline "TITLESTYLE")) ((equal? rel (normalize "journal")) (refdb-process-inline "JOURNALNAMESTYLE")) ((equal? rel (normalize "book")) (refdb-process-inline "BOOKTITLESTYLE")) ((equal? rel (normalize "chapter")) (refdb-process-inline "CHAPTITLESTYLE")) (else (make element gi: "B" (process-children)))))) (element bibliomset (let ((role (normalize (attribute-string (normalize "role")))) (relation (normalize (attribute-string (normalize "relation"))))) (cond ((equal? role (normalize "intext")) (empty-sosofo)) ((equal? role (normalize "intextsq")) (empty-sosofo)) ((equal? role (normalize "authoronly")) (empty-sosofo)) ((equal? role (normalize "authoronlysq")) (empty-sosofo)) ((equal? role (normalize "yearonly")) (empty-sosofo)) ((equal? relation (normalize "endtermtarget")) (empty-sosofo)) ((equal? role (normalize "userdef1")) (refdb-process-inline "USERDEF1STYLE")) ((equal? role (normalize "userdef2")) (refdb-process-inline "USERDEF2STYLE")) ((equal? role (normalize "userdef3")) (refdb-process-inline "USERDEF3STYLE")) ((equal? role (normalize "userdef4")) (refdb-process-inline "USERDEF4STYLE")) ((equal? role (normalize "userdef5")) (refdb-process-inline "USERDEF5STYLE")) ((equal? role (normalize "misc1")) (refdb-process-inline "MISC1STYLE")) ((equal? role (normalize "misc2")) (refdb-process-inline "MISC2STYLE")) ((equal? role (normalize "misc3")) (refdb-process-inline "MISC3STYLE")) ((equal? role (normalize "link1")) (refdb-process-inline "LINK1STYLE")) ((equal? role (normalize "link2")) (refdb-process-inline "LINK2STYLE")) ((equal? role (normalize "link3")) (refdb-process-inline "LINK3STYLE")) ((equal? role (normalize "link4")) (refdb-process-inline "LINK4STYLE")) ((equal? role (normalize "notes")) (refdb-process-inline "NOTESSTYLE")) (else (process-children))))) ) ;;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ;; docbook overrides: citation/xref stuff (element citation (if (equal? (normalize (attribute-string (normalize "role"))) (normalize "refdb")) (let ((multixref (node-list-filter-by-attribute-token (children (current-node)) (normalize "role") (normalize "multixref")))) (if fold-multixref (if (node-list-empty? multixref) (with-mode refdb-mode ($charseq$)) (with-mode refdb-mode (process-node-list multixref))) (with-mode refdb-mode ($charseq$)))) (if biblio-citation-check (let* ((bgraphies (select-elements (descendants (sgml-root-element)) (normalize "bibliography"))) (bchildren1 (expand-children bgraphies (list (normalize "bibliography")))) (bchildren2 (expand-children bchildren1 (list (normalize "bibliodiv")))) (bibentries (node-list-filter-by-gi bchildren2 (list (normalize "biblioentry") (normalize "bibliomixed"))))) (let loop ((bibs bibentries)) (if (node-list-empty? bibs) (make sequence (error (string-append "Cannot find citation: " (data (current-node)))) (literal "[") ($charseq$) (literal "]")) (if (citation-matches-target? (current-node) (node-list-first bibs)) (make element gi: "A" attributes: (list (list "HREF" (href-to (node-list-first bibs)))) (literal "[") ($charseq$) (literal "]")) (loop (node-list-rest bibs)))))) (make sequence (literal "[") ($charseq$) (literal "]"))))) (mode refdb-mode (element xref (let* ((endterm (attribute-string (normalize "endterm"))) (multixref (normalize (attribute-string (normalize "role")))) ; we want to link to ID2 if linkend is ID2X or ID2Y or whatever (linkend (if (equal? multixref (normalize "multixref")) (attribute-string (normalize "linkend")) (substring (attribute-string (normalize "linkend")) 0 (- (string-length (attribute-string (normalize "linkend"))) 1)))) (target (element-with-id linkend)) (xreflabel (attribute-string (normalize "linkend")))) (if (and (equal? multixref (normalize "multixref")) (equal? fold-multixref #f)) (empty-sosofo) (if (node-list-empty? target) (error (string-append "XRef LinkEnd to missing ID '" linkend "'")) (if endterm (if (node-list-empty? (element-with-id endterm)) (error (string-append "XRef EndTerm to missing ID '" endterm "'")) (make element gi: "A" attributes: (list (list "HREF" (href-to target))) (process-element-with-id endterm))) (if xreflabel (make element gi: "A" attributes: (list (list "HREF" (href-to target))) (process-element-with-id xreflabel)) (empty-sosofo))))))) (element bibliomset (with-mode biblioentry-inline-refdb-mode (process-children))) ) (mode refdb-xref-endterm-mode (default (refdb-process-inline "REFNUMBERSTYLE"))) ;; End of RefDB part