Fix #10175: LaTeX: named footnote ref is linked to an incorrect footnote

A named footnote reference will be converted to a hyperlink to an
incorrect footnote if the name is also used in the different document.
This commit is contained in:
Takeshi KOMIYA 2022-02-13 20:19:41 +09:00
parent 6f0a8f3516
commit 01d06f9ffe
3 changed files with 5 additions and 0 deletions

View File

@ -32,6 +32,8 @@ Bugs fixed
unhashable object
* #9529: LaTeX: named auto numbered footnote (ex. ``[#named]``) that is referred
multiple times was rendered to a question mark
* #10175: LaTeX: named footnote reference is linked to an incorrect footnote if
the name is also used in the different document
* #10181: napoleon: attributes are displayed like class attributes for google
style docstrings when :confval:`napoleon_use_ivar` is enabled
* #10122: sphinx-build: make.bat does not check the installation of sphinx-build

View File

@ -571,6 +571,7 @@ class LaTeXTranslator(SphinxTranslator):
def visit_start_of_file(self, node: Element) -> None:
self.curfilestack.append(node['docname'])
self.body.append(CR + r'\sphinxstepscope' + CR)
def depart_start_of_file(self, node: Element) -> None:
self.curfilestack.pop()

View File

@ -1197,6 +1197,7 @@ def test_latex_table_tabulars(app, status, warning):
tables = {}
for chap in re.split(r'\\(?:section|chapter){', result)[1:]:
sectname, content = chap.split('}', 1)
content = re.sub(r'\\sphinxstepscope', '', content) # filter a separator
tables[sectname] = content.strip()
def get_expected(name):
@ -1266,6 +1267,7 @@ def test_latex_table_longtable(app, status, warning):
tables = {}
for chap in re.split(r'\\(?:section|chapter){', result)[1:]:
sectname, content = chap.split('}', 1)
content = re.sub(r'\\sphinxstepscope', '', content) # filter a separator
tables[sectname] = content.strip()
def get_expected(name):