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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10360
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