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.

I wasn't sure how to search for this as I'm not sure what's it's called. Apologies if this is a duplicate though.

Sometimes when I open a PDF, the sidebar will list the table of contents and I'll be able to jump to a section or subsection by click on it's title in the pdf viewer's sidebar. Example: example

Other times, when I open up a long pdf, all I see in the sidebar are just the pages, listed in order, but with no other sort of organization. Non-example:

non-example

How do I construct my paper so that it works like the first example?

share|improve this question
3  
the hyperref package is the usual way of getting such things in latex, it has several commands for controlling this (bookmarks) but also by default the standard \(sub)section commands will add entries to the hierarchical bookmark pane. –  David Carlisle Mar 31 '13 at 0:02
    
@DavidCarlisle So do I need hyperref to use \subsection? –  AlanH Mar 31 '13 at 0:09
1  
@AlanH no; you need hyperref (or bookmark) to create the bookmarks. –  Gonzalo Medina Mar 31 '13 at 0:13
    
@GonzaloMedina Then if I use \section or \subsection, it should create a bookmark automatically, right? –  AlanH Mar 31 '13 at 0:19
1  
If you are using one of the two packages I mentioned, yes. –  Gonzalo Medina Mar 31 '13 at 0:24

2 Answers 2

up vote 1 down vote accepted

Make sure to load

\usepackage[pdftex,pdfpagelabels,bookmarks,hyperindex,hyperfigures]{hyperref}.

It should be the last package to be loaded (just to be sure it doesn't mix with other packages).

Although, according to this post pdftex could be not necessarily loaded.

share|improve this answer
    
Not all packages should be loaded before hyperref, see tex.stackexchange.com/questions/1863/… –  Torbjørn T. Mar 7 at 9:22
    
@TorbjørnT. you are right, but since I'm not sure what packages the OP is using, it was safer to just say "load it last" –  Mario S. E. Mar 8 at 10:08

For me, including the hyperref package as suggested by MarioS.E. above only generated the table of contents in the PDF viewer sidebar when I included a table of contents in the document using \tableofcontents. Without generating an actual table of contents in the document, hyperref seems to just make links to figures and citations active.

share|improve this answer

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.