[racket] picts in Scribble

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sat Nov 27 09:54:54 EST 2010

In the latest development version:

The `slideshow/pict' library no longer depends on `racket/gui' --- just
`racket/draw', which can be used without a GUI display (e.g., an X

Scribble now renders picts directly for HTML or PDF output. The
document source

 #lang scribble/base
 @(require slideshow/face)



 @(face 'happy "yellow")

 @section{Not So Happy}

 @(face 'unhappy "lightblue")

produces what you'd expect.

More precisely, Scribble renders values that are convertible to PNG
(and optionally PDF format) via the new `file/convertible' protocol.
The protocol is simple, but the indirection keeps Scribble from
depending directly on the pict library or vice versa. Plain `bitmap%'s
are convertible to PNG, too, so a bitmap in a Scribble document renders
as its image.

As an example, the "Quick" document now mostly uses the plain
`interaction' form with an evaluator that has `slideshow/pict' loaded.
In the Slideshow docs, some ASCII art in the description of the pict
datatype has been replaced by a real picture (that is implemented as a
pict, of course).

Posted on the users mailing list.