Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typesetting of sec(x), csc(x), cot(x) are broken #6268

Closed
golam-m-hossain opened this issue Jun 12, 2009 · 10 comments
Closed

Typesetting of sec(x), csc(x), cot(x) are broken #6268

golam-m-hossain opened this issue Jun 12, 2009 · 10 comments

Comments

@golam-m-hossain
Copy link

Typesettings of sec(x), csc(x), cot(x) are broken. It puts an
extra "\mbox" around them. However, typesetting for sin(x),
cos(x), tan(x) works as expected.

CC: @ncalexan

Component: symbolics

Author: John Palmieri

Reviewer: Nick Alexander

Merged: 4.0.2.alpha0

Issue created by migration from https://trac.sagemath.org/ticket/6268

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jun 12, 2009

comment:1
[mvngu@sage sage-4.0.1]$ sage
----------------------------------------------------------------------
| Sage Version 4.0.1, Release Date: 2009-06-06                       |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
sage: # the following work as expected
sage: latex(sec)
\sec
sage: latex(csc)
\csc
sage: latex(cot)
\cot
sage: # but the following have extra "\mbox" around the trig function name
sage: latex(sec(x))
\mbox{\sec}\left(x\right)
sage: latex(csc(x))
\mbox{\csc}\left(x\right)
sage: latex(cot(x))
\mbox{\cot}\left(x\right)

@jhpalmieri
Copy link
Member

comment:2

Is this a bug in ginac/pynac? Look at this:

sage: SR
Symbolic Ring
sage: SR._latex_element_(sin(x))
'\\sin\\left(x\\right)'
sage: SR._latex_element_(sec(x))
'\\mbox{\\sec}\\left(x\\right)'

The method _latex_element_ is a one-liner:

        return GEx_to_str_latex(&x._gobj)

and I think GEx_to_str_latex is a ginac/pynac thing. At least, I found it in sage/libs/ginac/decl.pxi.

It's possible to work around it, I think, with a patch like the attached, but I'm not at all convinced that this is the right way to fix it. If you think it's okay, feel free to review it, but since I'm not sure, I've labeled it as "not read for review".

@jhpalmieri jhpalmieri added this to the sage-4.0.2 milestone Jun 12, 2009
@jhpalmieri jhpalmieri changed the title Typesetting of sec(x), csc(x), cot(x) are broken [not ready for review] Typesetting of sec(x), csc(x), cot(x) are broken Jun 12, 2009
@golam-m-hossain
Copy link
Author

comment:3

Attachment: trac_6268.patch.gz

The rebased patch for the ticket

#5711

will resolve this issue as an un-intended consequence.

@burcin
Copy link

burcin commented Jun 14, 2009

new patch, apply only this one

@burcin
Copy link

burcin commented Jun 14, 2009

comment:4

Attachment: trac_6268-py_print_latex.patch.gz

attachment: trac_6268-py_print_latex.patch fixes the reported problem. Apply only this patch.

@burcin burcin changed the title [not ready for review] Typesetting of sec(x), csc(x), cot(x) are broken Typesetting of sec(x), csc(x), cot(x) are broken Jun 14, 2009
@burcin burcin assigned burcin and unassigned sagetrac-cwitty Jun 14, 2009
@ncalexan
Copy link
Mannequin

ncalexan mannequin commented Jun 14, 2009

Author: Burcin Erocal

@ncalexan
Copy link
Mannequin

ncalexan mannequin commented Jun 14, 2009

Reviewer: Nick Alexander

@ncalexan
Copy link
Mannequin

ncalexan mannequin commented Jun 14, 2009

Merged: 4.0.2.alpha0

@ncalexan ncalexan mannequin closed this as completed Jun 14, 2009
@ncalexan ncalexan mannequin added the s: positive review label Jun 14, 2009
@ncalexan ncalexan mannequin reopened this Jun 14, 2009
@burcin
Copy link

burcin commented Jun 15, 2009

Changed author from Burcin Erocal to Burcin Erocal, John Palmieri

@burcin
Copy link

burcin commented Jun 15, 2009

Changed author from Burcin Erocal, John Palmieri to John Palmieri

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants