Each printer has a method that you can define on your custom classes
that will define how to print your class with that printer. If you
search
http://docs.sympy.org/latest/modules/printing.html for
"printmethod" you will find them. The one for the LaTeX printer is
called _latex. The docs should be improved, but the function signature
is like
def _latex(self, printer, *args)
printer will be the printer object itself. You should use it to
recursively print other objects. For example, if I had a class alpha
that I wanted to print like \alpha \left (x, y\right) I would do
something like
def _latex(self, printer, *args):
return r'\alpha \left (' + ', '.join(printer.doprint(arg for arg
in args) + r'\right )'
If you search the SymPy code for "def _latex" you'll find many examples.
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/524cd627-5aa2-4002-85da-1d960555bf12%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.