13

I use something like the following to get a footnote without an anchor.

\documentclass{article}
\usepackage{hyperref}
\begin{document}
{\let\thefootnote\relax\footnotetext{2010 Mathematics Subject Classification: 05A05, 05A16.}}
\end{document}

The hyperref package doesn't like this and produces a warning. Is there something simple I can do to prevent the warning? (I prefer to have no warnings.) I do want hyperref to create links for normal footnotes.

A more general question (which should answer the specific one): Is there a command that locally disables hyperref from creating a link?

2 Answers2

15

To get unnumbered footnotes, I would suggest defining a custom command as shown in the following MWE:

\documentclass{article}
\usepackage{hyperref}

\newcommand\nnfootnote[1]{%
  \begin{NoHyper}
  \renewcommand\thefootnote{}\footnote{#1}%
  \addtocounter{footnote}{-1}%
  \end{NoHyper}
}
\begin{document}
\nnfootnote{2010 Mathematics Subject Classification: 05A05, 05A16.}
\end{document}

The NoHyper environment additionally ensures that there is no hyperlink from the text to the footnote.

leandriis
  • 62,593
  • 1
    The NoHyper environment it is then. That appears not to be mentioned in the hyperref docs. But is in https://tex.stackexchange.com/questions/118182/selectively-turn-off-hyperref-links-for-citations. – David Bevan Feb 16 '18 at 13:15
  • 3
    I think you loose the "cliccability" of links, as in \nnfotnote{...\url{https://tex.stackexchange.com/a/415633/56076}...} – Matteo Gamboz Mar 08 '21 at 17:01
1

You can eliminate all hyperref warnings, including the unwanted

Package hyperref Warning: Ignoring empty anchor

by adding this inside your group before the \footnotetext:

\makeatletter\def\Hy@Warning#1{}\makeatother

(I agree with the suggestion to make it into a macro, but leaving that aside here.)

Let's hope there are no real hyperref warnings in the text, because they would be silenced as well.

Obviously this is tinkering with the internal workings, not any kind of guaranteed interface, but FWIW ...

Karl Berry
  • 2,102