[Tex/LaTex] How to link Table of Contents in thesis PDF

hyperreftable of contents

I used the following code and I am able to link references, List of Symbols but unable to link the Table of Contents in my thesis. I wish a completely linked PDF of my thesis.
Please help me….

\usepackage[%
%\ifpdf
 pdftex,
%\else
% dvipdf,
%\fi
% ps2pdf, % using ps2pdf vs pdftex
% colorlinks=true, % color the words instead of use a colored box
% urlcolor=blue, % \href{...}{...} external (URL)
% filecolor=blue, % \href{...} local file
% linkcolor=black, % \ref{...} and \pageref{...}
% citecolor=black, % \cite{}
pdfborder={0 0 0}, % for removing borders around links
letterpaper=true,
plainpages=false,
% plainpages boolean true
% Forces page anchors to be named by the arabic form of the page number,
% rather than the formatted form.
breaklinks=true,
% breaklinks boolean false
% Allows link text to break across lines; since this cannot be accommodated in
% PDF, it is only set true by default if the pdftex driver is used. This makes
% links on multiple lines into different PDF links to the same target.
pagebackref=true,
% Adds ?backlink? text to the end of each item in the bibliography, as a list
% of section numbers. This can only work properly if there is a blank line
% after each \bibitem.
bookmarksnumbered=true,
% bookmarksnumbered boolean false
% If Acrobat bookmarks are requested, include section numbers.
bookmarksopen=true,
% bookmarksopen boolean false
% If Acrobat bookmarks are requested, show them with all the subtrees expanded.
pdftitle={PhD Thesis},
pdfauthor={Jonathan M. McCune},
pdfsubject={Carnegie Mellon University},
pdfkeywords={},
pdfpagelabels=true,
pdfpagemode=UseOutlines % None, UseThumbs, UseOutlines, FullScreen
]{hyperref}

Best Answer

Probably you mean that the table of contents is not in the bookmarks (outlines). It is debatable, whether the table of contents should have an entry for itself. But for the bookmarks it is IMHO ok, because they are just a navigational help. I use the opportunity to comment some option settings for hyperref. Additional bookmarks can be set using \pdfbookmark as shown in the example, see documentation of hyperref. To avoid links to wrong pages, it is important that \pdfbookmark is on the same page. Ensuring a page break before makes this easier.

\documentclass{article}

\usepackage[
  % Some remarks:
  % * drivers like 'pdftex' that can be detected automatically
  %   are not necessary
  % * breaklinks is rather an internal option.
  %   If a driver does not support it, then forcing the option
  %   let the text break across lines, but also the link
  %   areas are "broken". If the driver supports the option,
  %   then the option is enabled anyway.
  % * Information entries should be set outside,
  %   because LaTeX expands the package options,
  %   hyperref does not like them, if they are
  %   prematurely expanded.
  % * Hyperref has a new option for hiding links: hidelinks
  hidelinks,
  letterpaper,
  pagebackref,
  bookmarksopen,
  bookmarksnumbered,
]{hyperref}
\hypersetup{
  pdfauthor={...},
  % ...
}
% Adding package bookmark improves bookmarks handling.
% More features and faster updated bookmarks.
\usepackage{bookmark}

\begin{document}
Title

\newpage% or \cleardoublepage
% \pdfbookmark[<level>]{<title>}{<dest>}
\pdfbookmark[section]{\contentsname}{toc}
\tableofcontents

\section{Introduction}
\section{Main}
\end{document}

enter image description here

Related Question