Re: (dsssl) questions

Subject: Re: (dsssl) questions
From: Ian Castle <ian.castle@xxxxxxxxxxxxxxxxxxx>
Date: 19 Jan 2003 14:55:52 +0000
OK, here is my answer to the various questions.

We want to have a page header that contains

- A logo (graphic image)
- Some text, say a printing date, that changes when the document is
generated rather than being part of the source.
- Have a rule under the header.

The most important thing to note that in a simple-page-sequence we can
only have a single line as the header... and everything in the header
must be an inlined object (rather than a displayed object).

We can have a left-header, a center-header and a right-header though,
which makes things a bit easier.

So our header is going to consist of

- Literal text (for the printing date)
- A rule (for the rule)
- An external-graphic (for the logo).

Each of these objects can be inlined.

The literal text is naturally inlined
The rule can be made inline with the 'escapement value of the
orientation attribute
The external-graphic can be made inline by setting the display?
attribute to be #f (false).

It is a good idea if we draw the horizontal rule after all the other
objects have been drawn. This is accomplished with the "layer"
attribute. Objects are rendered to the output in order of "layer",
starting at zero. So, for a given area, an object with layer 1 will be
rendered after all the ones with a layer 0.

I'll assume that you are using openjade 1.3.2, TeX backend and with
pdfjadetex 3.12. The TeX stuff is a bit fussy, so seemingly subtle
changes in the DSSSL can produce quite alarming results... but the stuff
below seems reasonably stable ;-).

To cope with the idiosyncracies of pdfjadetex I'm going to put the
literal text and the rule as the left header - rather than, say, literal
text as the left and the rule as the center. The graphic will be on the
right header.

Here goes:

Firstly, we will set up a simple page sequence

--------------------------------------------------------
;; Here is some DSSSL

(root
        (make simple-page-sequence
                page-width:     8.5in
                page-height:    11in
                top-margin:     1.75in
                bottom-margin:  .75in
                left-margin:    1in
                right-margin:   .5in
                font-size:      12pt
                header-margin:  0.25in
;; That is the obvious stuff needed for the example - now to the right
header. This is straight forward
;; I'm using the Apache powered-by logo, because it came to hand and it
;; is fairly ubiquitous and I don't think anyone will mind if I use
;; it...

                right-header:   ( make external-graphic
;;
;; The logo is a bit big for a line of 12pt text, so we will shrink it
                                      scale:  0.5
;;
;; This is the file name in the current directory
                                      entity-system-id: "apache_pb.png"
;; And it is a PNG file
                                      notation-system-id: "PNG"
;; Make sure it is inlined (this is the default, but it is good to be 
;; explicit)
                                      display?:       #f
;;
;; This is probably only needed to make it look nice with
;; openjade/pdfjadetex.. but without this it comes out
;; a bit low.
                                      position-point-y: -12pt
                                )

;;
;; OK, now for the left-header. This is going to include the
;; rule and the literal text

;; As Jany suggested, we are going to use a variable to
;; store the text we wish to render. This can be
;; passed in on the command line to openjade

;; The left-header is a single sosofo - so we need to join our
;; literal text with the rule as a single sequence.

                left-header:    ( make sequence
;;
;; Now for some literal text
;;
                                        ( literal %header-date% )
;;
;; Now for the rule
                                        ( make rule
;;
;; Escapement makes it an inlined object.
                                                orientation: 'escapement
;;
;; Length is page size less our left and right margins.
                                                length: 7in
;;
;; Render it after all the other things in the header have been
;; rendered.
                                                layer: 1
                                        )
                                 )
;; Finish things off

                (process-children)))

------------------------------------------------------------

You can access all the files necessary to build the example, and some
instructions at

http://openjade.coldcomfortfarm.net/


On Thu, 2003-01-16 at 15:18, pividal@xxxxxxx wrote:
> im using a .dsl  ... im makinng an article and have somequestions
> 
> -how do i put 2 lines in headers
> (examples)
> 
> my
> title
> 
> 
> -how do i put and image in the header (i know that its with external but
> i dont know the exact code
> 
> -can i put an automatic date??? in any part of the article??
> 
>  
> 
> 
>  DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist



 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist

Current Thread