Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternating multiply referred footnotes produce a ? in pdf output #10188

Closed
jfbu opened this issue Feb 13, 2022 · 4 comments · Fixed by #10191
Closed

Alternating multiply referred footnotes produce a ? in pdf output #10188

jfbu opened this issue Feb 13, 2022 · 4 comments · Fixed by #10191

Comments

@jfbu
Copy link
Contributor

jfbu commented Feb 13, 2022

Describe the bug

In some circumstances footnote mark is rendered as ? and there is no hyperlink

How to Reproduce

file index.rst:

Test
====

Explicitly numbered footnotes
-----------------------------

First reference to first footnote [1]_ 

First reference to second footnote [2]_

Second reference to first footnote [1]_

Second reference to second footnote [2]_


.. rubric:: Footnotes

.. [1] A first footnote

.. [2] A second footnote

then make latexpdf.

Expected behavior

Footnotes are rendered correctly

Your project

See above code

Screenshots

Capture d’écran 2022-02-13 à 09 32 11

OS

Mac

Python version

3.8.7 (CPython)

Sphinx version

4.4.0 and current 4.x (v4.5.0+/4ba056870)

Sphinx extensions

No response

Extra tools

No response

Additional context

No response

@jfbu jfbu added this to the 4.5.0 milestone Feb 13, 2022
@jfbu
Copy link
Contributor Author

jfbu commented Feb 13, 2022

The #8832 mechanism fixed some problems with explicitly numbered footnotes (and #10169 extended this to named footnotes). But this mechanism is flawed when new named or explicitly numbered footnotes occur in-between multiple references to same original one.

jfbu added a commit to jfbu/sphinx that referenced this issue Feb 13, 2022
Fix sphinx-doc#10188

Footnotes in some LaTeX environments (tables, fulllineitems for object
descriptions) are gathered and appear after the environment, causing the
footnote to possibly appear on a page later than some of the footnote
marks referring it.

With this commit, the footnote mark compares page numbers and
incorporates the destination page number if it turns out to be distinct
from the page where it stands.
@tk0miya tk0miya modified the milestones: 4.5.0, 5.0.0 Mar 27, 2022
@Jellby
Copy link
Contributor

Jellby commented Apr 12, 2022

Is there any workaround for now?

@Jellby
Copy link
Contributor

Jellby commented Apr 12, 2022

Is there any workaround for now?

Just \let\sphinxstepexplicit\relax does it.

Would it be possible to make LaTeX issue a warning whenever a ? is used instead of a proper footnote mark? That would save some hunting in the final PDF files.

jfbu added a commit to jfbu/sphinx that referenced this issue Apr 16, 2022
Fix sphinx-doc#10188

Footnotes in some LaTeX environments (tables, fulllineitems for object
descriptions) are gathered and appear after the environment, causing the
footnote to possibly appear on a page later than some of the footnote
marks referring it.

With this commit, the footnote mark compares page numbers and
incorporates the destination page number if it turns out to be distinct
from the page where it stands.
@jfbu
Copy link
Contributor Author

jfbu commented Apr 16, 2022

@Jellby I have now merged for 5.0.0 release the #10191 pull request after some rebasing work. Nice suggestion about letting LaTeX issue a warning in place of a ?, I will keep it in mind for improving.

AA-Turner pushed a commit to AA-Turner/sphinx that referenced this issue Apr 17, 2022
Fix sphinx-doc#10188

Footnotes in some LaTeX environments (tables, fulllineitems for object
descriptions) are gathered and appear after the environment, causing the
footnote to possibly appear on a page later than some of the footnote
marks referring it.

With this commit, the footnote mark compares page numbers and
incorporates the destination page number if it turns out to be distinct
from the page where it stands.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants