# Propertly restart chapter on unnumbered \part*

Following, this answer I've been able to start anew the \chapter numbering for each new \part. Unfortunately, that didn't affect the unnumbered \part*s.

Manually setting the counter (\setcounter{chapter}{0}), seems to do the job as long as hyperref is not involved. However, resetting the counter causes TOC to link the chapters in the unnumbered part to the chapters with the same local number from a previous part, which doesn't happen with automatically restarted chapters in numbered parts. E.g. "Discussion" points to "At First I Was Afraid".

\documentclass{report}
\usepackage{hyperref}
\makeatletter
\makeatother

\begin{document}
\tableofcontents
\chapter*{Foreword}
\chapter*{Achnowlegements}
\part*{Introduction}
\chapter{Background}
\chapter{Related Work}
\part{Where It All Begun...}
\chapter{At First I Was Afraid}
\chapter{I Was Petrified}
\part*{Discussion and Future Work}
\setcounter{chapter}{0}
\addcontentsline{toc}{part}{Discussion and Future Work}
\chapter{Discussion}
\chapter{Future Work}
\end{document}


\@add to reset{chapter}{part*} seems to have no effect at all.

What is the proper way to reset chapter numbering for both numbered and unnumbered parts?

• What's the reason for an unnumbered part? Assuming that resetting the chapter number at parts is a good idea, which it isn't. – egreg Jan 19 at 15:37
• The unnumbered parts are the "intro" and "outro", they don't really deserve a number in my book. – Necto Jan 19 at 16:46
• Neither you need to restart chapter numbers. – egreg Jan 19 at 16:59

You have to provide clues for hyperref in order to distinguish equally numbered chapters. This can be done by redefining \theHchapter. For the last part, provide a suitable value for \theHpart.

Of course, your internal references to chapters will be clumsy: “in chapter 1 of the introduction part” or “in chapter 3 of part II”.

Avoid resetting chapter numbers, if you are not compelled to by some devious rule.

\documentclass{report}
\usepackage{hyperref}

\counterwithin*{chapter}{part}
\renewcommand{\theHchapter}{\theHpart.\thechapter}

\begin{document}
\tableofcontents

\chapter*{Foreword}

\chapter*{Achnowlegements}

\part*{Introduction}

\chapter{Background}
\chapter{Related Work}

\part{Where It All Begun...}
\chapter{At First I Was Afraid}
\chapter{I Was Petrified}

\part*{Discussion and Future Work}
\setcounter{chapter}{0}\renewcommand{\theHpart}{DFW}
\addcontentsline{toc}{part}{Discussion and Future Work}

\chapter{Discussion}
\chapter{Future Work}

\end{document}