diff --git a/CHANGES b/CHANGES index 618114357..8a8271901 100644 --- a/CHANGES +++ b/CHANGES @@ -12,6 +12,7 @@ Bugs fixed * #2640: 1.4.2 LaTeX crashes if code-block inside warning directive * Let LaTeX use straight quotes also in inline code (ref #2627) * #2351: latex crashes if enumerated lists are placed on footnotes +* #2646: latex crashes if math contains twice empty lines Release 1.4.3 (released Jun 5, 2016) diff --git a/sphinx/ext/mathbase.py b/sphinx/ext/mathbase.py index 13a560c0a..ddcec492c 100644 --- a/sphinx/ext/mathbase.py +++ b/sphinx/ext/mathbase.py @@ -58,7 +58,7 @@ def wrap_displaymath(math, label, numbering): begin = r'\begin{align*}%s\!\begin{aligned}' % labeldef end = r'\end{aligned}\end{align*}' for part in parts: - equations.append('%s\\\\\n' % part) + equations.append('%s\\\\\n' % part.strip()) return '%s\n%s%s' % (begin, ''.join(equations), end)