Multiple parts with chapter number reset at each part -- how do I make hyperlinks go where they supposed to?

1k Views Asked by At

I have a book document class which has several parts marked off with \part{THE BEGINNING} and the chapters reset using \setcounter{chapter}{0} with each successive \part{}. This works fine. But I also want to use the hyperref package. With that, if I click on, say, chapter 1 in Part 3 in the table of contents, I'm taken to chapter 1 in Part 1. How do I make the links go where they're supposed to?

\documentclass{book}
\usepackage{lipsum}
\usepackage{hyperref}

\begin{document}

\tableofcontents

\part{THE BEGINNING}
\chapter{AAAA}
\lipsum[1-5]

\chapter{BBBB}
\lipsum[6-10]


\part{THE MIDDLE}
\setcounter{chapter}{0}
\chapter{CCCC}
\lipsum[11-15]

\chapter{DDDD}
\lipsum[16-20]

\part{THE END}
\setcounter{chapter}{0}
\chapter{EEEE}
\lipsum[21-25]

\chapter{FFFF}
\lipsum[26-30]

\end{document}
0

There are 0 best solutions below