Opened 10 years ago

Closed 8 years ago

# Elliptic Curve latex method can create new latex commands by accident

Reported by: Owned by: was jason minor sage-5.12 elliptic curves latex, elliptic curve, sd51 sage-5.12.beta2 Frédéric Chapoton Alex Ghitza N/A

### 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

### comment:1 Changed 10 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 10 years ago by kcrisman

Sorry, E._latex_().

### comment:3 Changed 8 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