1

I am using package hyperref. When I click at Chapter one of part two in PDF file, I jump to Chapter one of part one. How can I jump to Chapter one of part two? My code

\documentclass[12pt,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{hyperref}
\begin{document}
    \tableofcontents
    \part{Part One}
    \chapter{Chapter one}
    \section{Section one}
        \section{Section two}
        \chapter{Chapter two}
    \section{Section three}
    \section{Section four}  
        \part{Part One}
        \setcounter{chapter}0
    \chapter{Chapter one}
    \section{Section one}
    \section{Section two}
    \chapter{Chapter two}
    \section{Section three}
    \section{Section four}  
\end{document}

enter image description here

2
  • 1
    Adding \makeatletter \@addtoreset{chapter}{part} \makeatother to the preamble instead of using \setcounter{chapter}0 as described in the answer to How to reset chapter and section counter with \part should also work in your example: Alternatively, \counterwithin*{chapter}{part} should also do the trick.
    – leandriis
    Nov 6 '21 at 11:41
  • 1
    Redefine \theHchapter so that is has a unique value for every chapter Nov 6 '21 at 11:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.