Difference between revisions of "StaticImages"
Line 34: | Line 34: | ||
</p> |
</p> |
||
<p> |
<p> |
||
− | We should always, of course, include options such as specifying the <code>tex_size</code>, etc., in this call, as shown in the [[DynamicImages|including dynamic images]] code snippet. Taking the <code>tex_size => "667"</code> and dividing by 10 results in the percentage of the available space used by the graphic -- in this case 66.7 percent. Usually |
+ | We should always, of course, include options such as specifying the <code>tex_size</code>, etc., in this call, as shown in the [[DynamicImages|including dynamic images]] code snippet. Taking the <code>tex_size => "667"</code> and dividing by 10 results in the percentage of the available space used by the graphic -- in this case 66.7 percent. Usually the available space is constrained by the width of one column of a two-column printed page. |
</p> |
</p> |
||
<p> |
<p> |
Revision as of 20:37, 11 February 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=>700, extra_html_tags=>'alt="Graph of a function."' ) \} END_TEXT |
Here it's easy: we just use 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 should always, 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.) |