From 1bb78b43fe8edad5a70d8646c7ce4d0b07d2131f Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 27 Mar 2012 12:35:01 -0600 Subject: [PATCH] scribble: for Latex/PDF output, use \makebox for precise pict widths Otherwise, the width of a pict is implicitly rounded up, since the PDF bounding box is an integer. original commit: 4735666cd9a3a5de4e40202b23a9d8da034ef22e --- collects/scribble/latex-render.rkt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/collects/scribble/latex-render.rkt b/collects/scribble/latex-render.rkt index 1cdbda22..caccf925 100644 --- a/collects/scribble/latex-render.rkt +++ b/collects/scribble/latex-render.rkt @@ -301,13 +301,17 @@ => (lambda (bstr+info+suffix) (let* ([bstr (list-ref (list-ref bstr+info+suffix 0) 0)] [suffix (list-ref bstr+info+suffix 1)] + [width (list-ref (list-ref bstr+info+suffix 0) 1)] [height (list-ref (list-ref bstr+info+suffix 0) 2)] [descent (and height (+ (list-ref (list-ref bstr+info+suffix 0) 3) (- (ceiling height) height)))] [fn (install-file (format "pict~a" suffix) bstr)]) (if descent - (printf "\\raisebox{-~apx}{\\includegraphics{~a}}" descent fn) + (printf "\\raisebox{-~apx}{\\makebox[~apx][l]{\\includegraphics{~a}}}" + descent + width + fn) (printf "\\includegraphics{~a}" fn))))] [else (parameterize ([rendering-tt (or tt? (rendering-tt))])