[plt-scheme] [scribble] boxing/highlighting in scheme code

From: Eric Tanter (etanter at dcc.uchile.cl)
Date: Fri Apr 30 18:33:19 EDT 2010

Thanks, that's exactly what I'm looking for. well, almost ;)

However code:hilite works fine only with code on a single line: if I use it with multiple lines, it highlights all the white space ahead of the code as well. 

I looked for code:hilite in the docs and couldn't find it. There are a couple of code:... functions there provided by slideshow -- so this reminded me of some nice slideshows where code regions are nicely highlighted (like your talk on macros), but it seems it's done in another manner (ie. note with code:hilite).

Any clue?

Thanks,

-- Éric


On Apr 30, 2010, at 6:23 PM, Matthew Flatt wrote:

> Forms like `schemeblock' recognize `code:hilite' and treat it
> specially:
> 
> @schemeblock[
>  (+ 1 (code:hilite +inf.0))
> ]
> 
> At Fri, 30 Apr 2010 18:18:41 -0400, Eric Tanter wrote:
>> Hi,
>> 
>> Is there a way when typesetting a block of scheme code to insert a box or a 
>> shading/highlighting on a portion of it, in order to attract the attention of 
>> the reader on that portion?
>> 
>> For instance, something like:
>> 
>> @schemeblock[
>> (define (foo x)
>>  (if (null? x) '()
>>      @highlight[
>>      (if (eq? (car x) ...)
>>          ...
>>          ...)
>>      ]))
>> 
>> would highlight the "what-we-do-when-the-arg-is-a-non-empty-list" part of the 
>> code.
>> 
>> Thanks,
>> 
>> -- Éric
>> _________________________________________________
>>  For list-related administrative tasks:
>>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.