1

In the code below, I'd like to silence the hyperref warning that complains about skipping the level chapter between part and section.

\documentclass{book}
\usepackage{hyperref}
\usepackage{silence}
\WarningFilter{hyperref}{Difference (2) between bookmark levels is greater than one}
% -------------------
\begin{document}
\part{}
\section{}
\end{document}

Unfortunately this didn't work, and my log file is still showing:

enter image description here

What's the problem here?

2

By trial and error I found that it works if

  1. You load hyperref last and
  2. use \WarningFilter*, where one truncates the line at the same breaking point as e.g. in pdfmark.def.

Since this seems to be the only warning message of this type, it should be OK

\documentclass{book}
\usepackage{silence}
\WarningFilter*{hyperref}{Difference (\the\@tempcnta) between bookmark levels is}
\usepackage{hyperref}
% -------------------
\begin{document}
\part{}
\section{}
\end{document}
|improve this answer|||||
1

Use the bookmark package instead:

\documentclass{book}
\usepackage{bookmark}
\begin{document}
\part{A}
\section{B}
\end{document}
|improve this answer|||||

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.