Nice display of integral, sum, product, etc. for Sympy on MS Windows

58 views
Skip to first unread message

Robert Dodier

unread,
Jan 2, 2024, 1:45:13 AM1/2/24
to sympy
Hi, I am working on a nicer terminal display for Maxima based on Unicode characters. I've made some progress and I am hoping to get some info about how Sympy displays stuff which could inform the stuff I'm doing.

On my Ubuntu system, it looks like isympy makes use of Unicode characters for approximating the display of integral, sum, product, etc. in a terminal. E.g. looks like an integral is drawn with TOP_HALF_INTEGRAL, BOTTOM_HALF_INTEGRAL, and INTEGRAL_EXTENSION, and sum and product make use of Unicode drawing characters BOX_DRAWINGS_LIGHT_VERTICAL and so on. That all makes sense to me, I've already arranged something similar.

A Maxima user reports that it is nontrivial to get the font stuff sorted out on MS Windows. Among other problems, he wasn't able to find a font which has a glyph for INTEGRAL_EXTENSION. 

How does Sympy display integrals etc. on MS Windows? Does Sympy run in a command terminal or does it manage the display itself or leave it to a third party (e.g. Jupyter) to handle the display? Does the user have to install certain fonts along with Sympy?

Thanks for any light you can shed on this stuff. I'll be glad to look at the source code if anyone has some pointers.

best,

Robert Dodier

Aaron Meurer

unread,
Jan 2, 2024, 2:05:35 AM1/2/24
to sy...@googlegroups.com
I recommend the font Deja Vu Sans Mono for viewing SymPy Unicode
pretty printed output https://dejavu-fonts.github.io/. It has the
INTEGRAL_EXTENSIOn glyph you mention and it's the only font I know of
that actually renders it correctly. It's free and as far as I know it
should work on Windows.

Of course, you can also just run SymPy in a Jupyter notebook, which
will render output using MathJax, which generally looks better than
the Unicode output, and works on any platform.

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 view this discussion on the web visit https://groups.google.com/d/msgid/sympy/a51ed99a-5a05-4458-b1b7-115281e3cdb1n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages