[plt-scheme] Generating LaTeX source from Scheme

From: Prabhakar Ragde (plragde at uwaterloo.ca)
Date: Wed Dec 8 08:47:00 EST 2004

>My question is, is there a way to generate LaTeX code in a manner
>similar to generating HTML from X-expressions?
>Many thanks for any ideas on how to do this - or other approaches to
>generating HTML and PDF from the same PLT-Scheme code!

For a first course in Scheme I piloted this fall, I wanted to use
Scheme to manage the Web page, as well as create presentation slides,
handouts, and instructor notes from one source. I used Jim Bender's
WebIt! system, defined my own S-expression syntax, and wrote macros to
generate LaTeX, using three different "stylesheets" to control the
transformations into the three different target formats. I didn't
create HTML from the same source, but it wouldn't have been
difficult. Starting from Noel Welsh's Scheme-UK example, each of the
two projects (HTML and LaTeX) took me about a day of work and
represented the first nontrivial Scheme programming I'd ever done. My
code is pretty basic, but I'd be happy to share it with anyone who's

You might also look at Skribe -- I wanted more control than it
provides, but depending on your needs, it might be even easier to get
something working. --PR

Posted on the users mailing list.