1

My initial question was answered, but now a new issue has arisen. It relates to the bookmarks in the PDF. I am working with Overleaf, which does not have the current hyperref but an older one. In the following MWE the backmatter chapters are ordered under the 'February' bookmark. But I don't want that. How do I prevent this? I would just like the bookmarks of the backmatter to be created the way the bookmarks for the frontmatter are.

\documentclass{book}
\usepackage[hidelinks, bookmarksopen=false]{hyperref}
\usepackage{bookmark}

\begin{document}

\frontmatter

\chapter{preface}
\chapter{introduction}

\mainmatter

\hypertarget{jan}{}
\bookmark[level=part,dest=jan]{January}
\chapter{1 jan}First January lecture
\chapter{2 jan}Another January lecture
\chapter{3 jan}Another January lecture

\cleardoublepage
\hypertarget{feb}{}
\bookmark[level=part,dest=feb]{February}
\chapter{1 feb}First February lecture
\chapter{2 feb}Another February lecture
\chapter{2 feb}Another February lecture
\chapter{3 feb}Another February lecture


\cleardoublepage
\backmatter
\chapter{appendix A}
\chapter{appendix B}

\end{document} 

1 Answer 1

2

I found the answer in the bookmark documentation. It is to start a new tree immediately after the \backmatter by adding \bookmarksetup{startatroot}:

\documentclass{book}
\usepackage[hidelinks, bookmarksopen=false]{hyperref}
\usepackage{bookmark}

\begin{document}

\frontmatter
\chapter{introduction}

\hypertarget{jan}{}
\bookmark[level=part,dest=jan]{January}
\chapter{1 jan}First January lecture
\chapter{2 jan}Another January lecture
\chapter{3 jan}Another January lecture
\cleardoublepage
\hypertarget{feb}{}
\bookmark[level=part,dest=feb]{February}
\chapter{1 feb}First February lecture
\chapter{2 feb}Another February lecture
\chapter{3 feb}Another February lecture

\cleardoublepage
\backmatter
\bookmarksetup{startatroot}
\chapter{appendix A}
\chapter{appendix B}

\end{document}

You must log in to answer this question.

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