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

LaTeX representation of negative symbolic fractions broken #9086

Closed
nexttime mannequin opened this issue May 29, 2010 · 19 comments
Closed

LaTeX representation of negative symbolic fractions broken #9086

nexttime mannequin opened this issue May 29, 2010 · 19 comments

Comments

@nexttime
Copy link
Mannequin

nexttime mannequin commented May 29, 2010

When the numerator of a (negative) symbolic expression happens to be 1 (and only then), the sign is dropped in its LaTeX representation (but not its string representation):

sage: latex(-1/x) 
\frac{1}{x}
sage: latex(1/-x) 
\frac{1}{x}

Origin of the new doctest failure in sage/graphs/generic_graphy.py, introduced with Sage 4.4.3.alpha0.


Update:

Actually, though I tested many other cases, the same (still) happens if both the numerator and denominator are (symbolic) variables (see also #9086 comment:12):

sage: var("x y")
(x, y)
sage: latex(-x/y)
\frac{x}{y}
sage: latex(x/-y)
\frac{x}{y}

But since it was discovered after the patch that fixes the first issue had been merged, the latter bug is now #9314.

Component: symbolics

Keywords: symbolic fraction, sign, minus, latex, pynac

Author: William Stein

Reviewer: Mike Hansen

Merged: sage-4.4.3.alpha2

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

@nexttime nexttime mannequin added this to the sage-4.4.4 milestone May 29, 2010
@nexttime nexttime mannequin added c: symbolics labels May 29, 2010
@nexttime nexttime mannequin assigned burcin May 29, 2010
@burcin
Copy link

burcin commented May 29, 2010

Changed keywords from symbolic fraction, sign, minus, latex to symbolic fraction, sign, minus, latex, pynac

@burcin
Copy link

burcin commented May 29, 2010

comment:1

Thanks for tracking this down. This patch is the culprit:

http://pynac.sagemath.org/hg/rev/cbd65a7dcf6a

I will only be able to look at this after next weekend.

@williamstein
Copy link
Contributor

Attachment: trac_9086.patch.gz

apply to sage library

@williamstein
Copy link
Contributor

Attachment: trac_9086-apply_to_pynac.patch.gz

apply to src/ repo in pynac spkg

@williamstein
Copy link
Contributor

comment:2

The patch to the pynac spkg is long, but is logically nearly trivial. I just copied some code for printing a sign, which Burcin forgot.

The patch to the sage library is merely to test that this is fixed.

William

@williamstein
Copy link
Contributor

@mwhansen
Copy link
Contributor

mwhansen commented Jun 3, 2010

comment:4

This looks good to me and fixes the issue. There was a change for #9037 that didn't get included in the spkg merged so far in 4.4.3 so I've included it at

http://sage.math.washington.edu/home/mhansen/pynac-0.2.0.p1.spkg

which should be used instead of the above link.

@mwhansen
Copy link
Contributor

mwhansen commented Jun 3, 2010

Author: William Stein

@mwhansen
Copy link
Contributor

mwhansen commented Jun 3, 2010

Reviewer: Mike Hansen

@williamstein
Copy link
Contributor

comment:5

Mike, Can you give #9037 a positive review?

@mwhansen
Copy link
Contributor

mwhansen commented Jun 3, 2010

comment:6

Positive review up at #9037.

@williamstein williamstein modified the milestones: sage-4.4.4, sage-4.4.3 Jun 3, 2010
@williamstein
Copy link
Contributor

Merged: 4.4.3.alpha2

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jun 3, 2010

Changed merged from 4.4.3.alpha2 to sage-4.4.3.alpha2

@sagetrac-damm

This comment has been minimized.

@sagetrac-damm sagetrac-damm mannequin reopened this Jun 21, 2010
@sagetrac-damm

This comment has been minimized.

@sagetrac-damm
Copy link
Mannequin

sagetrac-damm mannequin commented Jun 21, 2010

comment:12

Replying to @sagetrac-damm:
Sorry, i've changed the description and couldn't revert the change.

I think the fix didn't solve all problems:

sage: var('x y')
sage: latex(-x/y) 
\frac{x}{y}

@nexttime
Copy link
Mannequin Author

nexttime mannequin commented Jun 22, 2010

comment:13

Replying to @sagetrac-damm:

I think the fix didn't solve all problems

Indeed. Despite the ticket's name, I think this second case should be addressed on another ticket, since this one had already been merged.

@sagetrac-damm
Copy link
Mannequin

sagetrac-damm mannequin commented Jun 22, 2010

comment:14

Done. #9314

@nexttime

This comment has been minimized.

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