Images are defined by the means of the image
function
prototype |
(image :file [:ident] [:class] [:url] [:width] [:height] [:zoom] comment ) |
ident | html latex xml | The node identifier. |
class | html latex xml | The node class. |
file | html latex | The file where the image is stored on the disk
(see image path).
The image is converted
(see convert-image ) into a format
supported by the engine. This option is exclusive
with the url option. |
url | html latex | The URL of the file. This option is exclusive with the
file option. |
width | html latex | The width of the image. It may be an integer for a pixel
size or a floating point number for a percentage. |
height | html latex | The height of the image. It may be an integer for a
pixel size or a floating point number for a
percentage. |
zoom | latex | A zoom factor. |
comment | A text describing the image. |
skribe-image-path convert-image |
Example:
(image :file "linux.gif" "A first image")
(image :height 50 :file "linux.gif" "A smaller one")
(image :file "bsd.gif" "A second image")
(image :width 50 :file "bsd.gif")
(image :width 200 :height 40 :file "bsd.gif")
|
|
Ex. 15: The image markup
Produces:
Images are unfortunately unportable. The various Skribe output
formats support different image formats. For instance, HTML supports
gif
and jpeg
while the LaTeX back-end only supports
ps
. Skribe tries, only when needed, to automatically
convert images to a format supported by the target
to be produced. For this, it uses external tools. The default Skribe
translation scheme is:
- Do not translate an image that needs no conversion.
- Uses the
fig2dev
external tool to translate
Xfig
images.
- Uses the
convert
external tools to translate all
other formats.
Engines support different image
formats. Each engine may specify a converter to be applied to an image.
The engine custom image-format
specifies the list of supported
image formats. This list is composed of a suffix such as jpeg
or
gif
.
The function convert-image
tries to convert an
image according to a list of formats. All the specified formats are
successively tried. On the first success, the function convert-image
returns the name of the new converted image. On failure, it returns
#f
.
prototype |
(convert-image file formats ) |
file | The image file to be converted. The file is
searched in the skribe-image-pathimage path. |
formats | A list of formats into which images are converted to. |
skribe-image-path |