Page LayoutPDF hyperlinks to section don't work in article doc. class

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

PDF hyperlinks to section don't work in article doc. class

Post by AleCes »

I've written an article with the following prologue:

Code: Select all

\documentclass[a4paper, 12pt]{article}
\usepackage{fullpage}
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text}
\setmainfont{Linux Libertine O}
\usepackage[latin, french,american]{babel}
\usepackage{xunicode}
\usepackage{xltxtra}
\usepackage[super]{nth}
\usepackage{paralist}
\pagestyle{empty}
\usepackage{lettrine}
\setcounter{secnumdepth}{0}
This document has three sections, but they don't appear in the hyperlink menu of Adobe Acrobat. What's wrong?
Last edited by AleCes on Thu May 05, 2011 2:31 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10328
Joined: Mon Mar 10, 2008 9:44 pm

PDF hyperlinks to section don't work in article doc. class

Post by Stefan Kottwitz »

Hi AleCes,

you need to load the hyperref package:

Code: Select all

\usepackage{hyperref}
Load it after the other packages, exceptions to that rule are listed here.

Stefan
LaTeX.org admin
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

PDF hyperlinks to section don't work in article doc. class

Post by AleCes »

Thank you for your help Stefan_k but it doesn't work!
Anyhow I never needed hyperref to have hyperlinks working: take a look at this prologue (in this case it's a book):

Code: Select all

\documentclass[a4paper, 12pt, openany]{book}
\usepackage{fullpage}
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text}
\setmainfont{Minion Pro}
\usepackage{polyglossia}
 \setmainlanguage{serbian}
\usepackage{xunicode}
\usepackage{xltxtra}
\usepackage{bookmark}
On this book, hyperlinks do work, I can access chapters, sections, etc... through the Acrobat menu on the right!
P.S.
Isn't hyperref meant to provide url links? That's not what I need, I need internal links to chapters, sections etc...
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

PDF hyperlinks to section don't work in article doc. class

Post by AleCes »

I was thinking that maybe

Code: Select all

\setcounter{secnumdepth}{0}
is the problem but no, that's not the case since I've used this option on other books without encountering any trouble.
Maybe hyperlinks don't work by default on articles?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10328
Joined: Mon Mar 10, 2008 9:44 pm

PDF hyperlinks to section don't work in article doc. class

Post by Stefan Kottwitz »

Hi,
AleCes wrote:but it doesn't work!
this error description isn't very specific ;-)
AleCes wrote:Anyhow I never needed hyperref to have hyperlinks working: take a look at this prologue (in this case it's a book):

Code: Select all

...
\usepackage{bookmark}
On this book, hyperlinks do work, I can access chapters, sections, etc... through the Acrobat menu on the right!
In the second example you load the bookmark package, which automatically loads hyperref. It adds advanced bookmark features to hyperref.
AleCes wrote:Isn't hyperref meant to provide url links? That's not what I need, I need internal links to chapters, sections etc...
hyperref produces these internal links. They are PDF features, done by pdfTeX (or hyperref), not by classical LaTeX features, since the original format was DVI.

Stefan
LaTeX.org admin
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

PDF hyperlinks to section don't work in article doc. class

Post by AleCes »

Sorry.
By "it doesn't work" I meant that the menu on the right doesn't pop up when I open this document with Acrobat Reader.
By the way I tried to load the bookmark package and this time it does work! I used to think it was needed just for footnotes, and since I didn't use them in my article I just didn't load it.
Post Reply