On Fri, Oct 30, 2009 at 12:43 AM, ma...@mendelu.cz <ma...@mendelu.cz> wrote:
>
>
>
> On 30 říj, 08:32, William Stein <wst...@gmail.com> wrote:
>>
>> Obviously, it would be nice if the latex command were improved so it
>> is aware of Python floats.  That would be a nice enhancement you
>> can contribute to sage.
>
> Thank you for quick answer. Can you give me few pointers where to fix
> it?
>
> Robert

Look in the file

   SAGE_ROOT/devel/sage/sage/misc/latex.py

There is a table in there called latex_table.   You have to
add an entry of the form

   float:float_function

where you might first try something like this just to get it to work:

def float_function(x):
    from sage.rings.all import RR
    return RR(x)._latex_()


You might decide to write your own direct float function too (that
doesn't use RR), which might be slightly faster or more accurate in
some way.   I don't know.

William




-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to