--- loncom/xml/lontexconvert.pm 2010/04/26 21:36:50 1.102 +++ loncom/xml/lontexconvert.pm 2010/04/27 20:29:20 1.103 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # TeX Conversion Module # -# $Id: lontexconvert.pm,v 1.102 2010/04/26 21:36:50 faziophi Exp $ +# $Id: lontexconvert.pm,v 1.103 2010/04/27 20:29:20 faziophi Exp $ # # Copyright Michigan State University Board of Trustees # @@ -394,15 +394,16 @@ sub msgtexconverted { foreach my $fragment (split(/(?:\<\;|\<)\/*algebra\s*(?:\>\;|\>)/i, $message)) { if ($tex) { + my $algebra = &algebra($fragment, 'web', undef, undef, undef, undef, 'tth'); if ($email) { - $outmessage.=''.&algebra($fragment,'web').'
';
+		$outmessage.='
'.$algebra.'
';
 		$tex=0;
 	    } else {
-		$outmessage.=&algebra($fragment,'web');
+		$outmessage.=$algebra;
 		$tex=0;
 	    }
 	} else {
-            $outmessage.=$fragment;
+        $outmessage.=$fragment;
 	    $tex=1;
 	}
     }
@@ -415,9 +416,9 @@ sub msgtexconverted {
 
 sub algebra {
     use AlgParser;
-    &init_tth();
-    my ($string,$target,$style,$parstack,$safeeval)=@_;
+    my ($string,$target,$style,$parstack,$safeeval,$tth)=@_;
     my $parser = new AlgParserWithImplicitExpand;
+    if ($tth eq 'tth') {&init_tth();}
     $string=&prepare_algebra($string);
     my $ret = $parser->parse($string);
     my $result='['.&mt('Algebra unconverted due to previous errors').']';