#4202: latex derivatives of symbolic functions nicely
-------------------------+--------------------------------------------------
Reporter: jason | Owner: burcin
Type: enhancement | Status: new
Priority: major | Milestone: sage-3.1.3
Component: calculus | Keywords:
-------------------------+--------------------------------------------------
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_())
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4202>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---