Printing in SymPy (for the Differential Geometry Module)

This week I was doing some interesting refactoring, that brings quite a bit of new possibilities, however I will write about this in the coming days. For now… printing. Most importantly, any suggestions for improvements are very welcomed.

Printing in SymPy is done really easily. You just add a _print_Whatever() method to the printer and your new class is printed in whatever manner you wish.

For the moment I am printing scalar fields just as the name of the coordinate in bold non-italic, vector fields as \partial with the name as a subscript and differentials as a fancy d followed by the name.

First of all the unicode printer:

There are some obvious problems, like the fact that in unicode there is no subscript for \theta or y.

And then the \LaTeX printer:

Now I must find a nice way to print a Point() instance.