how to let latex to print the factor version of denominator

20 views
Skip to first unread message

chaowen guo

unread,
Jun 20, 2016, 2:53:12 PM6/20/16
to sympy

Hi:

The example is shown above. I want the latex output of x is like that in Out[5], the factor version of denominator. It seems that str and sympy internal representation respect that denominator is factored. How to let sympy.latex to show the factor version of denominator?


Aaron Meurer

unread,
Jun 20, 2016, 3:40:41 PM6/20/16
to sy...@googlegroups.com
It doesn't look like there's an easy way to do this. The only way would be to subclass LatexPrinter and override _print_Mul. The problem is that it uses fraction() to pull out the numerator and denominator, which distributes the 2. 

Can you open an issue for this?  The LaTeX printing should generally match the pretty printing. 

Aaron Meurer

--
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+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/08051972-102c-41a2-bc66-39e16cdbc73c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages