Skip to content

Commit 6d4d7bf

Browse files
committed
fix oups
1 parent d1dfc46 commit 6d4d7bf

File tree

1 file changed

+3
-38
lines changed

1 file changed

+3
-38
lines changed

src/sage/misc/latex.py

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2172,12 +2172,12 @@ def repr_lincomb(symbols, coeffs):
21722172
if c == 1:
21732173
coeff = ""
21742174
elif c == -1:
2175-
coeff = "-"
2175+
coeff = "-"
21762176
else:
2177-
coeff = coeff_repr(c)
2177+
coeff = coeff_repr(c)
21782178

21792179
b = latex(sym)
2180-
# this is a hack: i want to say that if the symbol happens to
2180+
# this is a hack: I want to say that if the symbol happens to
21812181
# be a number, then we should put a multiplication sign in
21822182
try:
21832183
if sym in CC and coeff not in ("", "-"):
@@ -2194,41 +2194,6 @@ def repr_lincomb(symbols, coeffs):
21942194

21952195
s = " + ".join(terms)
21962196
return s.replace("+ -", "- ")
2197-
s = ""
2198-
first = True
2199-
2200-
for i, c in enumerate(coeffs):
2201-
bv = symbols[i]
2202-
b = latex(bv)
2203-
if c != 0:
2204-
if c == 1:
2205-
if first:
2206-
s += b
2207-
else:
2208-
s += " + %s" % b
2209-
else:
2210-
coeff = coeff_repr(c)
2211-
if coeff == "-1":
2212-
coeff = "-"
2213-
if first:
2214-
coeff = str(coeff)
2215-
else:
2216-
coeff = " + %s" % coeff
2217-
# this is a hack: i want to say that if the symbol
2218-
# happens to be a number, then we should put a
2219-
# multiplication sign in
2220-
try:
2221-
if bv in CC:
2222-
s += r"%s\cdot %s" % (coeff, b)
2223-
else:
2224-
s += "%s%s" % (coeff, b)
2225-
except Exception:
2226-
s += "%s%s" % (coeff, b)
2227-
first = False
2228-
if first:
2229-
s = "0"
2230-
s = s.replace("+ -", "- ")
2231-
return s
22322197

22332198

22342199
common_varnames = ['alpha',

0 commit comments

Comments
 (0)