%freebsd.l10n; %freebsd.l10n-common; ]]> ]> (declare-flow-object-class formatting-instruction "UNREGISTERED::James Clark//Flow Object Class::formatting-instruction") "))) (element filename (pathwrap)) (element varname (pathwrap)) ]]> (string-length url) 15) (string=? (substring url 0 16) "file://localhost")) (substring url 16 (string-length url)) url)) (element (primaryie ulink) (indexentry-link (current-node))) (element (secondaryie ulink) (indexentry-link (current-node))) (element (tertiaryie ulink) (indexentry-link (current-node))) ;; Override the count-footnote? definition from dbblock.dsl ;; to fix a bug. Basically, the original procedure would count ;; all ulink elements when doing %footnote-ulinks%. It's ;; actually harder than that, because ulink elements with no ;; content shouldn't generate footnotes (the ulink element ;; definition just inserts the url attribute in-line, thus there ;; is no need for a footnote with the url). So, when we figure ;; out which footnotes to count for the purpose of determining ;; footnote numbers, we only count the ulink elements containing ;; content. (define (count-footnote? footnote) ;; don't count footnotes in comments (unless you're showing comments) ;; or footnotes in tables which are handled locally in the table (if (or (and (has-ancestor-member? footnote (list (normalize "comment"))) (not %show-comments%)) (has-ancestor-member? footnote (list (normalize "tgroup"))) (and (has-ancestor-member? footnote (list (normalize "ulink"))) (node-list-empty? (children footnote)))) #f #t)) (element ulink (make sequence (if (node-list-empty? (children (current-node))) (literal (fix-url (attribute-string (normalize "url")))) (make sequence ($charseq$) (if %footnote-ulinks% (if (and (equal? (print-backend) 'tex) bop-footnotes) (make sequence ($ss-seq$ + (literal (footnote-number (current-node)))) (make page-footnote (make paragraph font-size: (* %footnote-size-factor% %bf-size%) font-posture: 'upright quadding: %default-quadding% line-spacing: (* (* %footnote-size-factor% %bf-size%) %line-spacing-factor%) space-before: %para-sep% space-after: %para-sep% start-indent: %footnote-field-width% first-line-start-indent: (- %footnote-field-width%) (make line-field field-width: %footnote-field-width% (literal (footnote-number (current-node)) (gentext-label-title-sep (normalize "footnote")))) (literal (fix-url (attribute-string (normalize "url"))))))) ($ss-seq$ + (literal (footnote-number (current-node))))) (if (and %show-ulinks% (not (equal? (fix-url (attribute-string (normalize "url"))) (data-of (current-node))))) (make sequence (literal " (") (if %hyphenation% (make formatting-instruction data: (string-append "\\url{" (fix-url (attribute-string (normalize "url"))) "}")) (literal (fix-url (attribute-string (normalize "url"))))) (literal ")")) (empty-sosofo))))))) (define (toc-depth nd) (if (string=? (gi nd) (normalize "book")) 3 1)) (element programlisting (if (and (equal? (attribute-string (normalize "role")) "pgpkey") (not withpgpkeys)) (empty-sosofo) (next-match))) (element legalnotice (if (equal? (attribute-string (normalize "role")) "trademarks") (make sequence (process-children)) (next-match))) (define %body-start-indent% 0pi) (define (book-titlepage-verso-elements) (list (normalize "title") (normalize "subtitle") (normalize "corpauthor") (normalize "authorgroup") (normalize "author") (normalize "editor") (normalize "edition") (normalize "pubdate") (normalize "copyright") (normalize "abstract") (normalize "legalnotice") (normalize "revhistory") (normalize "isbn"))) ;; Norm's stylesheets are smart about working out what sort of ;; object to display. But this bites us. Since we know that the ;; first item is going to be displayable, always use that. (define (find-displayable-object objlist notlist extlist) (let loop ((nl objlist)) (if (node-list-empty? nl) (empty-node-list) (let* ((objdata (node-list-filter-by-gi (children (node-list-first nl)) (list (normalize "videodata") (normalize "audiodata") (normalize "imagedata")))) (filename (data-filename objdata)) (extension (file-extension filename)) (notation (attribute-string (normalize "format") objdata))) (node-list-first nl))))) ;; When selecting a filename to use, don't append the default ;; extension, instead, just use the bare filename, and let TeX ;; work it out. jadetex will use the .eps file, while pdfjadetex ;; will use the .png file automatically. (define (graphic-file filename) (let ((ext (file-extension filename))) (if (or tex-backend ;; TeX can work this out itself (not filename) (not %graphic-default-extension%) (member ext %graphic-extensions%)) filename (string-append filename "." %graphic-default-extension%)))) ;; Including bitmaps in the PS and PDF output tends to scale them ;; horribly. The solution is to scale them down by 50%. ;; ;; You could do this with 'imagedata scale="50"' in the source, ;; but that will affect all the output formats that we use (because ;; there is only one 'imagedata' per image). ;; ;; Solution is to have the authors include the "FORMAT" attribute, ;; set to PNG or EPS as appropriate, but to omit the extension. ;; If we're using the tex-backend, and the FORMAT is PNG, and the ;; author hasn't already set a scale, then set scale to 0.5. ;; Otherwise, use the supplied scale, or 1, as appropriate. (define ($graphic$ fileref #!optional (display #f) (format #f) (scale #f) (align #f)) (let* ((graphic-format (if format format "")) (graphic-scale (if scale (/ (string->number scale) 100) (if (and tex-backend (equal? graphic-format "PNG")) 0.5 1))) (graphic-align (cond ((equal? align (normalize "center")) 'center) ((equal? align (normalize "right")) 'end) (else 'start)))) (make external-graphic entity-system-id: (graphic-file fileref) notation-system-id: graphic-format scale: graphic-scale display?: display display-alignment: graphic-align))) ;; Display TeX and LaTeX properly by sending direct formatting ;; commands to the TeX backend. (element application (if (equal? "TeX" (data (current-node))) (make formatting-instruction data: "\\TeX{}") (if (equal? "LaTeX" (data (current-node))) (make formatting-instruction data: "\\LaTeX{}") ($bold-seq$)))) ;; The special FreeBSD version of the trademark tag handling. ;; This function was more or less taken from the DocBook DSSSL ;; stylesheets by Norman Walsh. (element trademark (if (show-tm-symbol? (current-node)) (make sequence ($charseq$) (cond ((equal? (attribute-string "class") (normalize "copyright")) (literal "\copyright-sign;")) ((equal? (attribute-string "class") (normalize "registered")) (literal "\registered-sign;")) ((equal? (attribute-string "class") (normalize "service")) ($ss-seq$ + (literal "SM"))) (else (literal "\trade-mark-sign;")))) ($charseq$))) ;; Make the trademark functions think print output has chunks. (define (chunk-parent nd) (sgml-root-element nd)) ]]>