#6290: [with patch, needs review] Allow keywords such as latex_name=LaTeX while
defining symbolic function
-------------------------+--------------------------------------------------
 Reporter:  gmhossain    |       Owner:                               
     Type:  enhancement  |      Status:  new                          
 Priority:  major        |   Milestone:                               
Component:  symbolics    |    Keywords:  latex_name, symbolic function
 Reviewer:               |      Author:                               
   Merged:               |  
-------------------------+--------------------------------------------------
Description changed by gmhossain:

Old description:

> In new symbolics, underlying "sage.symbolic.SFunction" class allows
> one to pass the keyword "latex_name=LaTeX". It would be really good if we
> expose this feature at the user interface level. Currently,
> Sage (4.0.1) raises error if one tries to do so.
>

> Example usage:
>
> {{{
> riemann(x) = function('riemann', x, latex_name="\\mathcal{R}")
> latex( riemann(x) )
> \mathcal{R}\left(x\right)
> }}}

New description:

 In new symbolics, underlying "sage.symbolic.function.SFunction" class
 allows one to pass the keywords such as "latex_name=LaTeX". It would be
 really good if we expose this feature at the user interface level. This
 will directly allow LaTeX customization by users according to their need.

 Currently, Sage (4.0.1) raises error if one tries to do so.


 Couple of example usage:

 '''(1)''' Define symbolic function with its latex representaion

 {{{
 riemann(x) = function('riemann', x, latex_name="\\mathcal{R}")
 latex( riemann(x) )
 \mathcal{R}\left(x\right)
 }}}


 '''(2)'''   Printing arguments of a symbolic functions as its indices.

 {{{
 mu,nu = var('mu,nu')
 def my_latex_print(*args):
     return "\psi_{%s}"%(', '.join(map(latex, args)))

 psi(mu,nu) = function('psi', mu,nu, print_latex_func=my_latex_print)

 latex(psi(mu,nu))
 \psi_{\mu, \nu}
 }}}


 Attached patch allows keyword arguments while defining symbolic functions.

--

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6290#comment:2>
Sage <http://sagemath.org/>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

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

Reply via email to