1

I am trying to silence the warning from the question bigfoot.sty:61: Package hyperref Warning: Option `hyperfootnotes' has already been used

I tried:

\usepackage{silence}
\WarningFilter*{hyperref}{Option `hyperfootnotes' has already been used}

\usepackage{hyperref}
\usepackage{bigfoot}

And it works, however I want to only silence that warning which specifically points to the line 61, not all the other warning which just starts with:

Option `hyperfootnotes' has already been used

Then I tried writing:

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

And:

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

But none of them worked. How can I silence a multi line warning?

...(D:\User\Documents\latex\texmfs\install\tex\latex\oberdiek\rerunfilecheck.sty
Package: rerunfilecheck 2016/05/16 v1.8 Rerun checks for auxiliary files (HO)
Package uniquecounter Info: New unique counter `rerunfilecheck' on input line 2
82.
)
\Hy@SectionHShift=\skip185
) (D:\User\Documents\latex\texmfs\install\tex\latex\bigfoot\bigfoot.sty
Package: bigfoot 2015/08/30 2.1 makes footnotes work


Package hyperref Warning: Option `hyperfootnotes' has already been used,
(hyperref)                setting the option has no effect on input line 61.

(D:\User\Documents\latex\texmfs\install\tex\latex\ncctools\manyfoot.sty
Package: manyfoot 2005/09/11 v1.10 Many Footnote Levels Package (NCC)

(D:\User\Documents\latex\texmfs\install\tex\latex\ncctools\nccfoots.sty
Package: nccfoots 2005/02/03 v1.2 NCC Footnotes Package (NCC)
)
...

Minimal Example:

\documentclass{memoir}

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

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

\usepackage{hyperref}
\usepackage{bigfoot}

\begin{document}

    Bit cut\footnote{bigfoot}.

\end{document}
user
  • 4,745

1 Answers1

3

To silence a multi-line warning, you need to include the appropriate code associated with the warning. Let's see what the actual message is from hyperref via the macro \Hy@WarnOptionDisabled:

\def\Hy@WarnOptionDisabled#1{%
  \Hy@Warning{%
    Option `#1' has already been used,\MessageBreak
    setting the option has no effect%
  }%
}

The warning includes a \MessageBreak, so one can do the following:

\documentclass{article}

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

\usepackage{hyperref}
\usepackage{bigfoot}

\begin{document}

Text.

\end{document}

Note though that on line 61. does not form part of the warning message. Instead, on line < lineno >. forms part of the kernel macro that is with any warning that results in a (subsequent) call to \GenericWarning:

\def\on@line{ on input line \the\inputlineno}
%...
\DeclareRobustCommand{\GenericWarning}[2]{%
   \begingroup
      \def\MessageBreak{^^J#1}%
      \set@display@protect
      \immediate\write\@unused{^^J#2\on@line.^^J}%
   \endgroup
}
Werner
  • 603,163