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?
Asked
Active
Viewed 3.5k times
39
2 Answers
32
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).
-
3
-
I am sorry, but I tried this and nothing has changed. There is still nothing navigation pane. Absolutely nothing. – peterh Nov 15 '23 at 15:29
27
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.
Ayman Elmasry
- 8,814
-
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. – nilo de roock 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
hyperrefpackage. – Ayman Elmasry Jan 26 '12 at 11:43 -
Hi, I tried it and I see nothing visible change, particularly nothing any navigation pane or bookmark index. I use pdflatex to generate the pdf file. – peterh Nov 15 '23 at 15:37
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:22pdfpagemode=UseOutlines. Anyway, you can tell Acrobat to override the documents default settings. – matth Jan 26 '12 at 12:18