[system] / trunk / webwork2 / lib / WeBWorK / PG / ImageGenerator.pm Repository:
ViewVC logotype

Diff of /trunk/webwork2/lib/WeBWorK/PG/ImageGenerator.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1162 Revision 1163
44 44
45=over 45=over
46 46
47=item new 47=item new
48 48
49Returns a new ImageGenerator object. <C%options> must contain the following entries: 49Returns a new ImageGenerator object. <C%options> must contain the following
50entries:
50 51
51 tempDir => directory for storing temporary files (non-web accessible) 52 tempDir => directory in which to create temporary processing directory
52 dir => directory for resulting files 53 dir => directory for resulting files
53 url => url to directory for resulting files 54 url => url to directory for resulting files
54 basename => base name for image files 55 basename => base name for image files
55 latex => path to latex binary 56 latex => path to latex binary
56 dvipng => path to dvipng binary 57 dvipng => path to dvipng binary
68 bless $self, $class; 69 bless $self, $class;
69} 70}
70 71
71=item add($string, $mode) 72=item add($string, $mode)
72 73
73Adds the equation in C<$string> to the object. C<$mode> can be "display" or "inline". If 74Adds the equation in C<$string> to the object. C<$mode> can be "display" or
74not specified, "inline" is assumed. Returns the proper HTML tag for displaying the image. 75"inline". If not specified, "inline" is assumed. Returns the proper HTML tag
76for displaying the image.
75 77
76=cut 78=cut
77 79
78sub add { 80sub add {
79 my ($self, $string, $mode) = @_; 81 my ($self, $string, $mode) = @_;
106 } 108 }
107} 109}
108 110
109=item render(%options) 111=item render(%options)
110 112
111Uses LaTeX and dvipng to render the equations stored in the object. If the key "mtime" in 113Uses LaTeX and dvipng to render the equations stored in the object. If the key
112C<%options> is given, it will be interpreted as a unix date and compared with the 114"mtime" in C<%options> is given, its value will be interpreted as a unix date
113modification date on any existing copy of the first image to be generated. It is 115and compared with the modification date on any existing copy of the first image
114recommended that the modification time of the source file from which the equations 116to be generated. It is recommended that the modification time of the source
115originate be used for this value. If the key "refresh" in C<%options> is true, images 117file from which the equations originate be used for this value. If the key
116will be regenerated regardless of when they were last modified. 118"refresh" in C<%options> is true, images will be regenerated regardless of when
119they were last modified. If neither option is supplied, "refresh" is assumed.
117 120
118=cut 121=cut
119 122
120sub render { 123sub render {
121 my ($self, %options) = @_; 124 my ($self, %options) = @_;

Legend:
Removed from v.1162  
changed lines
  Added in v.1163

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9