Re: Left/Right alternating headers in Jade

Subject: Re: Left/Right alternating headers in Jade
From: Tony Graham <tgraham@xxxxxxxxxxxxxxxx>
Date: Tue, 11 Nov 1997 11:40:19 -0500 (EST)
At 11 Nov 1997 10:17 -0500, Norman Walsh wrote:
 > The DocBook print stylesheet seems to go to some length to
 > support alternating left/right headers and footers.  The idea is
 > clearly that if two-sided output is desired, then one of the
 > headers should always be "outer" and the other should always be
 > "inner".
 > 
 > But this is pointless, isn't it?  The *-header: and *-footer: 
 > characteristics take as values unlabelled sosofos.  So in the
 > stylesheet
 > 
 >   left-header: (some-complex-left-right-page-function)
 > 
 > "some-complex-left-right-page-function" gets evaluated exactly
 > once for each simple-page-sequence that uses it and the sosofo
 > returned is used as the left header (regardless of whether it's
 > inner or outer) on every subsequent page, right?

In DSSSL, yes; with Jade, no.  See the description for if-front-page
in the "jade.htm" file that comes with the Jade distribution.  While
you're there, also see the description of if-first-page.

Here's an example of how I use if-front-page and if-first-page to
control headers and footers:

(define if-front-page
  (external-procedure "UNREGISTERED::James Clark//Procedure::if-front-page"))

(define if-first-page
  (external-procedure "UNREGISTERED::James Clark//Procedure::if-first-page"))

(define (%chapter-page-sequence% Children page-header-text)
  (let ((footer-company-name
	 (make sequence
	       font-size: %hf-size%
	       line-spacing: %hf-line-spacing%
	       font-posture: 'upright
	       (literal "Mulberry Technologies, Inc.")))
	(footer-page-number
	 (make sequence
	       font-size: %hf-size%
	       line-spacing: %hf-line-spacing%
	       font-posture: 'upright
	       (literal "Page ")
	       (page-number-sosofo)))
	(page-header
	 (make sequence
	       font-size: %hf-size%
	       line-spacing: %hf-line-spacing%
	       font-posture: 'upright
	       page-header-text)))
    (make simple-page-sequence
	  use: page-style
	  left-header: (if-first-page 
			(empty-sosofo)
			(if-front-page (empty-sosofo) page-header))
	  right-header: (if-first-page
			 (empty-sosofo)
			 (if-front-page page-header (empty-sosofo)))
	  left-footer: (if-front-page footer-company-name footer-page-number)
	  right-footer: (if-front-page footer-page-number footer-company-name)
	  input-whitespace-treatment: 'collapse
	  quadding: 'start
	  Children)))

Regards,


Tony Graham
=======================================================================
Tony Graham
Mulberry Technologies, Inc.                         Phone: 301-315-9632
17 West Jefferson Street, Suite 207                 Fax:   301-315-8285
Rockville, MD USA 20850                 email: tgraham@xxxxxxxxxxxxxxxx
=======================================================================


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


Current Thread