[system] / trunk / pg / macros / PGbasicmacros.pl Repository:
ViewVC logotype

Diff of /trunk/pg/macros/PGbasicmacros.pl

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

Revision 1120 Revision 1155
1339# ($out,$PG_eval_errors,$PG_full_error_report); 1339# ($out,$PG_eval_errors,$PG_full_error_report);
1340#} 1340#}
1341 1341
1342sub math_ev3 { 1342sub math_ev3 {
1343 my $in = shift; 1343 my $in = shift;
1344 $in = FEQ($in);
1345 $in =~ s/%/\\%/g;
1346 return general_math_ev3($in, "inline"); 1344 return general_math_ev3($in, "inline");
1347} 1345}
1348 1346
1349sub display_math_ev3 { 1347sub display_math_ev3 {
1350 my $in = shift; 1348 my $in = shift;
1353 1351
1354sub general_math_ev3 { 1352sub general_math_ev3 {
1355 my $in = shift; 1353 my $in = shift;
1356 my $mode = shift || "inline"; 1354 my $mode = shift || "inline";
1357 1355
1358 $in = FEQ($in); 1356 $in = FEQ($in); # Format EQuations
1359 $in =~ s/%/\\%/g; 1357 $in =~ s/%/\\%/g; # avoid % becoming TeX comments
1360 my $in_delim; 1358
1361 1359 # some modes want the delimiters, some don't
1362 if($mode eq "inline") { 1360 my $in_delim = $mode eq "inline"
1363 $in_delim = "\\($in\\)"; 1361 ? "\\($in\\)"
1364 } else { # assuming displayed math 1362 : "\\[$in\\]";
1365 $in_delim = "\\[$in\\]"; 1363
1366 }
1367
1368 my $out; 1364 my $out;
1369 if($displayMode eq "HTML_tth") { 1365 if($displayMode eq "HTML_tth") {
1370 $out = tth($in_delim); 1366 $out = tth($in_delim);
1371 } elsif ($displayMode eq "HTML_dpng") { 1367 } elsif ($displayMode eq "HTML_dpng") {
1372 $out = $envir{'imagegen'}->add($in_delim); 1368 #$out = $envir{'imagegen'}->add($in_delim);
1369 $out = $envir{'imagegen'}->add($in, $mode);
1373 } elsif ($displayMode eq "HTML_img") { 1370 } elsif ($displayMode eq "HTML_img") {
1374 $out = math2img($in, $mode); 1371 $out = math2img($in, $mode);
1375 } else { 1372 } else {
1376 $out = "\\($in\\)" if $mode eq "inline"; 1373 $out = "\\($in\\)" if $mode eq "inline";
1377 $out = "\\[$in\\]" if $mode eq "display"; 1374 $out = "\\[$in\\]" if $mode eq "display";

Legend:
Removed from v.1120  
changed lines
  Added in v.1155

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9