[Tex/LaTex] how to end chapter* and start chapter

chaptershyperrefthesis

In my thesis template, the dedication and acknowledgements are chapter*{} while other chapters are chapter{}. The problem comes using the hyperref-bookmarks. What happens is the table of contents, appear nested in the acknowledgement section.
The list of figure nests in the table of contents, and the list of tables in list of figures.

Best Answer

Maybe not the most elegant solution ...

\documentclass{book}

\usepackage{lipsum}
\usepackage{hyperref}
\usepackage{bookmark}

\begin{document}

\bookmarksetup{depth=-1}

\cleardoublepage
\pdfbookmark[0]{Preface}{preface}
\chapter*{Preface}
\lipsum

\cleardoublepage
\pdfbookmark[0]{Acknowledgments}{acknowledgements}
\chapter*{Acknowledgements}
Thanks to everybody.

\cleardoublepage
\pdfbookmark[0]{Contents}{toc}
\tableofcontents

\bookmarksetup{depth=0} %or a number >0

\chapter{First chapter}
\lipsum

\end{document}
Related Question