1

I have a bunch of "naked" subsections, i.e. not belonging to a section.

\documentclass[12pt,a4paper]{report}
  \usepackage{newtxtext, newtxmath}
  \usepackage{amssymb,amsmath}
  \usepackage[T1]{fontenc}
  \usepackage[utf8]{inputenc}
  \usepackage{hyperref}
  \hypersetup{unicode=true,
              pdfborder={0 0 0},
              breaklinks=true}
  \urlstyle{same}
\begin{document}
\chapter{First}
\subsection{Foo}
\subsection{Bar}
\subsection{Fizz}
\subsection{Buzz}

\chapter{Second}
\section{Sect}
\subsection{Foo}
\subsection{Bar}
\subsection{Fizz}
\subsection{Buzz}
\end{document}

The bookmark to the first subsection upgrades to a section bookmark, and all the rest subsection bookmarks seem to belong to this.

enter image description here

In the second chapter, with a section present, everything works OK. How can I have the subsection under the chapter, like this?

enter image description here

3
  • Loading the bookmark package might do the job.
    – epR8GaYuh
    Apr 17, 2018 at 14:59
  • Perfect! Just as simple as that! Please submit this as an answer, to accept it.
    – Theo
    Apr 17, 2018 at 15:33
  • 1
    A subsection without parental section is no subsection and a logically and typographically ill designed
    – user31729
    Apr 17, 2018 at 20:23

1 Answer 1

2

The bookmark package should fit your requirements. From the manual:

In the same way as hyperref the bookmarks are generated in the order of the bookmark generating macros (\bookmark). A level number is used to define the tree structure of the bookmarks. The restrictions are less strict:

  • The level values may jump and omit values. A \subsubsection may follow a \chapter. This was an error in hyperref, that prints a warning and tries to fix this.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .