Replies: 2 comments 9 replies
-
I don't see why it wouldn't be accepted. I'm not entirely sure how this works in sympy's printing code but there are tests for when things need brackets in different contexts. I'm not sure if what they do is equivalent to what you are suggesting. I suppose that with LaTeX the application of curly brackets is not as well developed because LaTeX is usually used (in the SymPy context) as an intermediate format. |
Beta Was this translation helpful? Give feedback.
-
The only thing complicates about implementing that is we need to understand the mechanism how braces can be hidden or not. For example, And this is one of the most common mistakes (even among the sympy developers) to typeset the LaTeX in docs. |
Beta Was this translation helpful? Give feedback.
-
I'd like to suggest a
fold_excess_bracing
option for LaTeX printing. I'm using this system with PrairieLearn to test math students and having them add lots of {} around single symbols is not only hard but unnecessary.I.E. When I do
latex(Sum(a[i], (i, k, n)))
I get'\\sum_{i=k}^{n} {a}_{i}'
but the curly braces aroundn
,a
, andi
are all unnecessary. Only the ones around thei=k
are needed. Could there be an option to whittle down the extra bracing?(I teach this issue in expression tree printing in my basic data structures course, so I know it can be done. The question is will this suggestion be accepted...)
Beta Was this translation helpful? Give feedback.
All reactions