9

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?

2 Answers2

5

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.

Mario S. E.
  • 18,609
  • Not all packages should be loaded before hyperref, see http://tex.stackexchange.com/questions/1863/which-packages-should-be-loaded-after-hyperref-instead-of-before – Torbjørn T. Mar 07 '14 at 09: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 08 '14 at 10:08
1

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.