Fix #2071: Same footnote in more than two section titles => LaTeX/PDF Bug

This commit is contained in:
Takeshi KOMIYA
2015-12-25 10:43:41 +09:00
parent ee7e3cc078
commit 0719611d54
4 changed files with 6 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ Bugs fixed
* #2003: Fix decode error under python2 (only) when ``make linkcheck`` is run
* #2186: Fix LaTeX output of \mathbb in math
* #1480, #2188: LaTeX: Support math in section titles
* #2071: Fix same footnote in more than two section titles => LaTeX/PDF Bug
Release 1.3.3 (released Dec 2, 2015)

View File

@@ -1662,7 +1662,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
# if a footnote has been inserted once, it shouldn't be repeated
# by the next reference
if used:
if self.table or self.in_term:
if self.table or self.in_term or self.in_title:
self.body.append('\\protect\\footnotemark[%s]' % num)
else:
self.body.append('\\footnotemark[%s]' % num)

View File

@@ -33,6 +33,9 @@ The section with a reference to [AuthorYear]_
.. [1] Second
.. [#] Third
The section with a reference to [1]_
=====================================
`URL in term <http://sphinx-doc.org/>`_
Description Description Description ...

View File

@@ -331,6 +331,7 @@ def test_reference_in_caption(app, status, warning):
assert '\\chapter{The section with a reference to {[}AuthorYear{]}}' in result
assert '\\caption{The table title with a reference to {[}AuthorYear{]}}' in result
assert '\\paragraph{The rubric title with a reference to {[}AuthorYear{]}}' in result
assert '\\chapter{The section with a reference to \\protect\\footnotemark[1]}' in result
@with_app(buildername='latex', testroot='footnotes',