[comp.text.tex] typesetting Scheme code

dorai@tone.rice.edu (Dorai Sitaram) (03/14/91)

In article <4298@skye.ed.ac.uk> jeff@aiai.uucp (Jeff Dalton) writes:
>One of thge main reasons I'd object is that I find the "&" ugly
>and intrusive.  Other conventions such as using upper case or
>different brakctes ([] or {}, say) also suffer from aesthetic
>and practical objections.  However if there were a program that
>produced Algol-style listings, I wouldn't mind if it put macro
>names in bold face along with if, define, etc.
>
>BTW, does anyone out there have such a program?

Yes.

I wrote something called SLaTeX that allows listings of Scheme code in
LaTeX without restricting it to the usual monospace typewriter font
supported by other code typesetters.

I've placed the current version in the titan.rice.edu's anonymous ftp
area: get public/slatex.sh.

SLaTeX decides which tokens should be, say, boldfaced, italicized, or
sansserifed, pretty much along the style of the Little Lisper [1].
(The user can completely control this default decision process, so
much so that he can flip the fonts around, add new fonts, or even do
something silly like make everything come out in typewriter -- i.e.,
turn the program into a no-op.)

I'd been leery of distributing SLaTeX before because of the frequent
updating that it's undergone following the Rice Scheme-and-similar-
language users' lively demands for bells and whistles, e.g.,

o allowing arbitrarily positionable displays, boxed code, in-text code,
	and directly inputing actual Scheme files; 

o getting little pockets of LaTeX text or mathmode into the Scheme
	code, for readable Schemelike pseudocode (useful for
	expository papers and class handouts);

o making it learn automatically that a macro definition implies that
	keyword should henceforth be boldfaced, etc.

At any time, the ftp site will contain the most recent code.  The shar
file contains the Scheme source (Ch*z, but should carry over to other
Schemes with minor changes), a shellscript that piggybacks the
codesetter on to LaTeX, the requisite LaTeX style file, installation
instructions, a manual in LaTeX, a man page, and a copyleft.  The
first 2 sections in the manual suffice for most uses, with fine tuning
being described later.  (The code, as of now, contains more fine
tuning than documented -- I'll update the docs when I next get time.)

This is free(ly distributable) software, and hence no warranty, though
I'll be glad to field bug and other reports.

(Ozan Yigit, does SLaTeX qualify to be included in your Scheme code
repository?)

--d

[1] D.P. Friedman and M. Felleisen, _The Little Lisper_, Science
Research Associates (3e), 1989, and The MIT Press, 1987.