From 30733a2b8097e7df764b1a8dbb84e82753f70dc0 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Mon, 14 Mar 2011 09:48:20 -0500 Subject: [PATCH] added pdf-bytes+bounds to the docs for file/convertible and then used it to make scribble render inline picts with a nearly good looking baseline original commit: 615bc86668f237635b9e5b10c94f63ef41d0544b --- collects/scribble/latex-render.rkt | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/collects/scribble/latex-render.rkt b/collects/scribble/latex-render.rkt index 8d18c1cf..3cb9a13f 100644 --- a/collects/scribble/latex-render.rkt +++ b/collects/scribble/latex-render.rkt @@ -250,13 +250,18 @@ [(and (convertible? e) (not (disable-images)) (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)))] + (or (ftag (convert e 'pdf-bytes+bounds) ".pdf") + (ftag (list (convert e 'pdf-bytes) #f #f #f #f) ".pdf") + (ftag (list (convert e 'eps-bytes) #f #f #f #f) ".ps") + (ftag (list (convert e 'png-bytes) #f #f #f #f) ".png")))) + => (lambda (bstr+info+suffix) + (let* ([bstr (list-ref (list-ref bstr+info+suffix 0) 0)] + [suffix (list-ref bstr+info+suffix 1)] + [descent (list-ref (list-ref bstr+info+suffix 0) 3)] + [fn (install-file (format "pict~a" suffix) bstr)]) + (if descent + (printf "\\raisebox{-~apx}{\\includegraphics{~a}}" descent fn) + (printf "\\includegraphics{~a}" fn))))] [else (parameterize ([rendering-tt (or tt? (rendering-tt))]) (super render-content e part ri))]))]