OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]

Subject: Re: DOCBOOK-APPS: How to do floating images

Rick Bronson wrote:

> Hi,
>   I've combed the mailing list and haven't found a way to do floating
> images on either print or html.  I'm using Docbook 4.1, dsssl-1.71,
> jadetex version 3.3.1
>   Anyone figured it out?
> [snip]
>   Rick

I wrote a message some time ago about it. I use the similar mechanism that
$admonition, but I add a "position-point-y:" stament to get the image
vertically shifted.

What I do is use a Docbook Tag: <blockquote role="graphdesc">. Then I use:

<blockdata><graphic ...></graphic><para>...</para>

The <para> get around the graphic.

This is the DSSSL code:

(define ($block-graph$ #!optional (nd (current-node)) (display #f))
  (let* ((fileref   (attribute-string (normalize "fileref") nd))
  (entityref (attribute-string (normalize "entityref") nd))
  (format    (if (attribute-string (normalize "format") nd)
   (attribute-string (normalize "format") nd)
   (if entityref
       (entity-notation entityref)
  (para-nd (node-list-first (select-elements (children (current-node))
(normalize "para"))))
  ;; (para-nd (select-elements (children (current-node)) (normalize
  (txt (children para-nd))
  (height    (measurement-to-length (attribute-string "depth" nd)))
  (width     (measurement-to-length (attribute-string "width" nd)))
  (finalfileref ( if fileref fileref
       (if entityref entityref "")))
  (graphic (make external-graphic
    display?: #f
    ;; position-point-y: (-(+ %bf-size% height))
    position-point-y: (- %bf-size% height)
    entity-system-id: (graphic-file fileref))))
    (if finalfileref
 (make display-group
   space-before: %para-sep%
   space-after: %para-sep%
   start-indent: (+ (+ (inherited-start-indent) width) %graphdesc-margin%)
   font-family-name: %body-font-family%
   font-size: %bf-size%
   (make display-group
     space-after: %para-sep%
     (make paragraph
       first-line-start-indent: (- (+ width %graphdesc-margin%) )
       (make line-field
  field-width: (+ width %graphdesc-margin%)
       (process-node-list txt))))

(element blockquote
  (let* ((nlg (select-elements (children (current-node)) (normalize
  ( isgraph? ( and
         (equal? (attribute-string "role") "graphdesc")
         (not (node-list-empty? nlg)))))
    (if isgraph?
 ($block-graph$ (node-list-first nlg))
 (make paragraph
   font-size: (* %bf-size% %smaller-size-factor%)
   line-spacing: (* %bf-size% %line-spacing-factor%
   space-before: %para-sep%
   start-indent: (+ (inherited-start-indent) 1em)
   end-indent: 1em
;; ====================================================================

You can extend it to allow several <para>. To do so, you must play with the

inherited-indent propiety and treat <para> in an special way when it occurs

inside those <blockquote>.
(I haventītried this last option but Iīm sure it can be done).

Hope this help.

P.D: This is for PRINTED output. I think HTML may be fairly easier.

Juan R. Migoya

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]

Powered by eList eXpress LLC