Golam Mortuza Hossain wrote: > Hi all, > > I am trying to enhance the support for latex-formatting > of "SymbolicFunctionEvaluation" in Sage. In particular, > when their names match with Greek letters then Sage > should use formatting similar to the formatting of > "SymbolicVariable". > > In Physics, we often use "psi(x)" to denote a wave-function > like > --- > psi(x) = function('psi',x) > --- > > It will make Sage output more intuitive if they are > formatted as Greek letters. > > I have already got it working after adding only few lines > of codes. However, I am facing couple of issues: > > (1) While formatting integral expression, such as > > integrate(phi(x)*psi(x),x) > > Sage seems to bypass the _latex_ representation for > the class "SymbolicFunctionEvaluation" (of phi(x), psi(x)). > > Can anyone give me some hints: where are the latex > representations for "integrate", "diff", .... are defined? > I mean in which file? >
Can you post your patch that makes the functions typeset as greek letters? I was trying to track this down, but the following current behavior inhibits that. sage: latex(function('alpha', x)) {\it alpha}\left(x\right) sage: latex(function('phi', x)) {\it phi}\left(x\right) sage: latex(function('psi', x)) {\it psi}\left(x\right) As a guess, we might be calling out to maxima to latex the integral or derivative, so that might explain where the problem lies. The code would probably be in calculus/, maybe in calculus/calculus.py. I believe http://trac.sagemath.org/sage_trac/ticket/4202 is relevant here. > (2) In the list "common_varnames" (in sage/misc/latex.py) two > letters "Phi" and "phi" are missing. So LaTex formatting > for them doesn't work like other Greek letters (even when they > are defined as "SymbolicVariable"). > Yep, I ran into (2) a while back when doing spherical coordinates. Do you already have a patch to add them? Thanks, Jason --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---