Following up on a suggestion of Mike's, I've developed an extension to PGbasicmacros.pl to enable the display of Latex pictures in dvipng mode (which produces much crisper graphics than the GD library). The new routine is EV4(), whose source I attach below. [I hope it doesn't get munged by the discussion board editor.]
It is used in problems in the following way:
TEXT(EV4(<<'END_TEXT')); begin{picture} .... end{picture} END_TEXT
If we are in dvipng mode, then EV4() evaluates all Perl variables in the text block and then ships the resulting Latex text off to dvipng. Otherwise EV4() calls EV3().
Happy New Year to all, Zig Fiedorowicz
sub EV4{ if ($displayMode eq "HTML_dpng") { my $string = join(" ",@_); my ($evaluated_string,$PG_eval_errors,$PG_full_errors) = PG_restricted_eval("</>/g; $evaluated_string = "\n$string\nend_of_evaluation_string\n");>
$main::PAR % ERROR in $0:EV3, PGbasicmacros.pl: $main::PAR % There is an error occuring in the following code:$main::BR $string $main::BR % $main::BR % $errorLines[0]n % $errorLines[1]$main::BR % $main::BR % $main::BR "; } $string = $evaluated_string;
$string = $envir{'imagegen'}->add($string); $string; } else {EV3(@_);} }
<| Post or View Comments |>
|