Theses, Books, Title pages ⇒ legrand-orange-book: restart chapter numbers in units without messing up toc
legrand-orange-book: restart chapter numbers in units without messing up toc
It has been a long time since I changed the code, but I used \setcounter{chapter}{0} before inputting the unit tex files so that the chapter number would reset in each unit. For example, Unit 2 would begin with Chapter 1, because before the chapter number would just keep going. Like, Unit 1 ends with Chapter 6 and then Unit 2 would begin with Chapter 7.
So I fixed that with the \setcounter code, but now the hyperlinks in the table of contents does not link to the correct chapter anymore. Is there a way I can keep my hyperlinks in the table of contents correct but also have the chapter number reset each unit?
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10328
- Joined: Mon Mar 10, 2008 9:44 pm
legrand-orange-book: restart chapter numbers in units without messing up toc
welcome to the forum!
Just make the internal
hyperref
anchor name unique. If you use \part
for the units:\renewcommand*{\theHchapter}{\thepart.\arabic{chapter}}
Btw. no problem if you have several questions, every question is welcome. And it was very good to make a separate topic for each question. I will have a look at the other questions after work.
Stefan
legrand-orange-book: restart chapter numbers in units without messing up toc
I was praying that no one ask for a mwe because my document is 300 pages long

- Stefan Kottwitz
- Site Admin
- Posts: 10328
- Joined: Mon Mar 10, 2008 9:44 pm
legrand-orange-book: restart chapter numbers in units without messing up toc

Just joking.

Thanks for the feedback,
Stefan