Skip to content

sphinxfootnotemark is not working correctly after update sphinx >=3.5.0 #9529

@xstodu07

Description

@xstodu07

Describe the bug

After sphinx update to version 3.5.0 or higher, only first footnote is functional after converting rst > tex > pdf. Other references to the same footnote are translated as question mark.

As little example after .rst files are translated to .tex it looks like this:

Some text
\begin{footnote}[1]\sphinxAtStartFootnote
URL: \sphinxurl{https://access.redhat.com/documentation/en-us/red\_hat\_enterprise\_linux/8/html-single/upgrading\_from\_rhel\_7\_to\_rhel\_8/index}.
%
\end{footnote}.

Some other text
\sphinxfootnotemark[1].

But when you translate it from latex to .pdf, output looks like:
Some text1.
Some other text?.

How to Reproduce

$ git clone https://github.com/xstodu07/sphinx-issues
$ cd sphinx-issues
$ pip install tox
$ # tox - Create virtualenv with dependencies in requirements.txt, build latex/*.pdf and html/
$ # OR create own virtualenv, activate it (for example: source .tox/docs/bin/activate) and build latex using 'make pdflatex' from 'docs/' directory
$ tox
$ # check docs/_build/latex/footnotes.pdf

Expected behavior

Some text1.
Some other text1.

Your project

https://github.com/xstodu07/sphinx-issues

Screenshots

No response

OS

Linux RHEL 7.9

Python version

3.6

Sphinx version

3.5.0 or higher

Sphinx extensions

sphinxcontrib.bibtex

  • has no effect, if this extension is used or not, same happened to me when footnotes are used in original way - this extension probably use named labels (see first comment below)

Additional context

I noticed that both sphinx versions (old and version >=3.5.0) use different packages for footnotes, but dont understand much the syntax of latex .sty files:

# sphinx4.0.3
Package: sphinxpackagefootnote
%% [2021/02/04 v1.1d footnotehyper adapted to sphinx (Sphinx team)]
%% Version: based on footnotehyper.sty 2021/02/04 v1.1d
(...)
# sphinx2.3.0
[2017/10/27 v1.7 hyperref aware footnote.sty for sphinx (JFB)]
%% Package: footnotehyper-sphinx
%% Version: based on footnotehyper.sty 2017/03/07 v1.0
(...)

Footnotes are working correctly only with the older version [2017/10/27 v1.7 hyperref aware footnote.sty for sphinx (JFB)]. Of course, only without this functionality:
* #2616 (fifth item): LaTeX: footnotes from captions are not clickable,
  and for manually numbered footnotes only first one with same number is
  an hyperlink

And also, it looks like the problem is between translating latex files to pdf (sphinx generate bad .sty file for footnotes). Because generated '.tex' files are same in use of both sphinx versions.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions