From d420ec4ab00a322f97bd05326741ec7de3e3d65a Mon Sep 17 00:00:00 2001 From: Ralf Stephan Date: Fri, 12 May 2017 09:18:41 +0200 Subject: [PATCH] 17505: fix latex, cosmetics --- src/sage/functions/other.py | 4 ++-- src/sage/interfaces/maxima_lib.py | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/sage/functions/other.py b/src/sage/functions/other.py index dc13c3953e7..ff22f0898a7 100644 --- a/src/sage/functions/other.py +++ b/src/sage/functions/other.py @@ -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() @@ -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() diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py index f056c8f8bbf..9b6e8faedc3 100644 --- a/src/sage/interfaces/maxima_lib.py +++ b/src/sage/interfaces/maxima_lib.py @@ -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: