Sunday, September 25, 2011

Adding Bookmarks and Hyper Links to LaTeX Content Page

Kile Logo

Handling and creation of large documents which have more than 100 pages are not easy task with Microsoft Word and Libre Office Writer like word processing packages. After the limit of 50 pages, time spend for formatting significantly increasing in GUI word processors. Therefore best option is switch to LaTex.



In LaTex content page can be generated with single line. That is adding
\tableofcontents tag. However even it generated a good content page, after making the PDF, the book marks and hyper links from content page to relevant sections are not created. To overcome this issue, 'hyperref' package can be used. Just you have to do is add following content to your document between \documentclass tag and \begin{document} tag.

\usepackage{hyperref}
\hypersetup{
    pdfborder = {0 0 0},
    bookmarks=true,         % show bookmarks bar?
    unicode=false,          % non-Latin characters in Acrobatâ??s bookmarks
    pdftoolbar=true,        % show Acrobat??s toolbar?
    pdfmenubar=true,        % show Acrobat??s menu?

    pdffitwindow=false,     % window fit to page when opened
    pdfstartview={FitH},    % fits the width of the page to the window
    pdftitle={Sample LaTex with Link},    % title
    pdfauthor={Kasun Chathuranga},     % author
    pdfsubject={LaTex with Link},   % subject of the document

    pdfcreator={Kile},   % creator of the document
    pdfproducer={}, % producer of the document
    pdfkeywords={}, % list of keywords
    pdfnewwindow=true,      % links in new window
    linkcolor=white,          % color of internal links

    citecolor=green,        % color of links to bibliography
    filecolor=black,      % color of file links
    urlcolor=cyan,           % color of external links
    colorlinks=false,
    citecolor=black,%
    filecolor=black,%

    linkcolor=black,%
    urlcolor=black
}
This hyperref package is available in Kile by default.

No comments: