Difference between revisions of "StaticImages"
m |
m |
||
Line 32: | Line 32: | ||
</p> |
</p> |
||
<p> |
<p> |
||
− | The <code>imageRow</code> function works similarly. Its second argument, <code>["A","B"]</code>, is a list of caption names. The double quotes in caption names are necessary to prevent E from being interpreted as 2.718... |
+ | The <code>imageRow</code> function works similarly. Its second argument, <code>["A","B"]</code>, is a list of caption names. The double quotes in caption names are necessary, for example, to prevent the string "E" from being interpreted as E = 2.718... |
</p> |
</p> |
||
<p> |
<p> |
Revision as of 01:27, 26 November 2009
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.
PG problem file | Explanation |
---|---|
BEGIN_TEXT \{ image( "imagename.png" ) \} \{ image( "imagename.png", width=>150, height=>150, tex_size=>250, extra_html_tags=>'alt="Graph of a function."' ) \} \{ imageRow( ["graph1.png","graph2.png"], ["A","B"], width=>150, height=>150 ) \} END_TEXT |
Here it's easy: we just use the
The
For each PG problem with static images, you should put both the PG file and the image files into their own separate subdirectory. This subdirectory should be located somewhere under the course
We can, of course, include options such as specifying the (When the alias() command in dangerousMacros.pl is rewritten in the future, support for JPG, PDF, and SWF files should become available.) |