LaTeX representations of complex expressions involving summations should sometimes include brackets but do not
rjc955 opened this issue · 1 comments
In some cases, when an expression contains a summation applied over a product of several terms, the LaTeX representation of that expression may omit necessary brackets. To reproduce this issue, run this demo notebook down to the cells at the end. Here is a screenshot:
A visual check of the string representations of result_4
and expected_result
shows that they are the same up to a permutation in the order of the terms in the products, and the notebook runs an assert_expr_equal
that verifies the same. But the LaTeX representation of result_4
is misleading in that it appears that, in the numerator for example, the summation
That's a good point. Latex output isn't strictly correct in terms of the math and would benefit from grouping symbols in some places to make it more "correct". We haven't done this since the current output more resembles what people write in the literature. Maybe a ruleset could be made for when grouping symbols increase legibility