diff --git a/CHANGES b/CHANGES index bf00ad864..6f64c1d0f 100644 --- a/CHANGES +++ b/CHANGES @@ -40,6 +40,9 @@ Bugs fixed * #2622: Latex produces empty pages after title and table of contents * #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 +* #2480: `sphinx.ext.autodoc`: memory addresses were shown Release 1.4.3 (released Jun 5, 2016) diff --git a/doc/config.rst b/doc/config.rst index 891f080b5..b417d8a56 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -56,7 +56,7 @@ General configuration .. confval:: extensions - A list of strings that are module names of Sphinx extensions. These can be + A list of strings that are module names of :ref:`extensions`. These can be extensions coming with Sphinx (named ``sphinx.ext.*``) or custom ones. Note that you can extend :data:`sys.path` within the conf file if your diff --git a/doc/tutorial.rst b/doc/tutorial.rst index 385746f72..bced21ade 100644 --- a/doc/tutorial.rst +++ b/doc/tutorial.rst @@ -300,12 +300,17 @@ features of intersphinx. More topics to be covered ------------------------- -- Other extensions (math, viewcode, doctest) +- :doc:`Other extensions `: + + * :doc:`ext/math`, + * :doc:`ext/viewcode`, + * :doc:`ext/doctest`, + * ... - Static files -- Selecting a theme -- Templating +- :doc:`Selecting a theme ` +- :ref:`Templating ` - Using extensions -- Writing extensions +- :ref:`Writing extensions ` .. rubric:: Footnotes diff --git a/sphinx/environment.py b/sphinx/environment.py index cfc522777..2974fe206 100644 --- a/sphinx/environment.py +++ b/sphinx/environment.py @@ -76,7 +76,7 @@ default_settings = { # or changed to properly invalidate pickle files. # # NOTE: increase base version by 2 to have distinct numbers for Py2 and 3 -ENV_VERSION = 48 + (sys.version_info[0] - 2) +ENV_VERSION = 49 + (sys.version_info[0] - 2) dummy_reporter = Reporter('', 4, 4) 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) diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py index 5dc2008c8..dbd578ec4 100644 --- a/sphinx/util/inspect.py +++ b/sphinx/util/inspect.py @@ -20,7 +20,7 @@ from sphinx.util import force_decode # relatively import this module inspect = __import__('inspect') -memory_address_re = re.compile(r' at 0x[0-9a-f]{8,16}(?=>$)') +memory_address_re = re.compile(r' at 0x[0-9a-f]{8,16}(?=>)') if PY3: diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index b54161dbc..9d19ecb1b 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -979,9 +979,9 @@ class LaTeXTranslator(nodes.NodeVisitor): def visit_collected_footnote(self, node): self.in_footnote += 1 if 'footnotetext' in node: - self.body.append('\\footnotetext[%s]{\sphinxAtStartFootnote%%' % node['number']) + self.body.append('\\footnotetext[%s]{\sphinxAtStartFootnote%%\n' % node['number']) else: - self.body.append('\\footnote[%s]{\sphinxAtStartFootnote%%' % node['number']) + self.body.append('\\footnote[%s]{\sphinxAtStartFootnote%%\n' % node['number']) def depart_collected_footnote(self, node): self.body.append('}') @@ -1321,12 +1321,15 @@ class LaTeXTranslator(nodes.NodeVisitor): depart_field_body = depart_definition def visit_paragraph(self, node): - # insert blank line, if the paragraph follows a non-paragraph node in a compound index = node.parent.index(node) if (index > 0 and isinstance(node.parent, nodes.compound) and not isinstance(node.parent[index - 1], nodes.paragraph) and not isinstance(node.parent[index - 1], nodes.compound)): + # insert blank line, if the paragraph follows a non-paragraph node in a compound self.body.append('\\noindent\n') + elif index == 0 and isinstance(node.parent, nodes.footnote): + # don't insert blank line, if the paragraph is first child of a footnote + pass else: self.body.append('\n')