--- loncom/xml/lontexconvert.pm 2005/02/11 16:46:38 1.43 +++ loncom/xml/lontexconvert.pm 2005/02/24 01:21:50 1.44 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # TeX Conversion Module # -# $Id: lontexconvert.pm,v 1.43 2005/02/11 16:46:38 www Exp $ +# $Id: lontexconvert.pm,v 1.44 2005/02/24 01:21:50 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -212,6 +212,26 @@ sub msgtexconverted { } } +sub algebra { + my ($string,$target)=@_; + my $parser = new AlgParserWithImplicitExpand; + my $ret = $parser->parse($string); + my $result='['.&mt('Algebra unconverted due to previous errors').']'; + if ( ref($ret) ) { + $parser->tostring(); + $parser->normalize(); + my $latex=$parser->tolatex(); + $latex='$$'.$latex.'$$'; + if ($target eq 'web' || $target eq 'analyze') { + $result = &converted(\$latex); + } else { + $result = $latex; + } + } else { + &Apache::lonxml::error($parser->{'htmlerror'}); + } +} + 1; __END__