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.
This commit is contained in:
Matthew Flatt 2012-03-27 12:35:01 -06:00
parent 676f744c1d
commit 4735666cd9

View File

@ -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))])