55

Problem

I have various footnotes, which are hyperlinked from the text to the bottom of their respective pages. When I click on the hyperlinks (in the main text), they always take me to the first page of my document. I also have footnotebackref which puts a hyperlink at the footnote to take the reader back to the main body of text and these links for fine.

Edited MWE

After a lot of deletion, I have managed to reduce the document to the following lines. One might say that I have found the problem, since the removal of \usepackage[hang, flushmargin]{footmisc} stops the problem, but I would still like to have non-indented footnotes.

\documentclass{article}

\usepackage[usenames,dvipsnames]{color}
\usepackage[colorlinks=true]{hyperref}

\usepackage[hang, flushmargin]{footmisc}         %Problem line.
\usepackage{footnotebackref}

\begin{document}
\tableofcontents            
\newpage                
\section{Section}
This is some text\footnote{This is a footnote.}.
\end{document}
lockstep
  • 250,273
User 17670
  • 4,722
  • Thank you for the response. In that case, I will have to do without one or the other, or perhaps a workaround. P.s. if you want to add your comment as an answer, I will gladly accept it. – User 17670 Sep 15 '12 at 19:12

3 Answers3

51

In a comment to the question I quoted footmisc's manual:

The hyperref package has ambitions to make hyperlinks from footnote marks to the corresponding footnote body; naturally this causes grief to footmisc, and unfortunately no remedy is currently known. If you use footmisc, suppress hyperref's hyperfootnotes, by loading it as: \usepackage[hyperfootnotes=false,...]{hyperref} Further work on the interaction between the two packages is proposed, but not yet scheduled.

So it is to be expected that things might not be working the way one wishes. However, the problems in the MWE can simply be solved by changing the package loading order:

\documentclass{article}

\usepackage[hang, flushmargin]{footmisc}
\usepackage[colorlinks=true]{hyperref}
\usepackage{footnotebackref}

\begin{document}
\tableofcontents            
\newpage                
\section{Section}
This is some text\footnote{This is a footnote.}.

\newpage\null% to see that the hyperlink works
\end{document}
cgnieder
  • 66,645
  • 2
    It seems that this issue is not still resolved. Changing the loading order works but some custom classes (in article templates etc) include hyperref so we do end up loading footmisc after hyperref. – WYSIWYG Oct 04 '16 at 09:47
  • 1
    @WYSIWYG for such cases package scrlfile from the KOMA-Script bundle may be useful… – cgnieder Oct 04 '16 at 09:52
  • @clemens, unfortunately, this workaround does not work with memoir. any suggestions? – Tina May 04 '17 at 16:57
  • 1
    Your workaround worked very nicely for my project report (with the article class), thank you very much! – Gallifreyan Dec 26 '17 at 21:28
3

I would like to leave a tip for Brazilian users which for some documents must use the regional standard package abntex2cite. I hope this tip may also be helpful to solve other issues with hyperref as well.

The package hyperref should be the last loaded package, but it is not always the case as said in: Which packages should be loaded after hyperref instead of before?.

The package abntex2cite is one of those exceptions and must be loaded after hyperref.

The problem is: if you load hyperref after abntex2cite, the .bbl file will have errors and the references won't be properly written. And the references are the (main) reason to use abntex2cite. Therefore hyperref must come before abntex2cite.

But this leads to another problem. The links to footnotes will lead to the first page. To correct this issue, it is necessary to load the package setspace before `hyperref.

A MWE is given below:

\documentclass{article}
\usepackage{setspace} % Always before hyperref -- Enable correct footnote link
\usepackage{hyperref}
\usepackage[alf]{abntex2cite}   % Normas ABNT - After hyperref
\begin{document}
First Page.

With the package setspace before hyperref, the footnotes work properly.

Without the package setspace or if it is loaded after hyperref, the footnotes don't work properly.

\clearpage
This is the first footnote\footnote{Text 1.}.

\clearpage
This is the second footnote\footnote{Text 2.}.

\end{document}
FHZ
  • 3,939
3

For those using the apacite, babel and hyperef packages, this might work.

I loaded first all the other packages, then hyperref, then babel, then apacite.

% Load the rest of your packages here then use the order
    \usepackage[pdftex,bookmarks=true,colorlinks]{hyperref}
    \usepackage[latin1]{inputenc}
    \usepackage[english,spanish]{babel}
    \usepackage{apacite} 
\begin{document}
  • 2
    This really helped me, though I do not use apacite: changing the order of loaded packages by putting {hyperref} after {footmisc} solved my problem. – sg1234 Feb 13 '22 at 04:31