StaticImages

From WeBWorK
(Difference between revisions)
Jump to: navigation, search
(New page: <h2>Static Graphic Images: PG Code Snippet</h2> <p style="background-color:#eeeeee;border:black solid 1px;padding:3px;"> <em>This code snippet shows the essential PG code to insert a sta...)
 
Line 1: Line 1:
 
 
<h2>Static Graphic Images: PG Code Snippet</h2>
 
<h2>Static Graphic Images: PG Code Snippet</h2>
  
Line 34: Line 33:
 
[[IndexOfProblemTechniques|Problem Techniques Index]]
 
[[IndexOfProblemTechniques|Problem Techniques Index]]
 
</p>
 
</p>
 +
 +
[[Category:Problem Techniques]]

Revision as of 21:48, 14 February 2008

Static Graphic Images: PG Code Snippet

This code snippet shows the essential PG code to insert a static (pre-generated) graphic image into a problem. Note that these are insertions, not a complete PG file. This code will have to be incorporated into the problem file on which you are working.

Problem Techniques Index

PG problem file Explanation
  BEGIN_TEXT
  \{ image( imagename.png ) \}
  END_TEXT

Here it's easy: we just use the image macro in the text section of the problem to include the image. The image that is to be included should be a common Web format (that is, GIF, PNG, or JPG) file, and should be in the same directory under the course templates directory as is the PG problem file.

We can, of course, include options such as specifying the tex_size, etc., in this call, as shown in the including dynamic images code snippet.

Problem Techniques Index

follow us