diff --git a/sympy/printing/latex.py b/sympy/printing/latex.py index 07ab76529e..6862c594be 100644 --- a/sympy/printing/latex.py +++ b/sympy/printing/latex.py @@ -583,8 +583,8 @@ def _print_Integral(self, expr): symbols.insert(0, r"\, d%s" % self._print(symbol)) - return r"%s %s%s" % (tex, - str(self._print(expr.function)), "".join(symbols)) + tmpl = r"%s \left(%s\right)%s" if expr.function.is_Add else r"%s %s%s" + return tmpl % (tex, str(self._print(expr.function)), "".join(symbols)) def _print_Limit(self, expr): e, z, z0, dir = expr.args diff --git a/sympy/printing/tests/test_latex.py b/sympy/printing/tests/test_latex.py index da69fd49cb..e91781cb3d 100644 --- a/sympy/printing/tests/test_latex.py +++ b/sympy/printing/tests/test_latex.py @@ -467,6 +467,7 @@ def test_latex_integrals(): # issue sympy/sympy#10806 assert latex(Integral(x, x)**2) == r"\left(\int x\, dx\right)^{2}" + assert latex(Integral(z + x, z)) == r"\int \left(x + z\right)\, dz" def test_latex_sets():