commit 649d3e94fed1ea20044f36714915ca25ee81d160
parent f531e51b9074e28629b58b9f5dfce2f603454cb8
Author: Matthew Flatt <mflatt@racket-lang.org>
Date: Wed, 2 Apr 2008 19:16:05 +0000
optional image scale
svn: r9140
original commit: d1ed1a1e52efcd8c0baa17ace233f2572611b4e1
Diffstat:
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/collects/scribble/latex-render.ss b/collects/scribble/latex-render.ss
@@ -163,7 +163,7 @@
#f)]
[(image-file? style)
(let ([fn (install-file (image-file-path style))])
- (printf "\\includegraphics{~a}" fn))]
+ (printf "\\includegraphics[scale=~a]{~a}" (image-file-scale style) fn))]
[else (super render-element e part ri)])))
(when part-label?
(printf "''"))
diff --git a/collects/scribble/manual.ss b/collects/scribble/manual.ss
@@ -257,14 +257,14 @@
;; String String *-> Element
;; an in-lined image, relative to the current directory
- (define (image filename-relative-to-source . alt)
+ (define (image #:scale [scale 1.0] filename-relative-to-source . alt)
(make-element
- (make-image-file filename-relative-to-source)
+ (make-image-file filename-relative-to-source scale)
(decode-content alt)))
(define (image/plain filename-relative-to-source . alt)
(make-element
- (make-image-file filename-relative-to-source)
+ (make-image-file filename-relative-to-source 1.0)
(decode-content alt)))
(define (onscreen . str)
diff --git a/collects/scribble/struct.ss b/collects/scribble/struct.ss
@@ -174,7 +174,8 @@
[target-url ([addr (or/c string? path?)][style any/c])]
[url-anchor ([name string?])]
- [image-file ([path path-string?])])
+ [image-file ([path path-string?]
+ [scale real?])])
;; ----------------------------------------