General ⇒ Add Bookmark of the ToC
Add Bookmark of the ToC
When I open the file that i am working on using latex in a PDF reader, on the left side bar of the PDF reader there is a bookmark. All the chapters, sections are there, but not the ToC. How can I direct so that the ToC link also appear in the bookmark bar in the PDF reader?
Thanks
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: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Add Bookmark of the ToC
you could use \pdfbookmark:
Code: Select all
\cleardoublepage
\pdfbookmark{\contentsname}{toc}
\tableofcontents
Code: Select all
\documentclass{book}
\usepackage{hyperref}
\begin{document}
\addtocontents{toc}{\protect{\pdfbookmark[0]{\contentsname}{toc}}}
\tableofcontents
\chapter{One}
\section{text}
\end{document}