hyperref: Clickable Links, Bookmarks & PDF Metadata
Load the hyperref package last to make every \ref, \cite, and URL clickable in the PDF, add bookmarks, and set document metadata. Setup and options inside.
Load the hyperref package last in your preamble to make every \ref, \cite, table-of-contents entry, and URL clickable in the PDF — plus add a bookmark sidebar and set document metadata. It's the single package that turns a static PDF into a navigable one. The one rule to remember: load it last, because it patches other packages' commands.
1. The basic setup
\usepackage[colorlinks=true, linkcolor=blue, citecolor=blue, urlcolor=blue]{hyperref}
With this one line, internal references jump to their target and URLs open in a browser. colorlinks=true colors the link text instead of drawing ugly boxes around it.
2. URLs and hyperlinks
Visit \url{https://letx.app} or a \href{https://letx.app}{named link}.
\url prints and links the address; \href{url}{text} links custom text. \url also handles line-breaking of long addresses.
3. Key options
| Option | Effect |
|---|---|
| colorlinks=true | Color link text, no boxes |
| hidelinks | No color, no box (print) |
| linkcolor / citecolor / urlcolor | Per-type colors |
| bookmarks=true | PDF bookmark sidebar (default) |
| pdftitle / pdfauthor | Document metadata |
4. Set PDF metadata
\hypersetup{
pdftitle={A Concise Paper Title},
pdfauthor={Ada Lovelace},
pdfkeywords={latex, hyperref, pdf}
}
This metadata shows in the PDF's properties and is read by reference managers — worth setting for any published paper.
5. The loading-order rule
hyperref must be loaded last so it sees the final versions of commands from amsmath, \cite, the table of contents, and more. The one exception: if you use cleveref (smarter \ref that prints "Figure 3" automatically), load it after hyperref. Clickable references make long documents like a thesis genuinely navigable.
→ See clickable links and bookmarks render instantly in LetX.
Written by Shihab Shahriar Antor — AI Engineer & Founder of Shahriar Labs, maker of LetX.
Frequently Asked Questions
Why should hyperref be loaded last in the preamble?
hyperref redefines many internal commands to make cross-references and citations clickable, so it must see the final versions of those commands from other packages. Loading it before packages that also patch references can break links or cause errors. The well-known exception is cleveref, which must come after hyperref. The safe rule is: load hyperref last, then cleveref immediately after it if you use it.
How do I change or hide the colored boxes around links?
By default hyperref draws colored borders around links. Most authors prefer colored text instead: \usepackage[colorlinks=true, linkcolor=blue, citecolor=blue, urlcolor=blue]{hyperref} colors the link text and removes the boxes. For a print version where you want no visual marking at all, set hidelinks: \usepackage[hidelinks]{hyperref}. Journals often specify which style they want, so check the author guidelines.
How do I set the PDF title and author metadata?
Pass them to hyperref with \hypersetup{pdftitle={My Paper}, pdfauthor={Ada Lovelace}, pdfsubject={...}, pdfkeywords={latex, hyperref}}. This metadata appears in the PDF's document properties and is read by reference managers and search indexes, so it's worth setting for any paper you publish. You can put \hypersetup anywhere after loading hyperref, including to override options you set at load time.