3.12 Skribilo User Manual — Images
Contents↑ Standard Markups

Images are defined by the means of the image function

prototype
(image :file [:zoom] [:height] [:width] [:url] [:class] [:ident] comment)
optionenginesdescription
:identhtml lout latex context info xml The node identifier.
:classhtml lout latex context info xml The node class.
:filehtml lout latex context info 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.
:urlhtml lout latex context info The URL of the file. This option is exclusive with the option.
:widthhtml lout latex context info The width of the image. It may be an integer for a pixel size or a floating point number for a percentage.
:heighthtml lout latex context info The height of the image. It may be an integer for a pixel size or a floating point number for a percentage.
:zoomlout latex context A zoom factor.
argumentdescription
commentA text describing the image.
See also
*image-path* convert-image
(image :file "linux.png" "A first image")
(image :height 50 :file "linux.png" "A smaller one")
(image :file "bsd.png" "A second image")
(image :width 50 :file "bsd.png")
(image :width 200 :height 40 :file "bsd.png")
Ex. 17: The image markup

... produces:

A first imageA smaller oneA second image

Files passed as a :file argument to image are searched in the current image path, which is defined by the *image-path* SRFI-39 parameter. This parameter contains a list of directories and its value can be obtained using (*image-path*). Its value can be altered using the -P command-line option of the skribilo compiler (see Chapter 14 for details).

3.12.1 Image formats

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:

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)
argumentdescription
fileThe image file to be converted. The file is searched in the *image-path*image path.
formatsA list of formats into which images are converted to.
See also
*image-path*
(made with skribilo)