Thank you very much for the response. Is there any other ways without evaluate=False? What about def _parse_order(cls, order): function? Can I specify a custom order?
On Saturday, January 21, 2023 at 4:36:58 PM UTC+2 Oscar wrote: > On Fri, 13 Jan 2023 at 11:10, Paul Royik <distan...@gmail.com> wrote: > > > > Hello. > > > > Is it possible to render cos ^2 (x)- sin ^2 (x) as "cos ^2 (x)- sin ^2 > (x)", not "- sin ^2 (x)+cos^2(x)"? I want terms with negative sign be last. > > > > I've discovered that there is def _print_Add(self, expr, order=None): > > > > How should order be specified? > > There is an order argument to init_printing but it probably doesn't do > what you want. You can set it to None though and then manually set the > order of the terms in the expression: > > In [13]: init_printing(order='none') > > In [14]: Add(y, x, evaluate=False) > Out[14]: y + x > > -- > Oscar > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/21236835-436f-4333-b754-e95a55cb5e56n%40googlegroups.com.