[plt-scheme] Outline slide with title (slideshow)

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Jun 22 12:54:40 EDT 2004

At Sat, 19 Jun 2004 04:28:14 +0100, Paulo Jorge O. C. Matos wrote:
> >
> > You could set the margin, via `set-margin!', at the beginning when you
> > set your slide assembler. You'll have to outset your assembler pict by
> > as much as you increase the margin.
> >
> As far as I can see there's a problem with that approach since
> setting the margin will create an equal margin all around the
> screen, however I have created in current-slide-assembler a left
> and top margins so I only want to set the left and top margins,
> the others should stay with 20 (default). So, it would be great
> for example to have 20 as default margin for right and bottom and
> 200 for top and left. Can I do this?

One problem that I see now: `set-margin!' is broken. It doesn't set
`client-w' and `client-h' correctly, which means that `page-item', etc.
don't work right.

If `set-margin!' worked, then you'd be able to implement the case
above, but only because the total horizontal margin matches the total
vertical margin. The trick is to set `margin' to be half the left plus
right margin, and then shift the slide in the assembler.

Here's how that would work:

  (module margin (lib "run.ss" "slideshow")

    (define margin-l/t margin)
    (define margin-r/b margin)

    (define (set-asym-margin! l/t r/b)
      ;; Makes `full-page', etc., have the right dimensions
      ;;   --- at least in CVSed 207.1, where `set-margin!' works
      (set-margin! (/ (+ l/t r/b) 2))
      ;; Remember for our assembler:
      (set! margin-l/t l/t)
      (set! margin-r/b r/b))

    (set-asym-margin! 200 20)

     (lambda (title sep content)
       (let* ((titlepic (if title
                            (titlet title)
           (if title sep 0)
            (if title
                (inset full-page
                       0 (- 0 sep (pict-height titlepic))
                       0 0)
          (- margin-l/t margin)
          (- margin-l/t margin)
          (- margin-r/b margin)
          (- margin-r/b margin)))))

     (frame titleless-page)))

But if you wanted the total vertical margin to be larger or smaller
than the total horizontal margin, then we're stuck.

For v299, I'll change Slideshow to support independent margin settings.
(I guess the `margin' variable will be defined as the average margin,
or something like that, for compatibility.)

Another possible solution, which avoids the bug in v207, is to define
your own version of `page-para', `page-item', `full-page', etc., that
use a smaller width than `client-w', and then adjust the content offset
in the assembler roughly as above.


Posted on the users mailing list.