Better way to eliminate superfluous parentheses in fractions

This commit is contained in:
fiedorow 2004-02-21 01:11:00 +00:00
parent ba90d6d0d4
commit f20e195fa4

View file

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