SymPy generally doesn't keep track of the order that an input expression
was created in. The best you can get is something like this
latex(sympify('2+x+x**2', evaluate=False), order='none')
The limitation here is that evaluate=False is not generally going to
survive if you call some other function or combine with some other
expression.
Aaron Meurer
On Thu, Feb 11, 2021 at 11:09 AM Michał Pawłowski <
[email protected]> wrote:
> Hi.
>
> I'd like to get LaTeX code of formula, but without simplification or
> expanding. I.E:
>
> formula_1 = '2+x+x**2'
>
> print(latex(expand(formula_1))) <- this works but it sorts the formula
>
> print(latex(???)) -> 2+x+x^{2} #HOW TO GET THIS?
>
> Thanks
> Mike.
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/05e496b0-d426-448e-b0b0-421b177314f5n%40googlegroups.com
> <https://groups.google.com/d/msgid/sympy/05e496b0-d426-448e-b0b0-421b177314f5n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/CAKgW%3D6JDfw9bvUO_XuZtAACaJMSu5VA3kdAVw-%3DYx8N8X0TG_w%40mail.gmail.com.