This does not format things like a_2 very well. What about this one?

def ashow(v):
    show(sage.calculus.calculus.var(v)==eval(v))

Show seems to format the equations nicely without explicitly using
latex.

If latex is desired explicitly, the following works, too:

def ashow(v):
   show(latex(sage.calculus.calculus.var(v)==eval(v)))

a_2 = 1/2
ashow('a_2')

Note that sage.calculus.calculus.var(v) has to be used instead of
var(v), otherwise the variable will be reset in the global name space.
It took me a while to figure this out. :)
Could something like this be included as a standard function in one of
the next releases?

Stan

On Oct 7, 12:27 am, kkwweett <[EMAIL PROTECTED]> wrote:
>
> 'Eval' can do that :
>
> def ashow(v):
>   show("$"+v+"=%s$"%latex(eval(v)))
>
> b=2/3
> ashow('b')
>
> Hope that helps
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to