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

fix latex method for laurent series element #6656

Closed
jhpalmieri opened this issue Jul 29, 2009 · 6 comments
Closed

fix latex method for laurent series element #6656

jhpalmieri opened this issue Jul 29, 2009 · 6 comments

Comments

@jhpalmieri
Copy link
Member

In the Sage Notebook Bugreports, there is a report of an error with typesetting Laurent series elements:

sage: R.<a,b>=PolynomialRing(QQ)
sage: T.<x>=LaurentSeriesRing(R)
sage: latex(a*x+b*x)
'a + bx'

It ought to be (a+b)x, but the parentheses are missing. The attached patch should fix this.

Component: algebra

Author: John Palmieri

Reviewer: Minh Van Nguyen

Merged: Sage 4.1.1.rc1

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

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Aug 3, 2009

Attachment: trac_6656-laurent.patch.gz

Attachment: trac_6656-reviewer.patch.gz

reviewer patch

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Aug 3, 2009

comment:1

Before the patch:

----------------------------------------------------------------------
| Sage Version 4.1, Release Date: 2009-07-09                         |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
sage: R.<a,b> = PolynomialRing(QQ)
sage: T.<x> = LaurentSeriesRing(R)
sage: y = a*x + b*x
sage: y._latex_()
'a + bx'
sage: latex(y)
a + bx

After the patch:

----------------------------------------------------------------------
| Sage Version 4.1.1.rc0, Release Date: 2009-07-29                   |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
**********************************************************************
*                                                                    *
* Warning: this is a prerelease version, and it may be unstable.     *
*                                                                    *
**********************************************************************
sage: R.<a,b> = PolynomialRing(QQ)
sage: T.<x> = LaurentSeriesRing(R)
sage: y = a*x + b*x
sage: y._latex_()
'\\left(a + b\\right)x'
sage: latex(y)
\left(a + b\right)x

Note that one can also obtain the LaTeX representation of an object through the latex() function. So I'm attaching a patch on top of John's that also calls that function. If John is OK with the patch trac_6656-reviewer.patch, then the ticket has positive review from me.

@jhpalmieri
Copy link
Member Author

Reviewer: Minh Van Nguyen

@jhpalmieri
Copy link
Member Author

comment:2

Sure, looks fine to me. Tests still pass with the reviewer patch.

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Aug 3, 2009

Merged: Sage 4.1.1.rc1

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Aug 3, 2009

comment:3

Merged both patches.

@sagetrac-mvngu sagetrac-mvngu mannequin removed the s: positive review label Aug 3, 2009
@sagetrac-mvngu sagetrac-mvngu mannequin closed this as completed Aug 3, 2009
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

1 participant