Skip to content

Commit

Permalink
Fix latex printing for Integral's with Add
Browse files Browse the repository at this point in the history
Added test from sympy/sympy#10806
  • Loading branch information
skirpichev committed Mar 13, 2016
1 parent 417d09f commit 539929a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sympy/printing/latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions sympy/printing/tests/test_latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 539929a

Please sign in to comment.