Golam Mortuza Hossain wrote:
> Hi,
> 
> On Wed, Mar 25, 2009 at 4:09 PM, Jason Grout
> <jason-s...@creativetrax.com> wrote:
>> Also, I think naming the function is_latex_name or something like that
>> would be better.  common_varnames says nothing to me about the variable
>> name
> 
> Thanks Jason for your suggestions. I have renamed the
> function. Also, I have made some changes to accommodate
> typesetting for more functions.  In _latex_() function
> for "class SymbolicFunctionEvaluation", the new codes are
> ---------------------------------------------------------------------------
>    name = latex_function_name(self._f._name)
>    if name:
>        return "%s\\left(%s\\right)"%(name, ', '.join([latex(x) for x
> in self._args]))
> --------------------------------------------------------------------------
> 

Hmmm...I might be being pedantic here, but I'd probably test "name" a 
little more explicitly:

if name is not False:
     blah...




> "latex_function_name" (In file: "sage/misc/latex.py")  is now
> defined as:
> 
> -------------------------------------------------------------
> def latex_function_name(x):
>    """
>    If possible return common function names such as alpha, beta,
>    psi1 as latex symbols otherwise return False
>    """
>    return ... latex-ified(x) if possible    #All latex construction goes here
> 
>    return False
> -------------------------------------------------------------
> 
> I have followed the typesetting of "SymbolicVariable" closely.
> I am listing sample situations:
> 
> -----------------------------------------
> (1) function('psi',x)   =>     psi\left(x\right)
> 
> (2) function('psi1',x)  =>    \psi_{1}\left(x\right)
> 
> (3) function('psi_00',x)  =>   \psi_{00}\left(x\right)
> 
> (4) function('psi_mu',x)   =>   \psi_{\mu}\left(x\right)
> 
> (5) function('psi_xyz',x)    =>  \psi_{xyz}\left(x\right)
> 
> (6) function('myfunc_nu',x)     =>   ???
> 
> (7) function('alpha_abcd_xyz',x)  =>    ???
> ------------------------------------------
> 
> (1) to (5) have been implemented but I am not sure
> what to do for (6) and (7). I guess, for them its better
> to return False so that default typesetting are used.
> Please let me know if I have missed something.
> 

This seems great.  I think you're right: just return False and let the 
normal Sage process happen.

I think at this point, it'd be good to post a patch so that we can all 
see the full change.  Do you know how to make a patch with mercurial? 
Have you been using version control to save your changes?

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
-~----------~----~----~----~------~----~------~--~---

Reply via email to