Re: [sympy] Non-reciprocity of "LaTex" and "pprint" printings

2016-04-04 Thread Francesco Bonazzi
On Monday, 4 April 2016 20:04:04 UTC+2, Aaron Meurer wrote: > > You can't render (∫f(x)dx)^2 using the traditional > notation with the integral sign and "dx" without using parentheses. > *precedence_traditional(Integral) ==>* same precedence as *Mul*, which is *lower* than *Pow*, so it gets

Re: [sympy] Non-reciprocity of "LaTex" and "pprint" printings

2016-04-04 Thread Aaron Meurer
Integral should probably have its own precedence, distinct from atom, since setting it to atom seems confusing, given that a rendered integral has many parts (the integral sign, the limits, the integrand, and the differential). It does need to have parentheses precedence such that it gets

Re: [sympy] Non-reciprocity of "LaTex" and "pprint" printings

2016-04-04 Thread Francesco Bonazzi
Maybe we could add a *precedence_traditional* method to the precedence module, that is supposed to provide the precedence according to traditional-styled math representation (e.g. *Integral* in traditional precedence would have the same precedence as *Mul*, not as *atom*). At this point, the

Re: [sympy] Non-reciprocity of "LaTex" and "pprint" printings

2016-04-01 Thread Aaron Meurer
But it's not working well. There are several issues with things that don't get parenthesized correctly (I know you know about these, because you made pull requests to fix them). How many other things are also missing parentheses? It seems to me that any object that the printer doesn't expect that

Re: [sympy] Non-reciprocity of "LaTex" and "pprint" printings

2016-04-01 Thread Francesco Bonazzi
On Thursday, 31 March 2016 17:51:33 UTC+2, Aaron Meurer wrote: > > > I've noticed that the LaTeX printer and the pretty printer have > different methods for computing parenthesization (the LaTeX method > seems to be better). This is likely the cause of this. > *We should unify the two. * >

Re: [sympy] Non-reciprocity of "LaTex" and "pprint" printings

2016-03-31 Thread Aaron Meurer
On Thu, Mar 31, 2016 at 12:34 PM, Francesco Bonazzi wrote: > > > On Thursday, 31 March 2016 17:51:33 UTC+2, Aaron Meurer wrote: >> >> In general, I'd say the two ought to produce the same result, unless >> there is some formatting thing that is not possible to do in

Re: [sympy] Non-reciprocity of "LaTex" and "pprint" printings

2016-03-31 Thread Francesco Bonazzi
On Thursday, 31 March 2016 17:51:33 UTC+2, Aaron Meurer wrote: > > In general, I'd say the two ought to produce the same result, unless > there is some formatting thing that is not possible to do in Unicode > but is in LaTeX. > > I've noticed that the LaTeX printer and the pretty printer have

Re: [sympy] Non-reciprocity of "LaTex" and "pprint" printings

2016-03-31 Thread Aaron Meurer
In general, I'd say the two ought to produce the same result, unless there is some formatting thing that is not possible to do in Unicode but is in LaTeX. I've noticed that the LaTeX printer and the pretty printer have different methods for computing parenthesization (the LaTeX method seems to be

[sympy] Non-reciprocity of "LaTex" and "pprint" printings

2016-03-31 Thread Gaurav Dhingra
Hi, everyone. One general question of `printing` and `latex` >>> init_printing() >>> Derivative(x**2, x) ### 1 d ⎛ 2⎞ ──⎝x ⎠ dx >>> latex(Derivative(x**2, x)) ### 2 \frac{d}{d x} x^{2} Here the `latex` (i.e 2nd) printing is not the corresponding printing of 1st printing using