You can subclass LatexPrinter and define your own _print_Derivative . Here is the current implementation.
Maybe something like
from sympy import Symbol from sympy.printing.latex import LatexPrinter from sympy.core.function import UndefinedFunction class MyLatexPrinter(LatexPrinter): def _print_Derivative(self, expr):
How does it work
>>> MyLatexPrinter().doprint(f(x, y).diff(x, y)) 'f_{xy}' >>> MyLatexPrinter().doprint(Derivative(x, x)) '\\frac{d}{dx} x'
To use it in a Jupyter laptop, use
init_printing(latex_printer=MyLatexPrinter().doprint)
source share