\pdfbookmark
to point at the right location. In my own created list of appendices, the \addcontentsline
point to the correct location. I have tried placing the \pdfbookmark
line of code before, in-between and after \chapter
. The same problem occur with \section
and \subsection
. Hope anyone can help me out here 
Code: Select all
\documentclass{book}
% remove entry to toc, but keep no./letter in chapter/section:
\newcommand*{\nocontentsline}[3]{}
\newcommand*{\tocless}[2]{\bgroup\let\addcontentsline=\nocontentsline#1{#2}\egroup}
% chapter without toc entry, but listed in list of app and bookmarked:
\newcommand*\appChap[1]{%
\tocless%
\chapter{\thechapter{}: #1}%
\addcontentsline{app}{chapter}{\thechapter{}: #1}%
\pdfbookmark[0]{\thechapter{}: #1}{#1}%
}
% section, subsection and subsubsection:
\newcommand*\appSec[1]{\tocless\section{#1}\addcontentsline{app}{section}{\thesection{}: #1}\pdfbookmark[0]{\thesection{}: #1}{#1}}
\newcommand*\appSubSec[1]{\tocless\subsection{#1}\addcontentsline{app}{subsection}{\thesubsection{}: #1}\pdfbookmark[0]{\thesubsection{}: #1}{#1}}
\newcommand*\appSubSubSec[1]{\tocless\subsubsection{#1}\addcontentsline{app}{subsubsection}{\thesubsubsection{}: #1}}
% make list of appendices:
\makeatletter
\newcommand*\listofappendices{\chapter{List of Appendices}\@starttoc{app}}
\makeatother
\usepackage{appendix}
\usepackage{hyperref}
\usepackage{bookmark}
\begin{document}
\frontmatter
\phantomsection
\pdfbookmark[0]{Table of Contents}{toc}
\tableofcontents
\listofappendices
\mainmatter
\chapter{Chapter one}
\chapter{Chapter two}
\appendix
\cleardoublepage
\bookmarksetupnext{level=part}
\addappheadtotoc % adds a title to the table of contents
\appendixpage % adds a separate title “Appendices” above the first appendix
\begin{appendices}
\appChap{Appendix a}
...(contents of appendix a)...
\appSec{Appendix a - section 1}
...(contents of appendix one)...
\appSubSec{Appendix a - subsection 1}
...(contents of appendix one)...
\appSubSubSec{Appendix a - subsubsection 1}
...(contents of appendix one)...
\appChap{Appendix b}
...(contents of appendix two)...
\appSec{Appendix b - section 1}
...(contents of appendix two)...
\end{appendices}
\backmatter
\end{document}