]> git.mjollnir.org Git - moodle.git/commitdiff
Better way to eliminate superfluous parentheses in fractions
authorfiedorow <fiedorow>
Sat, 21 Feb 2004 01:11:00 +0000 (01:11 +0000)
committerfiedorow <fiedorow>
Sat, 21 Feb 2004 01:11:00 +0000 (01:11 +0000)
filter/algebra/AlgParser.pm

index 3fedb19e16ee2a16ffffd702aee86ca11c2234c1..43982930520ecd8f296a21b25e6c1d0bfccf7833 100755 (executable)
@@ -553,8 +553,10 @@ sub tolatex {
        if ($args[2]->[0] =~ /binop[12]|numberE|unop1/)
       {($p3,$p4)=qw{ \left( \right) };}
     if ($args[0] eq '/'){
-       return('\frac{' . $p1 . $args[1]->tolatex() . $p2 . '}'.
-               '{' . $p3 . $args[2]->tolatex() . $p4 . '}' );
+#      return('\frac{' . $p1 . $args[1]->tolatex() . $p2 . '}'.
+#               '{' . $p3 . $args[2]->tolatex() . $p4 . '}' );
+       return('\frac{' . $args[1]->tolatex() . '}'.
+               '{' . $args[2]->tolatex() . '}' ); 
     }
     else{
     return ($p1 . $args[1]->tolatex() . $p2 . $args[0] . $p3 .