Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
17505: fix latex, cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
rwst committed May 12, 2017
1 parent 7a56004 commit d420ec4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/sage/functions/other.py
Expand Up @@ -2617,7 +2617,7 @@ def _print_latex_(self, x, var, a, b):
sage: latex(ssum(x^2, x, 1, 10))
\sum_{x=1}^{10} x^2
"""
return r"\sum_{{{}={}}}^{{{}}} {}".format(var, a, b, x)
return r"{{\sum_{{{}={}}}^{{{}}} {}}}".format(var, a, b, x)

symbolic_sum = Function_sum()

Expand Down Expand Up @@ -2664,6 +2664,6 @@ def _print_latex_(self, x, var, a, b):
sage: latex(sprod(x^2, x, 1, 10))
\prod_{x=1}^{10} x^2
"""
return r"\prod_{{{}={}}}^{{{}}} {}".format(var, a, b, x)
return r"{{\prod_{{{}={}}}^{{{}}} {}}}".format(var, a, b, x)

symbolic_product = Function_prod()
7 changes: 2 additions & 5 deletions src/sage/interfaces/maxima_lib.py
Expand Up @@ -902,17 +902,14 @@ def sr_sum(self,*args):

def sr_prod(self,*args):
"""
Helper function to wrap calculus use of Maxima's summation.
Helper function to wrap calculus use of Maxima's product.
"""
try:
return max_to_sr(maxima_eval([[max_ratsimp],[[max_simplify_prod],([max_prod],[sr_to_max(SR(a)) for a in args])]]));
except RuntimeError as error:
s = str(error)
if "divergent" in s:
# in pexpect interface, one looks for this;
# could not find an example where 'Pole encountered' occurred, though
# if "divergent" in s or 'Pole encountered' in s:
raise ValueError("Sum is divergent.")
raise ValueError("Product is divergent.")
elif "Is" in s: # Maxima asked for a condition
self._missing_assumption(s)
else:
Expand Down

0 comments on commit d420ec4

Please sign in to comment.