2

I am trying to specifically silence a warning which happens a a specific file called bigfoot.sty bigfoot.sty:61: Package hyperref Warning: Option `hyperfootnotes' has already been used

Looking over the silence package documentation http://linorg.usp.br/CTAN/macros/latex/contrib/silence/silence-doc.pdf it seems impossible to silence a warning for a specific line as on input line 61.

However, can I silence a warning which is coming from a file like bigfoot.sty?

This is the code I tried to so far:

\documentclass{memoir}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage{silence}
\WarningFilter*{hyperref}{Option `hyperfootnotes' has already been used,\MessageBreak setting the option has no effect on input line 61.}

\usepackage{hyperref}
\usepackage{bigfoot}

\begin{document}

    Bit cut\footnote{bigfoot}.

\end{document}

But due the on input line 61. at the end of the warning, it is not being silenced.

This is the warning:

D:\User\Documents\latex\texmfs\install\tex\latex\bigfoot\bigfoot.sty:61: Package hyperref Warning: Option `hyperfootnotes' has already been used,
(hyperref)                setting the option has no effect on input line 61.
user
  • 4,745

1 Answers1

2

For this specific message, you can silence it using

\makeatletter
\let\tempHOD\Hy@WarnOptionDisabled
\renewcommand{\Hy@WarnOptionDisabled}[1]{}
\usepackage{bigfoot}
\let\Hy@WarnOptionDisabled\tempHOD
\makeatother

If you want to ignore this warning specifically for a call that uses hyperfootnotes, you can check whether that option is passed using

\renewcommand{\Hy@WarnOptionDisabled}[1]{%
  \ifnum\pdfstrcmp{#1}{hyperfootnotes}=0\else
    \tempHOD{#1}%
  \fi}

Fundamentally though, the problem arises from an inappropriate loading order. Loading in the order

\usepackage{bigfoot}
\usepackage{hyperref}

runs without warning.

Werner
  • 603,163