From c39df9872e4e65296f729cd1edc4bb6964d91fa3 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 4 Feb 2009 21:03:28 +0000 Subject: [PATCH] use PDF-based picts in the Latex build of the Quick tutorial; in general, change a .pdf image extension to .png for HTML output; add package-original-identifiers and fix package-exporte-identifiers svn: r13432 original commit: e5756667d67e7c98462656d4c55d1c82eb6753ed --- collects/scribble/html-render.ss | 7 ++++++- collects/scribble/scribble.tex | 2 +- collects/scribblings/scribble/struct.scrbl | 6 +++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/collects/scribble/html-render.ss b/collects/scribble/html-render.ss index 7cc500a2..d140e03e 100644 --- a/collects/scribble/html-render.ss +++ b/collects/scribble/html-render.ss @@ -110,6 +110,11 @@ (with-attributes-assoc raw-style)) null)) +(define (pdf-to-png p) + (if (equal? (filename-extension p) #"pdf") + (path-replace-suffix p #".png") + p)) + #; ; no need for these index-local searches #reader scribble/reader (begin ; easier to format @@ -1002,7 +1007,7 @@ `([width ,(to-num (read-bytes 4 in))] [height ,(to-num (read-bytes 4 in))]) null))))]) - `((img ([src ,(let ([p (install-file src)]) + `((img ([src ,(let ([p (install-file (pdf-to-png src))]) (if (path? p) (url->string (path->url (path->complete-path p))) p))] diff --git a/collects/scribble/scribble.tex b/collects/scribble/scribble.tex index deffa722..54d304a7 100644 --- a/collects/scribble/scribble.tex +++ b/collects/scribble/scribble.tex @@ -1,4 +1,4 @@ -% This is the default prefix for Scribble-generated HTML +% This is the default prefix for Scribble-generated Latex \documentclass{article} diff --git a/collects/scribblings/scribble/struct.scrbl b/collects/scribblings/scribble/struct.scrbl index 63ce1757..f5d65564 100644 --- a/collects/scribblings/scribble/struct.scrbl +++ b/collects/scribblings/scribble/struct.scrbl @@ -669,7 +669,11 @@ Used as a style for an @scheme[element] to inline an image. The @scheme[path->main-collects-relative]. For Latex output, a @filepath{.gif} suffix on @scheme[path] is -replaced with a @filepath{.png} suffix.} +replaced with a @filepath{.png} suffix (because animated GIFs can be +useful in HTML output, but Latex does not support GIFs). For HTML +output, a @filepath{.pdf} suffix on @scheme[path] is replaced with a +@filepath{.png} suffix (because PDF line drawings can be more +appropriate for Latex output, but HTML output needs bitmaps).} @defproc[(block? [v any/c]) boolean?]{