version 1.86, 2008/01/29 11:18:06
|
version 1.90, 2008/11/18 10:02:56
|
Line 113 sub convert_real {
|
Line 113 sub convert_real {
|
# reasonably well to ⇔. If we get many more of these, |
# reasonably well to ⇔. If we get many more of these, |
# we're going to need to have a translation sub. |
# we're going to need to have a translation sub. |
# |
# |
$xmlstring=~s/\\rightleftharpoons/\&\#8660;/g; |
my $lrharpoon = pack("U", 0x21cc); |
|
$xmlstring=~s/\\rightleftharpoons/$lrharpoon/g; |
|
|
&Apache::lonxml::end_alarm(); |
&Apache::lonxml::end_alarm(); |
return ($xmlstring,$errorstring); |
return ($xmlstring,$errorstring); |
Line 218 sub jsMath_converted {
|
Line 219 sub jsMath_converted {
|
|
|
sub tex_engine { |
sub tex_engine { |
if (exists($env{'form.texengine'})) { |
if (exists($env{'form.texengine'})) { |
return $env{'form.texengine'}; |
if ($env{'form.texengine'} ne '') { |
|
return $env{'form.texengine'}; |
|
} |
} |
} |
if ($env{'request.course.id'} |
if ($env{'request.course.id'} |
&& exists($env{'course.'.$env{'request.course.id'}.'.texengine'})) { |
&& exists($env{'course.'.$env{'request.course.id'}.'.texengine'})) { |
Line 250 sub mimetex_converted {
|
Line 253 sub mimetex_converted {
|
if ($displaystyle) { |
if ($displaystyle) { |
$$texstring='\\displaystyle \\Large '.$$texstring; |
$$texstring='\\displaystyle \\Large '.$$texstring; |
} |
} |
my $result='<img src="/cgi-bin/mimetex.cgi?'.&escape($$texstring).'" />'; |
my $result='<img src="/cgi-bin/mimetex.cgi?'.&escape($$texstring).'" alt="$'.$$texstring.'$" />'; |
if ($displaystyle) { |
if ($displaystyle) { |
$result='<center>'.$result.'</center>'; |
$result='<center>'.$result.'</center>'; |
} |
} |
Line 350 sub msgtexconverted {
|
Line 353 sub msgtexconverted {
|
sub algebra { |
sub algebra { |
use AlgParser; |
use AlgParser; |
|
|
my ($string,$target,$style)=@_; |
my ($string,$target,$style,$parstack,$safeeval)=@_; |
my $parser = new AlgParserWithImplicitExpand; |
my $parser = new AlgParserWithImplicitExpand; |
$string=&prepare_algebra($string); |
$string=&prepare_algebra($string); |
my $ret = $parser->parse($string); |
my $ret = $parser->parse($string); |
Line 367 sub algebra {
|
Line 370 sub algebra {
|
$latex='\\ensuremath{'.$latex.'}'; |
$latex='\\ensuremath{'.$latex.'}'; |
} |
} |
if ($target eq 'web' || $target eq 'analyze') { |
if ($target eq 'web' || $target eq 'analyze') { |
$result = &converted(\$latex); |
my $display=&Apache::lonxml::get_param('display',$parstack,$safeeval); |
|
$result = &converted(\$latex,$display); |
|
# $result = &converted(\$latex); |
} else { |
} else { |
$result = $latex; |
$result = $latex; |
} |
} |