[plt-scheme] changing code font size in slideshow

From: Carl Eastlund (carl.eastlund at gmail.com)
Date: Wed Nov 18 15:56:41 EST 2009

See (planet cce/scheme/slideshow), which provides (with-size <size>
<expr>) and (with-scale <factor> <expr>) forms.  See also (planet
cce/scheme/define), which provides (define-with-parameter <name>
<parameter>) for constructing these kinds of macros.

file:///Users/cce/plt/release/planet/4.2.2/cache/cce/scheme.plt/6/0/doc/manual/graphics-section.html#(part._slideshow)
file:///Users/cce/plt/release/planet/4.2.2/cache/cce/scheme.plt/6/0/doc/manual/Macros.html#(part._define)

Carl Eastlund

On Wed, Nov 18, 2009 at 3:44 PM, Noel Welsh <noelwelsh at gmail.com> wrote:
> More idiomatic would be to reverse the arguments, allow multiple
> "code" expressions, and call it with-font-size:
>
> (define-syntax with-font-size
>  (syntax-rules ()
>    [(with-font-size size expr ...)
>      (parameterize
>        ([current-font-size size])
>        expr ...)]))
>
> [Untested]
>
> HTH,
> N.
>
> On Sat, Nov 14, 2009 at 11:05 AM, Aleix Conchillo Flaqué
> <aleix at member.fsf.org> wrote:
>> I have defined this to help changing code size and avoid writing
>> parameterize each time. I'm very newbie, so probably there's a much
>> better way to do it. I used (plai-code) because I'm doing a slides for
>> some PLAI chapters.
>>
>> (define-syntax plai-code
>>  (syntax-rules ()
>>    [(plai-code code) code]
>>    [(plai-code code font-size) (parameterize
>>                                   ([current-font-size font-size]) code)]))
>>
>> (plai-code (code ...))
>> (plai-code (code ...) 26)


Posted on the users mailing list.