Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjfbu <jfbu@free.fr>2021-02-05 16:56:23 +0300
committerjfbu <jfbu@free.fr>2021-02-05 18:45:12 +0300
commita0b0a08e38d59c9751f837e6a3f41a980f6aa18d (patch)
tree77ce6014d9988d80c9cc1dab2dc153f249a7e6ca /sphinx/texinputs
parenta39b5f08e9ba853135e7833668406ce845491d71 (diff)
LaTeX footnotes from caption titles now hyperlinked in PDF
This is fifth item of #2616
Diffstat (limited to 'sphinx/texinputs')
-rw-r--r--sphinx/texinputs/footnotehyper-sphinx.sty13
1 files changed, 11 insertions, 2 deletions
diff --git a/sphinx/texinputs/footnotehyper-sphinx.sty b/sphinx/texinputs/footnotehyper-sphinx.sty
index 5ed0e8e6e..8fce532b1 100644
--- a/sphinx/texinputs/footnotehyper-sphinx.sty
+++ b/sphinx/texinputs/footnotehyper-sphinx.sty
@@ -325,8 +325,17 @@
% some extras for Sphinx :
% \sphinxfootnotemark: usable in section titles and silently removed from TOCs.
\def\sphinxfootnotemark [#1]%
- {\ifx\thepage\relax\else\protect\spx@opt@BeforeFootnote
- \protect\footnotemark[#1]\fi}%
+ {\ifx\thepage\relax\else\sphinxfootref{#1}\fi}%
+% \sphinxfootref: almost same as \footref from footmisc package as
+% re-defined by hyperref:
+% - \spx@opt@BeforeFootnote is from BeforeFootnote sphinxsetup option
+% - 'fn:' prefix is output by LaTeX writer in \label of footnotetext
+\protected\def\sphinxfootref#1{\spx@opt@BeforeFootnote
+ \begingroup
+ \unrestored@protected@xdef\@thefnmark{\ref{fn:#1}}% #1 = number
+ \endgroup
+ \H@@footnotemark
+}%
\AtBeginDocument{%
% let hyperref less complain
\pdfstringdefDisableCommands{\def\sphinxfootnotemark [#1]{}}%