ipython notebook - sympy printing

64 views
Skip to first unread message

Denis Akhiyarov

unread,
Nov 13, 2015, 7:16:32 PM11/13/15
to sympy
can I pass mul_symbol='dot' to init_printing? I see that this was asked few years ago but not implemented. The problem is no separation between variables.

Denis Akhiyarov

unread,
Nov 13, 2015, 7:17:31 PM11/13/15
to sympy

Denis Akhiyarov

unread,
Nov 16, 2015, 11:00:57 AM11/16/15
to sympy
3 issues on github seem to be related to this latex printing deficiency:


so this maybe a good starting point to fix this?

Aaron Meurer

unread,
Nov 16, 2015, 3:12:21 PM11/16/15
to sy...@googlegroups.com
init_printing() has an argument latex_printer, so you can do something like

init_printing(latex_printer=lambda *args, **kwargs: latex(*args,
mul_symbol='dot', **kwargs))

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 http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/e84fca0a-6ac7-407b-a2f5-af1f2fbc6a83%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

Denis Akhiyarov

unread,
Nov 16, 2015, 5:22:09 PM11/16/15
to sympy
this works great! Aaron, post your answer on SO, so that I can upvote it.

why is this not default behavior?

Aaron Meurer

unread,
Nov 16, 2015, 5:40:45 PM11/16/15
to sy...@googlegroups.com
I guess the default printing (space for mul) looks cleaner. Since
LaTeX printing can use variable spacing it's feasible to use a space
in this way (contrast this with the monospace Unicode printer, which
uses 'x⋅y' instead of 'x y').

Aaron Meurer
> https://groups.google.com/d/msgid/sympy/73b1d57d-735d-4883-ad12-6c549921107d%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages