# Ticket #4202(closed enhancement: fixed)

Opened 5 years ago

## [with patch, positive review] latex derivatives of symbolic functions nicely

Reported by: Owned by: jason burcin major sage-3.1.3 calculus

### Description

This patch makes it so that symbolic functions attempt to call maxima to get a latex representation before printing out the default functionname(arguments) notation.

Here is some Sage code that did derivative printing. I post it here since this code tries to intelligently print partials versus total derivatives, while maxima's seems to only print total derivative "d"s. If there is interest, we can include this as part of the _latex_ function.

        if self._f._name == 'diff':
if len(self._args[0].variables())==1:
d_latex = "d"
else:
d_latex = "\\partial"

variables = [(self._args[2*i+1]._latex_(), self._args[2*i+2])
for i in xrange((len(self._args)-1)/2)]
variables_latex = ''.join([d_latex+var if power==1 else d_latex+var+"^%r"%power
for var,power in variables])

order = sum([power for var,power in variables])
if order == 1:
order_latex = ""
else:
order_latex = "^%r"%order

return "\\frac{%s%s}{%s}(%s)"%(d_latex,
order_latex,
variables_latex,
self._args[0]._latex_())


## Change History

### comment:1 Changed 5 years ago by mhansen

• Summary changed from latex derivatives of symbolic functions nicely to [with patch, positive review] latex derivatives of symbolic functions nicely

Nice job. Looks good to me.

### comment:2 Changed 5 years ago by mabshoff

• Status changed from new to closed
• Resolution set to fixed

Merged in Sage 3.1.3.alpha2

Note: See TracTickets for help on using tickets.