Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Some ( if not most ) pdf ebooks have the option to view the table of contents in a left navigation window. I would like to add this option to my document as well. Question: How to add a navigation window to a LaTeX generated PDF document?

share|improve this question
    
well, I believe you can add bookmarks using hyperref. The regular navigation with sectioning commands is done automatically, I believe. At least I have never had to do something special to get it and acrobat shows a navigation pane with contents on all of my documents. –  Roelof Spijker Jan 26 '12 at 11:22
    
You can always switch on/off the navigation pane, but every pdf has a default view. The option for showing the navigation pane by default is pdfpagemode=UseOutlines. Anyway, you can tell Acrobat to override the documents default settings. –  matth Jan 26 '12 at 12:18
1  
@ndroock1 maybe the following is also interesting for you: tex.stackexchange.com/questions/1820/contents-in-pdf-bookmarks/… –  matth Jan 26 '12 at 12:35

2 Answers 2

up vote 13 down vote accepted

You can use a hyperref package. You'll have to start with a fresh .tex file compilation; i.e. no .aux file. You can add several option to the package as well, read the hyperref documentation. I presume you have your document well sectioned, the hyperref package generates the TOC entries in your viewer for chapters, bibliography, sections, abstract...etc. You might find different outcomes of TOC depending on your documentclass.


Here's a setup I use:

\usepackage{hyperref}
\hypersetup{pdftex,colorlinks=true,allcolors=blue}
\usepackage{hypcap}

I added the last one as an extra since links should always anchor at the image not the caption.

share|improve this answer
    
I create my documents with TeXnicCenter, I would be lost otherwise. I hope it is compatible because it does generate .aux files. But let me have a look at hyperref first. –  ndroock1 Jan 26 '12 at 11:38
    
@ndroock1: The TeX file will generate an aux file eitherway, what I'm saying is that it has to generate a new one. You could simply delete the aux file and let it compile with a new one after you add the hyperref package. –  Ayman Elmasry Jan 26 '12 at 11:43

As has been said, you need to use the hyperref package. Just add the following lines to your preamble:

\usepackage[]{hyperref}
\hypersetup{
    pdftitle={Your title here},
    pdfauthor={Your name here},
    pdfsubject={Your subject here},
    pdfkeywords={keyword1, keyword2},
    bookmarksnumbered=true,     
    bookmarksopen=true,         
    bookmarksopenlevel=1,       
    colorlinks=true,            
    pdfstartview=Fit,           
    pdfpagemode=UseOutlines,    % this is the option you were lookin for
    pdfpagelayout=TwoPageRight
}

Usually, hyperref should be loaded as the last package (but every rule has exceptions).

share|improve this answer
2  
+1 for the link to the exceptions –  yo' Jan 26 '12 at 12:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.