With the recent package footnotebackref it is possible to backrefence footnotes
, one can then jump directly from the main text to the footnote
and back. The link in the footnote
that points back to the main text can be set to symbols inside the footnote
text or, like I prefer it, directly to the footnote
number in the footnote
. The hyperref
package links the footnote number in the main text to the text and not the number of the footnote.
When the document is viewed at a higher zoom level, so that the page width does not fit in the window of pdf viewer anymore, this causes an unwanted result. After clicking on the footnote number inside the main text the footnote number and therefore backreference is hardly or not at all displayed. So I would like know if it is possible to change the position for the hyperref
reference for footnotes directly to the footnote number.
Visual Example
Here you can see what I mean, in case I was unable to explain right or anybody does want to read my description.
MWE
\documentclass{article}
\usepackage{footnotebackref}
\textheight=3cm
\begin{document}
Text\footnote{The first footnote.} Text\\
\end{document}
Best Answer
The trick is to move code used by
hyperref
for setting the footnote anchor/target as part of the footnote text (so after the footnote mark has been 'drawn') into the code for defining the 'footnote' part of the footnote mark! (The footnote mark is used twice for every footnote, once in the text and once in the footnote itself; I am referring to the latter here.)Default LaTeX makes no distinction between the two footnote marks, which may be why
hyperref
originally does things this way around.footnotebackref
does make the distinction in some sense, but not in a way we can cleanly patch, so we undo their changes and patch them back in using our method (I copied the code for this from the current version offootnotebackref
, so this may get out of sync).The following code should work whether or not
footnotebackref
is used (but if it is used, it must be loaded before this patch).hyperref
must also be loaded before this patch. Original definitions of\@makefnmark
are preserved except whenfootnotebackref
is used, which clobbers them anyway.