80

According to the Latex wikibook the workaround for having multiple references to the same footnote with hyperref support is this:

\footnote{This is the footnote}\addtocounter{footnote}{-1}\addtocounter{Hfootnote}{-1}

I could of course simply wrap this in a new command, but I wonder if there is any package that handles this elegantly, preferably with an option to refer to footnotes using labels. The way proposed above also screws up if there are other footnotes in between. The \footref command from the footmisc package does something like that, but it does not have full hyperref support. Does anyone know of a package that can do this?

2

11 Answers 11

20

I'm not sure if this is what you're asking for, but I think these macros do what you want:

\documentclass{article}
\usepackage{hyperref}

\newcommand{\footlabel}[2]{%
    \addtocounter{footnote}{1}%
    \footnotetext[\thefootnote]{%
        \addtocounter{footnote}{-1}%
        \refstepcounter{footnote}\label{#1}%
        #2%
    }%
    $^{\ref{#1}}$%
}

\newcommand{\footref}[1]{%
    $^{\ref{#1}}$%
}

%\newcounter{normalfootc}
%\renewcommand{\footnote}[1]{%
%    \footlabel{footsaferefiwontuse\thenormalfootc}{#1}%
%    \addtocounter{normalfootc}{1}%
%}

\begin{document}

This is a sentence with a footnote\footlabel{rom}{this is the adapted footnote} in it. 
This second sentence points to the same footnote,\footref{rom} so you don't have 
to write it all over again. As you can see, the macro's work in conjuncture with 
the normal\footnote{this is a normal footnote} footnote. 
Though there is a small discrepancy in how the links are displayed.

\end{document}

The macro \footlabel{<label>}{<foonote text>}creates the footnote and gives it a label that can later be accessed by using \footref{<label>}.

There's one slight problem with these macro's though: they produce a slightly different "box" for the hyperref link (default is a red box) which might be unwanted if you're aiming for ultimate consistency. This won't be a problem if you have already redefined your hyperref link style to be something else. You could also use the \footlabel command without any label argument for all your footnotes (even the normal ones) to make everything consistent again.

This in the preamble makes it consistent again:

\newcounter{normalfootc}
\renewcommand{\footnote}[1]{%
    \footlabel{footsaferefiwontuse\thenormalfootc}{#1}%
    \addtocounter{normalfootc}{1}%
}

Hope this helps!

2
  • Remaining issue: When the reference to the referenced footnote is not placed after that footnote, but another footnote is between referenced footnote and reference, then the in-between-footnote also links to the referenced footnotetext, e.g.: \footlabel{rom}{1} \footnote{2} \footref{rom} writes 1 2 1 but links aim at 1 1 1. This might be OK for the OP, but a warning about this might be appropriate for other users (especially because the cleveref solution does not show this issue).
    – Stephen
    Commented Mar 12, 2012 at 17:10
  • There's other problems, for example it does not work with package paracol and \footnotestyle{p}. But using cleveref as suggested in Jake's answer does ... I won't downvote this as there's plain contexts where this will work. The upvote goes to Jake though ;-)
    – takrl
    Commented Dec 19, 2015 at 8:01
94

You can use the cleveref package (which is useful in any case) and redefine the reference style for footnotes with a single line. Then you just reference your footnotes (and any other material) using \cref{<label>}.

\documentclass{article}
\usepackage{hyperref}
\usepackage{cleveref}[2012/02/15]% v0.18.4; 
% 0.16.1 of May 2010 would be sufficient, but what is the exact day?

\crefformat{footnote}{#2\footnotemark[#1]#3}

\begin{document}
First page, referencing future footnote\cref{second}.

Second paragraph, first footnote\footnote{\label{first}First footnote!}

\pagebreak
Second page, creating the second footnote\footnote{\label{second}Second footnote}, 
and referencing the first footnote\cref{first}.
\end{document}
16
  • 2
    This generates artefact ?? when using the \cref command on my machine.
    – romeovs
    Commented Feb 2, 2011 at 22:36
  • 1
    @romeovs Have you run LaTeX twice? That's usually necessary when using labels and references.
    – Jake
    Commented Feb 2, 2011 at 22:37
  • @Jake Yes I did. There are double ?? in the first run, half of which disappear in the second run. E.g. I get: ` future footnote?? 2.`
    – romeovs
    Commented Feb 2, 2011 at 22:48
  • 9
    Ok, so, I've figured it out. This solution doesn't work if the footnotes are referenced from a table cell. In such case, this other question is relevant: tex.stackexchange.com/questions/95866/… Commented Mar 6, 2014 at 14:34
  • 1
    @Jake With Cleveref dated 2013/12/28 (I think), the line \crefformat{footnote}{#2\footnotemark[#1]#3} is not only unnecessary but causes in fact an error. Without it, it just works beautifully!
    – schremmer
    Commented Jan 4, 2018 at 20:36
61

I found the following to be the easiest to implement:

First sentence.\footnote{\label{footnote-label} footnote content}

Second sentence.\textsuperscript{\ref{footnote-label}}

Since I never use anything but \ref, and I do not mess with LaTeX's counters, hyperref behaves as expected. You could use macros to automate these choices:

\newcommand{\savefootnote}[2]{\footnote{\label{#1}#2}}
\newcommand{\repeatfootnote}[1]{\textsuperscript{\ref{#1}}}

First sentence.\savefootnote{footnote-label}{footnote content}

Second sentence.\repeatfootnote{footnote-label}
7
  • 12
    So much simpler than the other complicated choices, thank you!
    – J M
    Commented Jun 28, 2016 at 18:46
  • 2
    To mimic the code of \footnote, I believe that \textsuperscript should be followed by \normalfont. Also, to prevent weird breakage, \label should be \protect\label.
    – Michaël
    Commented Jan 20, 2017 at 16:00
  • 1
    It results in a compressed reference box due to the command \textsuperscript. I tried to replace with $^{\ref{footnote-label}}$, but it couldn't be recognized by Tex with error "too many }'s". Can anybody help?
    – Roger Yau
    Commented Jun 1, 2017 at 2:22
  • It does not seem to cooperate with package hyperref. The reference is not clickable in PDF. Commented Apr 9, 2018 at 12:51
  • This approach mostly works for me (I should mention that I'm trying to do this within a minipage), except that with hyperref all of the explicit \textsuperscript marks link to the location of the first explicit \textsuperscript mark. Commented May 2, 2018 at 1:26
15

For completeness' sake: the KOMA-Script classes also have a \footref that works fine with hyperref.

\documentclass{scrartcl}
\usepackage{hyperref}
\begin{document}

Some text\footnote{Some footnote text.\label{fn:first}} and more text with
the same footnote referenced.\footref{fn:first}

Some text\footnote{Some footnote text.\label{fn:second}} and more text with
the both footnotes\footref{fn:first} referenced.\footref{fn:second}

You also can reference\footref{fn:third} the footnote\footnote{Like this.\label{fn:third}}
before the actual footnote.

% let's see if `hyperref' works:
\newpage\null
\end{document}

In case you can't or won't use a KOMA-Script class you can load the scrextend package (part of the KOMA-Script bundle) and the functionality anyway:

\documentclass{article}
\usepackage{scrextend}
\usepackage{hyperref}
\begin{document}

Some text\footnote{Some footnote text.\label{fn:first}} and more text with
the same footnote referenced.\footref{fn:first}

Some text\footnote{Some footnote text.\label{fn:second}} and more text with
the both footnotes\footref{fn:first} referenced.\footref{fn:second}

You also can reference\footref{fn:third} the footnote\footnote{Like this.\label{fn:third}}
before the actual footnote.

% let's see if `hyperref' works:
\newpage\null
\end{document}
6
  • I tried using your solution and the symbol for footnote really shows, but it has no hyperlink on it. So when I click it it won't take me to the footnote.
    – 71GA
    Commented Jan 2, 2017 at 12:01
  • @71GA the code I posted does give hyperlinks!
    – cgnieder
    Commented Jan 2, 2017 at 15:36
  • @clemens Would this also work for \documentclass type article? Commented May 17, 2017 at 13:20
  • @rudreshdwivedi have a look at the last code example in my answer
    – cgnieder
    Commented May 17, 2017 at 13:33
  • @clemens solved :) when i removed hyperref package Commented May 17, 2017 at 13:43
9

An old question, but I just found out that a simple

\newcommand{\footref}[1]{\textsuperscript{\ref{#1}}}

will suffice:

\documentclass{article}
\usepackage{hyperref}

\newcommand{\footref}[1]{\textsuperscript{\ref{#1}}}

\begin{document}

Some footnote.\footnote{Text.\label{footnote}} And referencing the same footnote.\footref{footnote}

\end{document}
1
  • 1
    thanks @joseph. i agree, this is a fairly straightforward and good fix. Commented Sep 26, 2017 at 1:44
5

cleveref, as proposed by Jake, really solves the problem and is my preferred solution (+1 for it). Just in case that you cannot use it (maybe due to an old version without possibility to update) you can use this replacement :

\documentclass{article}
\usepackage{hyperref}

\makeatletter
\newcommand{\footnoteref}[1]{%
% requires a label to be present in the footnote to be referenced!
\ltx@ifpackageloaded{hyperref}{% hyperref package loaded
  \ifHy@hyperfootnotes% option hyperfootnotes=true
    \hbox{\hyperref[#1]{%
            % once upon a time this was not "#1" but "\footnote@reference", 
            % but somewhere something changed at some time
            \@textsuperscript {\normalfont \ref*{#1}}}}%
  \else% option hyperfootnotes=false
    \hbox{\@textsuperscript {\normalfont \ref*{#1}}}%
  \fi%
}{% hyperref package not loaded
    \hbox{\@textsuperscript {\normalfont \ref{#1}}}%
 }%
}
\makeatother

\begin{document}
First page, referencing future footnote\footnoteref{second}.

Second paragraph, first footnote\footnote{\label{first}First footnote!}

\pagebreak
Second page, creating the second footnote\footnote{\label{second}Second footnote},
and referencing the first footnote\footnoteref{first}.

\pagebreak
Last paragraph\footnote{last footnote}.

\end{document}

The references look exacly like the ones set by hyperref, and if hyperref is used with hyperfootnotes=false or hyperref is not used, the references are just placed but not hyperlinked (but also cleveref would handle this!).

3

Not sure if packages have been updated but footmisc works fine with hyperref in this example:

\documentclass{article}

\usepackage{footmisc}
\usepackage{hyperref}

\begin{document}

Text with the first footnote\footnote{\label{footnote1}Footnote 1} and text with
the second footnote\footnote{Footnote 2}.

In this paragraph we have a reference to the first footnote\footref{footnote1}.

\end{document}
2

To repeat the footnote mark is in general not a good idea, because by convention the footnote marks must appear on the same page as the footnote itself. There is no way you can ensure this to happen, because TeX breaks the page where it wants. Endnotes are more appropriate here.

Where repeated footnote marks are often used is inside tables, but there you need a lot of fiddling because the normal footnote mechanism does not work in inner environments such as tables, equations, etc.

Below is an example that will do what you requested. It is the basic mechanism that I have build into the refstyle package.

Please note that a minipage has its own footnote mechanism that is reset every time it is called. Also note that the label must be inside the footnote itself, because it is not visible outside it.

\documentclass{article}
\usepackage{hyperref}
\makeatletter
\newcommand{\reffnmark}[1]{%
    \begingroup
        \unrestored@protected@xdef\@thefnmark{\ref{#1}}%
    \endgroup
    \@footnotemark}
\makeatother

\begin{document}
\section{First}

This is a footnote test\footnote{first footnote\label{fn:first}}\par
This is a second footnote test\footnote{second footnote\label{fn:sec}}\par
This is a footnote mark\reffnmark{fn:first} link to footnote~\ref{fn:first}.\par

\fbox{\begin{minipage}{0.5\hsize}
 This is a footnote test in a mini page\footnote{first footnote\label{fn:mp}}.\par
 This is a footnote mark\reffnmark{fn:mp} link to footnote~\ref{fn:mp}
\end{minipage}}
\end{document}
2
  • 2
    There is a problem with this solution: The references generate two hyperlink areas i.sstatic.net/gdT7q.png While clicking into the upper left/inner area jumps to the correct footnotetext, clicking into the lower right/outer area jumps to the beginning of the document. The log-file says: pdfTeX warning (dest): name{Hfootnote.5} has been referenced but does not exist, replaced by a fixed one (same for Hfootnote.3)
    – Stephen
    Commented Mar 12, 2012 at 17:09
  • 1
    "To repeat the footnote mark is in general not a good idea" But this is really common for affiliations: Smith, A. ^1, Miller, B. ^2, Williams, C. ^1 1 Institute for Research on Footnotes, A-town. 2 Footnotes Reasearch & Developement, Inc., B-town. (especially if there is a list of 20 authors with 14 affiliations, and some of the authors have even more than one affiliation.)
    – Stephen
    Commented Mar 12, 2012 at 17:09
2

The footmisc package works like charm for multiple hyperref's to same foot note, it doesn't matter if you use numbers or symbols for your foot notes.

\documentclass{article}

\usepackage{footmisc}           % Numbers.
%\usepackage[symbol]{footmisc}  % Symbols.
\usepackage{hyperref}

\begin{document}

Text with future reference\footref{note}.
Text that creates the reference\footnote{\label{note}Text of the reference}.
Text that references the same note\footref{note}.

\end{document}
2
  • How is your answer different from this one? Commented Feb 7, 2022 at 19:44
  • 1
    It has multiple references and shows that you can use symbolic or numered footnotes. Commented Feb 7, 2022 at 22:02
1

do not change:

\documentclass{article}
\usepackage{hyperref}
\makeatletter
\newcommand{\reffnmark}[1]{%
    \begingroup
        \unrestored@protected@xdef\@thefnmark{\ref{#1}}%
    \endgroup
    \@footnotemark}
\makeatother

\begin{document}
\section{First}

This is a footnote test\footnote{first footnote\label{fn:first}}\par
This is a second footnote test\footnote{second footnote\label{fn:sec}}\par
This is a footnote mark\reffnmark{fn:first} link to footnote~\ref{fn:first}.\par

\fbox{\begin{minipage}{0.5\hsize}
 This is a footnote test in a mini page\footnote{first footnote\label{fn:mp}}.\par
 This is a footnote mark\reffnmark{fn:mp} link to footnote~\ref{fn:mp}
\end{minipage}}
\end{document}
1
  • 1
    Welcome to TeX.SE! please do not only post code, explain what it does and how it solved the given problem ...
    – Mensch
    Commented Jan 7, 2017 at 15:30
1

The fixfoot package is another interesting solution. It defines footnotes with possibly reoccurring text:

\DeclareFixedFootnote{\prooflater}{This theorem will be proved later}
\DeclareFixedFootnote*{\sic}{\emph{sic}}

You can use the commands whereever \sic you want\prooflater. In case the footnote would be placed \sic on the same page, it won't be printed twice, but still referenced twice.

The starred version uses xspace to ease use of the command. Otherwise, one had to write \sic{} text.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .