[Tex/LaTex] Difference between bookmark levels greater than one – what does this mean


When compiling my LaTeX file, I received this warning message.
Though I got the PDF file, I still want to know why this warning comes and how to fix it.

It occurs in this line.

\paragraph{Plane stress} Plane state of stress, a.k.a. plane stress, is a state of stress in which\[\sigma_{33}=\sigma_{31}=\sigma_{32}=0.\]

Warning: Difference (2) between bookmark levels is greater(hyperref) than one,
level fixed on input line 97. Difference (2) between bookmark levels
is greater(hyperref) than one, level fixed.

The question may be seemed dummy to some TeX experts, but as a newbie here, I really don't know how it comes.

I attempt to write two subsubsections, but without numbering them. So I choose the command \paragraph. Is there any work-arounds?

Best Answer

This happens when you skip a level in the sectioning commands while still requesting to maintain an equivalent bookmark hierarchy. The following MWE reproduces the problem:

enter image description here

\usepackage[bookmarksopen]{hyperref}% http://ctan.org/pkg/hyperref
\setcounter{tocdepth}{4}% Show up to level 4 (\paragraph) in ToC (and bookmarks)
\section{A section}
\subsection{A subsection}
\subsubsection{A subsubsection}
\paragraph{A paragraph}
\subparagraph{A subparagraph}
\section{A section}
\subsection{A subsection}
%\subsubsection{A subsubsection}% Left out \subsubsection
\paragraph{A paragraph}
\subparagraph{A subparagraph}

Note how the second \paragraph is at the same level as the preceding \subsubsection level.

To circumvent this warning, don't skip elements of the sectional hierarchy. Rather redefine them to suit your formatting needs. Specific to your example, using \subsubsection* (the starred variant of \subsubsection) would leave the titles unnumbered - similar to that of \paragraph. However, there are other ways (either manually, or via a package like titlesec, say).

Alternatively, loading the bookmark package overrides this warning.