Opened 7 years ago

Closed 6 years ago

#12524 closed defect (fixed)

Elliptic Curve latex method can create new latex commands by accident

Reported by: was Owned by: jason
Priority: minor Milestone: sage-5.12
Component: elliptic curves Keywords: latex, elliptic curve, sd51
Cc: Merged in: sage-5.12.beta2
Authors: Frédéric Chapoton Reviewers: Alex Ghitza
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

sage: K.<phi> = NumberField(x^2-x-1)
sage: a = phi
sage: E = EllipticCurve([0,0,a,27*a-43,-80*a+128])
sage: latex(E)
y^2 + \phiy = x^3 + \left(27 \phi - 43\right)x + \left(-80 \phi + 128\right) 

See the \phiy. Not good

Attachments (1)

trac_12524_latex_elliptic.patch (3.0 KB) - added by chapoton 6 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 7 years ago by kcrisman

  • Summary changed from latex of var named phi next to a y is bad news. to Elliptic Curve latex method can create new latex commands by accident

This is not a problem about latex().

sage: var('phi,y')
(phi, y)
sage: phi*y
phi*y
sage: latex(phi*y)
\phi y

It's a problem in E.latex():

        elif b[2]:
            s += "+ %sy "%a[2]

Umm, yeah. Probably the intended use case is

sage: L.<z>=NumberField(x^2-x-1)
sage: b = z
sage: F = EllipticCurve([0,0,b,27*b-43,-80*b+128])
sage: latex(F)
y^2 + zy = x^3 + \left(27 z - 43\right)x + \left(-80 z + 128\right) 

So do you think that a one-whitespace change would fix this? (Actually, there are a few similar places.)

comment:2 Changed 7 years ago by kcrisman

Sorry, E._latex_().

Changed 6 years ago by chapoton

comment:3 Changed 6 years ago by chapoton

  • Authors set to Frédéric Chapoton
  • Component changed from misc to elliptic curves
  • Keywords latex elliptic curve added
  • Status changed from new to needs_review

Here is a proposal, needs review

comment:4 Changed 6 years ago by AlexGhitza

  • Keywords sd51 added
  • Reviewers set to Alex Ghitza
  • Status changed from needs_review to positive_review

comment:5 Changed 6 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:6 Changed 6 years ago by jdemeyer

  • Merged in set to sage-5.12.beta2
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.