version 1.56, 2005/02/24 09:58:31
|
version 1.58, 2005/02/24 10:09:32
|
Line 215 sub msgtexconverted {
|
Line 215 sub msgtexconverted {
|
sub algebra { |
sub algebra { |
use AlgParser; |
use AlgParser; |
|
|
my ($string,$target)=@_; |
my ($string,$target,$style)=@_; |
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 225 sub algebra {
|
Line 225 sub algebra {
|
$parser->normalize(); |
$parser->normalize(); |
my $latex=$parser->tolatex(); |
my $latex=$parser->tolatex(); |
$latex=&postprocess_algebra($latex); |
$latex=&postprocess_algebra($latex); |
$latex='$'.$latex.'$'; |
if ($style eq 'display') { |
|
$latex='$$'.$latex.'$$x'; |
|
} else { |
|
$latex='\\ensuremath{'.$latex.'}'; |
|
} |
if ($target eq 'web' || $target eq 'analyze') { |
if ($target eq 'web' || $target eq 'analyze') { |
$result = &converted(\$latex); |
$result = &converted(\$latex); |
} else { |
} else { |
Line 240 sub prepare_algebra {
|
Line 244 sub prepare_algebra {
|
my ($string)=@_; |
my ($string)=@_; |
|
|
# makes the decision about what is a minus sign easier supposedly |
# makes the decision about what is a minus sign easier supposedly |
$string =~ s/([\=\>\<\%\!\#] *)-/$1 zeroplace -/g; |
$string =~ s/(\<\>|\<\=|\>\=[\=\>\<] *)-/$1 zeroplace -/g; |
|
|
return $string; |
return $string; |
} |
} |