WeBWorKdocs

sq_webwork:


Home
Current UR
courses
Visitor
page
Intro to
WeBWorK
WeBWorK 2
Twiki
WW
Community
Grant Support
& awards
Discussion
group
Problem
library
Write/modify
problems
Create &
manage course
Tutorial on
running a course
HowTos
FAQ
WeBWorK2
FAQ
Software
Download
How to
Install WW server
Feedback
Site Map
Change
preferences
Change
password





Prev | Next | manpages

Description

Takes a relative path to an image file and creates a URL string to the file. In TeX mode it also creates an eps file and links to it.

Syntax

image(image1, options)
image([image1, image2,image3], options)

Params

image1 is the path to the image to be displayed. The path is fed to the "alias" filter first, so the path can be relative to the "tempDirectory" where on-the-fly images are stored; to the course "htmlDirectory" which keeps more permanent images, or it can live the same directory as the source .pg file of the problem itself.
To process more than one image use [image1, image2,....]
Options are key/value pairs as listed below

Options

Option keyOption valueDefault
widthwidth in pixels 100
heightheight in pixels 100
tex_sizescaling factor with 1000 equal to original size 800

Action

In the various HTML modes it creates a string with an <IMG> tag with the url provided by "alias".
In TeX mode it creates a string with a TeX '\includegraphics' macro with a link to the eps file created by "alias".
One text string is created for each image.

Returns

Either an array of strings (each with an image tag or macro) OR the FIRST string in the array, depending on whether it is called in scalar or array context. (It does not return the size of the array when used in scalar context.) The most common usage is the array context.

Examples

*BEGIN_TEXT
\{ image(insertGraph($graph)) \}

END_TEXT
*TEXT(image("pict1.png"))

See Also

The "alias" macro defined in dangerousMacros.pl does much of the work of determining the correct URL for the image file and in directing the creation of an eps file if it is needed.
"images" is an obsolete verb which processes more than one image at a time. Use image([image1, image2,...]) instead.

Macro Definition File

PGbasicmacros.pl

<| Post or View Comments |>


Prev | Next | manpages

Last update: Wednesday, January 10, 2007 at 10:17:29 PM.
This site maintained using Manila and Frontier software.