GeneralAdd Bookmark of the ToC

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
tex-bird
Posts: 4
Joined: Thu Nov 03, 2011 5:10 pm

Add Bookmark of the ToC

Post by tex-bird »

Hello,

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
Last edited by tex-bird on Wed Dec 07, 2011 7:00 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

Post by Stefan Kottwitz »

Hello,

you could use \pdfbookmark:

Code: Select all

\cleardoublepage
\pdfbookmark{\contentsname}{toc}
\tableofcontents
Or use it with \addtocontents:

Code: Select all

\documentclass{book}
\usepackage{hyperref}
\begin{document}
\addtocontents{toc}{\protect{\pdfbookmark[0]{\contentsname}{toc}}}
\tableofcontents
\chapter{One}
\section{text}
\end{document}
Stefan
LaTeX.org admin
tex-bird
Posts: 4
Joined: Thu Nov 03, 2011 5:10 pm

Re: Add Bookmark of the ToC

Post by tex-bird »

Thank you very much. The first solution worked well. Thanks.
Post Reply