1

I need to include a footnote in an equation, and as it turns out I need to reference both the equation and the footnote so I want to \label them.

Here is what I am tryng to do:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
    \begin{equation}
        \label{eq:sum}
        1+1=2\footnote{\label{fn:hello}Hello.}
    \end{equation}
\end{document}

And here is the result:

./test.tex:6: Package amsmath Error: Multiple \label's: label 'eq:sum' will be lost.

Any workaround?

  • 1
    slightly off-topic ... if the equation contains superscripts, the superscripted footnote marker could be a source of confusion for the reader. – barbara beeton Jun 26 '18 at 14:31
  • @barbarabeeton, I didn't include it in my example to keep it minimal, but what I really do is 1+1=2 \quad.\footnote{...} – scozy Jun 26 '18 at 19:55
2

A workaround is to split the \footnote in \footnotemark and \footnotetext:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
    \label{eq:sum}
    1+1=2\footnotemark
\end{equation}
\footnotetext{\label{fn:hello}Hello.}
See equation~\eqref{eq:sum} and footnote~\ref{fn:hello}.
\end{document}

another is to copy the definition of \label to another location beforehand and use the new name in the equation:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\let\LTXlabel\label
\begin{equation}
    \label{eq:sum}
    1+1=2\footnote{\LTXlabel{fn:hello}Hello.}
\end{equation}
See equation~\eqref{eq:sum} and footnote~\ref{fn:hello}.
\end{document}

amsmath.sty redefines the \label macro in display math mode to be:

\def\label@in@display{%
    \ifx\df@label\@empty\else
        \@amsmath@err{Multiple \string\label's:
            label '\df@label' will be lost}\@eha
    \fi
    \gdef\df@label
}

this is to ensure that there will be only as much labels as there are equations (for aligned equations, for example).

But this does not take into account that, for example, footnotes may use labels, which is still a valid, and will produce the correct output. This is why one needs to either externalize the usage of \label (as in the first workaround) or use the real \label (second workaround).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.