# how to end chapter* and start chapter

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.

-
What document class are you using? Also, are you only loading hyperref, or bookmark as well? Or how do you add things like \tableofcontents to your bookmarks? – Werner Aug 22 '12 at 19:26
I am using \usepackage[bookmarks=true]{hyperref}. The bookmarks get generated automatically when i use the bookmarks=true. I have not done anything on my own. – A. K. Aug 22 '12 at 19:33
You should make a short compileable example file just consisting of the chapter headings which demonstrates the described behaviour. – Stephan Lehmke Aug 22 '12 at 19:36
I am not completely sure what your problem is. But you might want to have a look at a recent question of mine tex.stackexchange.com/q/66642/16865 I think your problem is similar. In any case you should load the bookmark package which enables you to influence the behaviour of bookmarks, see ftp.rrzn.uni-hannover.de/pub/mirror/tex-archive/macros/latex/… – lpdbw Aug 22 '12 at 19:49
someone just answered that I should put \phantomsection along with the starred chapters . It actually worked!. Please re-write that as the answer. Thanks. – A. K. Aug 22 '12 at 20:34

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}

-
\phantomsection before \pdfbookmark is not needed, because the letter already sets an anchor. – Heiko Oberdiek Aug 22 '12 at 22:37
your solution helped me get what i wanted. using \phantomsection was enough. Thanks – A. K. Aug 23 '12 at 5:44
@Heiko Thanks for comment. Have now removed \phantomsection from my answer. – lpdbw Aug 23 '12 at 6:54

I guess that your problem is the lake of the line \addcontentsline{file}{sec_unit}{entry} after your \chapter*{entry}.

• file: Refers to the file you want to add a line. In your case, toc, for tableofcontents
• sec_unit: Sectioning type. In your case a chapter.
• entry: The line you want to add. Say, the name of the chapter.

I'd illustrate its use with an example. Imagine your stared chapter is called Introduction. Thus, you should add a chapter line to the tableofcontents, called toc, then in your code use this,

\documentclass{report}

\begin{document}

\tableofcontents

\chapter*{Introduction}