commit d2293dc223cd2ba1d6c51718258a229294f5ad8a parent 8f876ea446a630e8bc3d5c246aca10a7c8249b20 Author: Matthew Flatt <mflatt@racket-lang.org> Date: Sun, 28 Nov 2010 07:46:23 -0700 Scribble Latex image support (missed an earlier commit) original commit: cc82d3728525b5bac3f2cb91d249d5404a7a3bd0 Diffstat:
| M | collects/scribble/latex-render.rkt | | | 16 | +++++++--------- |
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/collects/scribble/latex-render.rkt b/collects/scribble/latex-render.rkt @@ -249,15 +249,13 @@ (image-element-scale e) fn))] [(and (convertible? e) (not (disable-images)) - (convert e 'pdf-bytes)) - => (lambda (bstr) - (let ([fn (install-file "pict.pdf" bstr)]) - (printf "\\includegraphics{~a}" fn)))] - [(and (convertible? e) - (not (disable-images)) - (convert e 'png-bytes)) - => (lambda (bstr) - (let ([fn (install-file "pict.png" bstr)]) + (let ([ftag (lambda (v suffix) (and v (list v suffix)))]) + (or (ftag (convert e 'pdf-bytes) ".pdf") + (ftag (convert e 'eps-bytes) ".ps") + (ftag (convert e 'png-bytes) ".png")))) + => (lambda (bstr+suffix) + (let ([fn (install-file (format "pict.~a" (cadr bstr+suffix)) + (car bstr+suffix))]) (printf "\\includegraphics{~a}" fn)))] [else (parameterize ([rendering-tt (or tt? (rendering-tt))])