0
votes

TeX file is compiled to dvi by dvipdfm. I've been using such technique about 20 years. Everything was Ok until I need paragraph level. Table of contents is correct, hyperref s are working, but bookmarks in pdf-file for paragraphs are incorrect: each paragraph bookmark contains the next one as sublevel. The source code (file test.tex) is following:

\documentclass[12pt,a4paper,sumlimits,intlimits,namelimits,openany,twoside]{book}

\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[greek,english]{babel}
\usepackage{makeidx,multicol,ifthen,verbatim,layout}

\selectlanguage{english}

\usepackage[hyperindex,bookmarksnumbered,%colorlinks,
     dvipdfmx,bookmarks]{hyperref}
\usepackage{amsmath,amsthm,amsfonts,amssymb}

\numberwithin{paragraph}{chapter}

\begin{document}
\setcounter{secnumdepth}4%\setcounter{tocdepth}{4}
\setcounter{tocdepth}4
\tableofcontents
\newpage

\chapter{The Lebesgue theory}
\section{Set functions}
\paragraph{Definition (ring)}
\paragraph{Definition (additive set function)}
\paragraph{Theorem (continuity of additive set function)}

\section{Construction   of  the  Lebesgue   measure}
\paragraph{Definition (ring of elementary sets)}
\paragraph{Definition (regular set function)}
\end{document}

File test.toc (generated automatically by LaTeX) is following:

\babel@toc {english}{}
\babel@toc {english}{}
\contentsline {chapter}{\numberline {1}The Lebesgue theory}{2}{chapter.1}
\contentsline {section}{\numberline {1.1}Set functions}{2}{section.1.1}
\contentsline {paragraph}{\numberline {1.1}Definition (ring)}{2}{paragraph.1.1}
\contentsline {paragraph}{\numberline {1.2}Definition (additive set function)}{2}{paragraph.1.2}
\contentsline {paragraph}{\numberline {1.3}Theorem (continuity of additive set function)}{2}{paragraph.1.3}
\contentsline {section}{\numberline {1.2}Construction of the Lebesgue measure}{2}{section.1.2}
\contentsline {paragraph}{\numberline {1.1}Definition (ring of elementary sets)}{2}{paragraph.1.1}
\contentsline {paragraph}{\numberline {1.2}Definition (regular set function)}{2}{paragraph.1.2}

File test.out (generated automatically by LaTeX) is following:

\BOOKMARK [0][-]{chapter.1}{1 The Lebesgue theory}{}% 1
\BOOKMARK [1][-]{section.1.1}{1.1 Set functions}{chapter.1}% 2
\BOOKMARK [2][-]{paragraph.1.1}{1.1 Definition \(ring\)}{section.1.1}% 3
\BOOKMARK [3][-]{paragraph.1.2}{1.2 Definition \(additive set function\)}{paragraph.1.1}% 4
\BOOKMARK [4][-]{paragraph.1.3}{1.3 Theorem \(continuity of additive set function\)}{paragraph.1.2}% 5
\BOOKMARK [1][-]{section.1.2}{1.2 Construction of the Lebesgue measure}{chapter.1}% 6
\BOOKMARK [2][-]{paragraph.1.1}{1.1 Definition \(ring of elementary sets\)}{section.1.2}% 7
\BOOKMARK [3][-]{paragraph.1.2}{1.2 Definition \(regular set function\)}{paragraph.1.1}% 8

Thanks in advance for any idea.

1

1 Answers

0
votes

The reason of some strange behaviour of paragraph bookmarks is that I used \paragraph within \section skipping two levels: \subsection and \subsubsection. So, package hyperref treats such level gap as a problem and try to fix it, lifting bookmark level by 1 (and only by 1) per each step. I've got these warning in test.log:

Chapter 1.

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


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


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

...

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

Unfortunately, the only found remedy is to use sectioning command witjout skipping levels; in my case, I need to use \subsection instead of '\paragraph`. This oddity of hyperref is described in many sources, see e.g. here.