I was thinking of custom defined latex representations of different
variables or functions, similar to the example I showed in my first
email in this thread. Basically, I would like to be able to give
working names to variables (e.g. sui), but display them as I would in
a paper if I use the show command (e.g. $s_{u,i}$). I can define this
by

var('sui')
sui._latex_ = lambda: 's_{u,i}'

but as soon as define the variable as a function, e.g.

var('t')
sui(t) = function('sui',t)

show(sui) does not display correctly any more. So I think that the
problem with the latex representation of functions is not limited to
greek letters, but to any more complicated variable names, and it
would be nice if the user could define the latex representation of his
variables and functions himself. This is for example helpful if one
uses Sage to find analytical solutions of equation that can be put
into e.g. Fortran code, but at the same time one would like to
document the solution path in a nicely typeset way ready to go into a
paper.

I hope this makes sense to you.

Cheers
Stan

On Mar 26, 9:11 pm, Golam Mortuza Hossain <gmhoss...@gmail.com> wrote:
> Hi Stan,
>
> On Thu, Mar 26, 2009 at 5:59 AM, Stan Schymanski <schym...@gmail.com>
>
> > It seems that you and Jason are getting a firm grip on this, which is
> > great. Just out of curiosity and my ignorance of the underlying code: Is
> > your aim to hard-code certain functions, or is your aim to provide the
> > users with the possibility of defining the latex representation of their
> > functions? I assume it is the latter, as there is an indefinite number
> > of possible function names. Could you confirm?
>
> My current aim was to deal with the function names which are
> named after Greek letters, and possibly with suffixes. For example:
> function names such as "psi", "tau0", "alpha_mn"  "Psi_alpha" etc.
>
> Could you please give some examples for the later case? May be
> I am missing your point.
>
> Jason: I am attaching the patch for enhancing typesetting of
> functions. I need to add doc-tests though. In the patch, I have
> implemented all the situations that I planned to do.
>
> Apart from the situations I mentioned earlier, it now also
> supports following types of function name (single letters with
> suffixes)
> ---------------
> (6)  function('f1',x)   =>   f_{1}\left(x\right)
>
> (7)  function('T_sigma',x)   =>   T_{\sigma}\left(x\right)
>
> (8) function('R_ab',x)    =>  R_{ab}\left(x\right)
> ----------------
>
> Currently, the major problem is to figure out: whats going
> wrong in typesetting "diff( psi(x), x)" even
> though  "exp(psi(x))" works beautifully. Similar issue
> arises for "integrate", "conjugate"...
>
> Cheers,
> Golam
>
>  typeset-symbolic-functions.patch
> 3KViewDownload
--~--~---------~--~----~------------~-------~--~----~
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