[plt-scheme] In-line LaTeX in REPL
Mark Engelberg
mark.engelberg at gmail.com
Tue Dec 2 16:32:07 EST 2008
BTW, my code looks like this:
#lang scheme
(require scheme/system)
(require scheme/gui/base)
(define (latex str)
(let ([escaped-str (regexp-replace* #rx" " str "%20")])
(system (format "C:\\temp\\curl
\"http://www.codecogs.com/eq.latex?~a\" -o C:\\temp\\latex.gif"
escaped-str))
(make-object image-snip% "c:\\temp\\latex.gif")))
I keep the curl executable in my temp directory.
So you can do something like (latex "3 \\geq 2") and it will produce
the latex output for that.
While it's downloading the latex gif, the repl displays a read input
box. I'm not sure how to suppress that.
More information about the plt-scheme
mailing list