footmisc 2011/06/06 v5.5b and hyperref's option hyperfootnotes=false
Nobody has claimed this yet.
- Dominant language
- TeX
- Stars
- 205
- Forks
- 41
- PR merge metrics
- No merged PRs in 30d
Description
This was originally posted here: https://github.com/FrankMittelbach/fmitex/issues/5#issue-383991035
but I think it really should be resolved from the hyperref side ...
The issue was brought up by Axel Berger in the German-language usenet-newsgroup de.comp.text.tex in the discussion with subject "Fussnoten widerholen" :
When loading both the package footmisc and the package hyperref, some problems arise:
With hyperref's option hyperfootnotes=true, the macro \footref will deliver a hyperlink where the measurements of the clickable area is considerably smaller than the clickable area of hyperlinks that come into being due to \footnote-commands.
With hyperref's option hyperfootnotes=false, the macro \footref will disobey the hyperref-option and deliver such a hyperlink anyway.
Therefore in case of the hyperref-package being loaded I suggest having the \footref-command
- check for the switch
\ifHy@hyperfootnotes - not place the hyperlink inside the footnotemark (as happens when simply applying the
\ref-command within\@thefnmark) but having the\footref-command apply the starred-variant of the\ref-command within\@thefnmark(which does not deliver a hyperlink) and wrap a call to the\hyperref- macro around the footnote-mark when it gets paced:
In the above-mentioned usenet-discussion I suggested the following patch:
\documentclass{article}
\usepackage{footmisc}
%\usepackage{hyperref}
\usepackage[hyperfootnotes=false]{hyperref}
\makeatletter
\@ifpackageloaded{hyperref}{%
\renewcommand\footref[1]{%
\begingroup
\unrestored@protected@xdef\@thefnmark{%
\ref*{#1}%
}%
\endgroup
\ifHy@hyperfootnotes
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi
{\hyperref[#1]{\strut\H@@footnotemark}}{\@footnotemark}%
}%
}{}%
\makeatother
\begin{document}
argument of the footnote command that is being
labelled\footnote{Note text\label{fnlabel}}
potato head\footref{fnlabel}
\end{document}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the \footref entry point and the hyperref option switch \ifHy@hyperfootnotes, then compare behavior with hyperfootnotes=true and hyperfootnotes=false. Done means \footref respects the option and its clickable area matches the intended footnote link behavior described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- latex
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100