Someone recently asked
how can I insert a png image file into a Scribble document?
The scribble manual gives a nice example of using a pict you create yourself:
@; ----------------------------------------
@section[#:tag "pictures"]{Pictures}
Any value that is convertable to an image can be used directly within
a Scribble document. Functions from the @racketmodname[pict]
and @racketmodname[2htdp/image #:indirect] libraries, for example, generate
images. For example,
@sample|{
@(require pict)
This cookie has lost its chocolate chips:
@(colorize (filled-ellipse 40 40) "beige").
}|
renders as
@result{
This cookie has lost its chocolate chips:
@(colorize (filled-ellipse 40 40) "beige").
}
from https://docs.racket-lang.org/scribble/getting-started.html#(part._pictures)
It turns out, adding a .png
is just as easy
@centerline{@image[#:scale 0.7 "example.png"]}
adds the image of DrRacket to the interface essentials page in the DrRacket Guide:
https://docs.racket-lang.org/drracket/interface-essentials.html
A simple example
#lang scribble/base
@title{On the Cookie-Eating Habits of Mice}
If you give a mouse a cookie, he's going to ask for a
glass of milk.
@image[#:scale 0.7 "mouse-2.png"]