Hyperlinks in LaTeX

The hyperref package adds clickable links and URLs to your PDF output.

Quick Answer

latex
\usepackage{hyperref}  % in preamble

\href{https://example.com}{Link text}
\url{https://example.com}

Basic Link Commands

latex
% Clickable link with custom text:
\href{https://example.com}{Visit example.com}

% Display the URL itself as a clickable link:
\url{https://example.com}

% Email link:
\href{mailto:hello@example.com}{hello@example.com}

Package Setup & Options

Always load hyperref last in your preamble — it redefines many commands and conflicts with packages loaded after it.

latex
% Load last, with common options:
\usepackage[
  colorlinks=true,
  linkcolor=blue,
  urlcolor=blue,
  citecolor=blue,
  pdftitle={My Thesis},
  pdfauthor={Your Name}
]{hyperref}

Writing your thesis in LaTeX?

MonsterWriter's LaTeX Workspace gives you real-time PDF preview with no compile limits — at a fraction of Overleaf's price. Works just like Overleaf, costs 11× less.

Try MonsterWriter free

Colored vs. Boxed Links

latex
% Colored links (clean, PDF-only):
\usepackage[colorlinks=true, urlcolor=blue]{hyperref}

% Boxed links (visible when printed):
\usepackage[colorlinks=false]{hyperref}

% No visible styling (for print submissions):
\usepackage[hidelinks]{hyperref}

Internal Links

Link to sections, figures, or equations within the same document using labels and \autoref.

latex
\section{Introduction}\label{sec:intro}

% Later in the document:
As discussed in \autoref{sec:intro}, ...
% Produces: "As discussed in Section 1, ..."

% Manual link with custom anchor text:
See \hyperref[sec:intro]{the introduction}.

Long URLs

Long URLs can overflow the line. The url package (loaded automatically by hyperref) handles line-breaking.

latex
% Allow URL line breaks (hyperref loads url automatically):
\Urlmuskip=0mu plus 2mu

% Or use breakurl package for additional control:
\usepackage{breakurl}

Related Topics