"Typeset" problem with sech(x)

544 views
Skip to first unread message

TianWei

unread,
Oct 25, 2009, 4:50:28 PM10/25/09
to sage-support
Hi, I'm new to Sage and came across a potential bug in the Sage
Notebook. When the "Typeset" checkbox is on, the expression "sech(x)"
evaluates to an error:

Unknown control sequence '\sech'

The error text is contained in a pink box with a thin red border. When
"Typeset" is off, there is no problem (it evaluates to the expected
"sech(x)")

This happened in the Sage Notebook with Mozilla Firefox 3.0.14. I'm
running Sage version 4.1.2 on Ubuntu 9.04 as a guest operating system
in VMware Workstation 6.5.3, on a Windows XP host. I compiled Sage
from the source code.

I'm a novice programming/math hobbyist, so any help and advice is very
much appreciated.

Thanks,
TianWei

Marshall Hampton

unread,
Oct 25, 2009, 10:37:27 PM10/25/09
to sage-support
Latex doesn't actually support \sech, so this can't really be
considered an error on Sage's part.

Note that

sage: latex('sech(x)')

gives

\text{sech(x)}

for this reason. This does seem a little odd, since Latex (and
jsmath, which is what typesets things in the notebook) does support
cosh, sinh, and tanh.

-Marshall Hampton

John H Palmieri

unread,
Oct 25, 2009, 10:44:21 PM10/25/09
to sage-support
On Oct 25, 7:37 pm, Marshall Hampton <hampto...@gmail.com> wrote:
> Latex doesn't actually support \sech, so this can't really be
> considered an error on Sage's part.
>
> Note that
>
> sage: latex('sech(x)')
>
> gives
>
> \text{sech(x)}

On the other hand,

sage: latex(sech)

gives

\sech

I think the problem is in sage/functions/hyperbolic.py:

PrimitiveFunction.__init__(self, "sech", latex=r"\sech",
approx=lambda x: 1/math.cosh(x))

Which hyperbolic functions have broken latex methods?

John

Burcin Erocal

unread,
Oct 26, 2009, 4:59:03 AM10/26/09
to sage-s...@googlegroups.com
Hi,


Here is the relevant ticket:

http://trac.sagemath.org/sage_trac/ticket/6286


In the symbolic function refactoring patch [1], I fixed the problems
with sin^{-1}. It seems that \sech still remains

[1] http://groups.google.com/group/sage-devel/browse_thread/thread/6f1efcad26909d3

I will try to clean up the symbolic functions patch next week and
submit it for review. I can try to fix the other typesetting problems
then if nobody beats me to it.


Cheers,
Burcin

Reply all
Reply to author
Forward
0 new messages