Difference between revisions of "StaticImages"
m |
m |
||
Line 23: | Line 23: | ||
tex_size=>250, extra_html_tags=>'alt="Graph of a function."' ) \} |
tex_size=>250, extra_html_tags=>'alt="Graph of a function."' ) \} |
||
− | \{ imageRow( ["graph1.png","graph2.png"], |
+ | \{ imageRow( ["graph1.png","graph2.png"], |
+ | ["A","B"], width=>250, height=>250, tex_size=>450 ) \} |
||
+ | |||
+ | \{ imageRow( ["g1.png","g2.png","g3.png"], |
||
+ | ["A","B","C"], width=>200, height=>200, tex_size=>310 ) \} |
||
+ | |||
+ | \{ imageRow( ["g1.png","g2.png","g3.png","g4.png"], |
||
+ | ["A","B","C","D"], width=>150, height=>150, tex_size=>200 ) \} |
||
END_TEXT |
END_TEXT |
Revision as of 14:57, 28 January 2010
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=>250, height=>250, tex_size=>450 ) \} \{ imageRow( ["g1.png","g2.png","g3.png"], ["A","B","C"], width=>200, height=>200, tex_size=>310 ) \} \{ imageRow( ["g1.png","g2.png","g3.png","g4.png"], ["A","B","C","D"], width=>150, height=>150, tex_size=>200 ) \} 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.) |