latex of acos

1,160 views
Skip to first unread message

pragma

unread,
Oct 1, 2008, 2:16:10 AM10/1/08
to sage-support
hi, im new to sage :)

the latex output of arccos(x), arcsin etc. is

\cos^{-1} \left( x \right)

can i change this

\arccos


sry. for my english

pragma

unread,
Oct 1, 2008, 10:21:53 AM10/1/08
to sage-support
ive tried this but it doesnt seem to do the job:

class c_arccos(sage.calculus.calculus.Function_arccos):
def __init__(self):
pass
def _latex_(self):
return "\\arccos"

p_arccos = c_arccos()

print latex(p_arccos(1/3))
print latex(p_arccos)

#############
#outputs:
############

\cos^{-1} \left( \frac{1}{3} \right)
\arccos

the first line still outputs \cos^{-1} instead of arccos

Håkan Granath

unread,
Oct 7, 2008, 12:23:14 PM10/7/08
to sage-support
This seems to work:

sage: sage.calculus.calculus.Function_arccos._latex_ = lambda self : "\
\arccos"
sage: latex(arccos(1/3))
\arccos \left( \frac{1}{3} \right)

Best,

/Håkan

pragma

unread,
Oct 11, 2008, 12:40:39 PM10/11/08
to sage-support

thank you :)
Reply all
Reply to author
Forward
0 new messages