Skip to content

Commit

Permalink
Better way to eliminate superfluous parentheses in fractions
Browse files Browse the repository at this point in the history
  • Loading branch information
fiedorow committed Feb 21, 2004
1 parent ba90d6d commit f20e195
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions filter/algebra/AlgParser.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down

0 comments on commit f20e195

Please sign in to comment.