Subject: Re:Color and font size of cells within a table From: "Jordi Mulet" <jmulet@xxxxxxxxxx> Date: Fri, 13 Mar 1998 20:01:01 +0100 |
Hello ,
Thanks for your answer. We have modified the let syntax and now jade doesn't give us any message....but the formating doesn't work. We have defined a DSSSL color space in our modified style-sheet and we have modified the color of sections and others titles, and also all the color of a table, but we haven't modified the font and color of particular cells. We markup: 1: <entry><?cell-size 4pt><?cell-color red-color> <para> Here the content</para> </entry> with any error but none modifications. 2. <?cell-size 4pt><?cell-color red-color> <entry> <para> Here the content</para> </entry> with an error " 2nd argument with primitive ancestor...." Thanks for your help, Good weekend ! Jordi Editorial Praxis Our modified style-sheet is now: <!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [ <!ENTITY docbook.dsl SYSTEM "docbook.dsl" CDATA DSSSL> <!--<!ENTITY docbook.dsl PUBLIC "-//Norman Walsh//DOCUMENT DocBook Print Stylesheet//EN" CDATA DSSSL>--> ]> <style-sheet> <style-specification id="docbook-plain" use="docbook"> <style-specification-body> ;; $Id: plain.dsl 1.1 1998/02/15 22:38:07 nwalsh Exp $ ;; ;; This file is part of the Modular DocBook Stylesheet distribution. ;; See ../README or http://www.berkshire.net/~norm/dsssl/ ;; ;; Example of a customization layer on top of the modular docbook style ;; sheet. Definitions inserted in this file take precedence over ;; definitions in the 'use'd stylesheet(s). ;******************************************************** ; Definition of color space (define *rgb-color-space* (color-space "ISO/IEC 10179:1996//Color-Space Family::Device RGB")) (define *midnight-blue-color* (color *rgb-color-space* (/ 25 255) (/ 25 255) (/ 112 255))) (define *sea-green-color* (color *rgb-color-space* (/ 46 255) (/ 139 255) (/ 87 255))) (define *red-color* (color *rgb-color-space* (/ 255 255) (/ 0 255) (/ 0 255))) ;*********************************************************** (define %generate-toc% #f) (define %generate-lot-list% '()) (define %generate-titlepage% #f) (define %chapter-autolabel% #f) (define %spacing-paras% #t) ;; per estudiar en diferents browsers.Teniem f (define %default-quadding% 'justify) (define %chap-app-running-heads% #f) (define %chap-app-running-head-autolabel% #f) (define %component-title-quadding% 'center) (define %component-subtitle-quadding% 'center) (define %body-start-indent% 1pi) (define %smaller-size-factor% 0.7) (define %verbatim-size-factor% 0.7) ;; era 0.9 ;; Returns the value of the (?piname value) PI (if one exists) ;; as a child of component, otherwise returns #f ;; (define (pi-value component piname) (let loop ((nl (children component))) (if (node-list-empty? nl) #f (if (and (equal? (node-property 'class-name (node-list-first nl)) 'pi) (> (string-length (node-property 'system-data (node-list-first nl))) (string-length piname)) (equal? piname (substring (node-property 'system-data (node-list-first nl)) 0 (string-length piname)))) (substring (node-property 'system-data (node-list-first nl)) (+ (string-length piname) 1) (string-length (node-property 'system-data (node-list-first nl)))) (loop (node-list-rest nl)))))) (define (inherited-pi-value component piname) (let loop ((value #f) (nd component)) (if (or value (node-list-empty? nd)) value (loop (pi-value nd piname) (parent nd))))) ;*************************************************************** ; These are the definitions of pi-font-size and pi-font-color ;*************************************************************** (define ($pi-font-size$) (let ((fontsize (inherited-pi-value (current-node) "cell-size"))) (if fontsize fontsize #f))) (define ($pi-font-color$) (let ((fontcolor (inherited-pi-value (current-node) "cell-color"))) (if fontcolor fontcolor #f))) ;**************************************************************** ; End of definitions of pi-font-size and pi-font-color ;***************************************************************** ;; This list provides the mapping that would ordinarily be supplied ;; by the element construction rules. If the block element "FOO" ;; occurs inside a table cell, use the $process-foo$ function to ;; process it's _contents_: (define %cell-block-element-list% `(;; ("FOO" . ,$process-foo$) ("PARA" . ,$process-cell-para-contents$) )) ;**************************************************************** ; Here we redefine the code with the help of Norman ;****************************************************************** (define ($process-cell-para-contents$ para colnum align body) (let ((font-name (case body (("THEAD") %title-font-family%) (("TFOOT") %title-font-family%) (else %body-font-family%))) (weight (case body (("THEAD") 'bold) (("TFOOT") 'bold) (else 'medium)))) ;***************************************************** ; lets of fontsize and fontcolor ;***************************************************** (let ((fontsize ($pi-font-size$) ) (fontcolor($pi-font-color$) ) ) ; (%factor% (if %verbatim-size-factor% ; %verbatim-size-factor% ; 1.0))) ) ;***************************************************** ; end of lets ;****************************************************** (make paragraph font-family-name: font-name font-weight: weight ; font-size: (* (inherited-font-size) %factor%) font-size: (if fontsize fontsize (inherited-font-size)) ; font-size: 18pt ;**************************************************************** ; This is commented for de problems with the DSSSL color spaces ; color: (if fontcolor fontcolor (*midnight-blue-color*)) color: *midnight-blue-color* ;***************************************************************** quadding: align (process-node-list (children para) ) ) ) ) ) ; ) ) ;********************************************** ; This is the code for title of section ( modified for the color) ;************************************************* (define ($section-title$) (let* ((sect (current-node)) (info ($section-info$)) (exp-children (if (node-list-empty? info) (empty-node-list) (expand-children (children info) '("BOOKBIBLIO" "BIBLIOMISC" "BIBLIOSET")))) (parent-titles (select-elements (children sect) "TITLE")) (info-titles (select-elements exp-children "TITLE")) (titles (if (node-list-empty? parent-titles) info-titles parent-titles)) (subtitles (select-elements exp-children "SUBTITLE")) (renderas (inherited-attribute-string "renderas" sect)) (hlevel ;; the apparent section level; (if renderas ;; if a rendering is selected ($section-hlevel$ renderas) ;; use it (SECTLEVEL))) ;; else use the real level (hs (HSIZE (- 2 hlevel)))) (make sequence (make paragraph color: *red-color* font-family-name: %title-font-family% font-weight: (if (< hlevel 5) 'bold 'medium) font-posture: (if (< hlevel 5) 'upright 'italic) font-size: hs line-spacing: (* hs %line-spacing-factor%) space-before: (* hs %head-before-factor%) space-after: (if (node-list-empty? subtitles) (* hs %head-after-factor%) 0pt) start-indent: (if (or (>= hlevel 3) (member (gi) '("REFSECT1" "REFSECT2" "REFSECT3"))) %body-start-indent% 0pt) first-line-start-indent: 0pt quadding: %section-title-quadding% keep-with-next?: #t ;; heading-level: (+ hlevel 1) ;; SimpleSects are never AUTO numbered...they aren't hierarchical (if (string=? (element-label (current-node)) "") (empty-sosofo) (literal (element-label (current-node)) (gentext-label-title-sep (gi sect)))) (element-title-sosofo (current-node))) (with-mode section-title-mode (process-node-list subtitles))))) </style-specification-body> </style-specification> <external-specification id="docbook" document="docbook.dsl"> </style-sheet> |
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re:Color and font size of cells wit, Jordi Mulet | Thread | Enhanced Text, Chuck Darney |
RE: The DSSSList Digest V1 #255, WROTH, MARK B | Date | Jade 1.1, Page Pressa |
Month |