The hyperref package allows you add internal and external hyperlinks to your TeX files. It’s very useful for making navigable documents but I find it benefits from some tweaking.
Removing Green Hyperlink Borders
By default hyperref adds ugly florescent borders around hyperlinks:
You can easily fix this by adding hidelinks
to the document class declaration at the top of the page:
\documentclass[11pt,hidelinks]{article}
This removes all colours and coloured borders from links. The downside is your links are now invisible, meaning people might not know they’re there.
Colouring Links
If you want links to be clearly identifiable then you can use the hypersetup
command to style links. There is a small number of pre-defined colours you can choose from or you can \usepackage{xcolor}
to get access to many more.
\documentclass{article}
\usepackage{hyperref}
\hypersetup{
colorlinks = true,
urlcolor = blue,
citecolor = blue,
}
\begin{document}
Now my hyperlinks and citations and \href{http://example.com}{blue}.
\end{document}
Custom Link Colours
Using the xcolor package you can get access to more colours or define your own:
\documentclass{article}
\usepackage{xcolor}
\definecolor{custom-blue}{RGB}{6,69,173} % Gives your custom colour a name
\usepackage{hyperref}
\hypersetup{
colorlinks = true,
allcolors = custom-blue, % Colours all your links blue
}
\begin{document}
I got the RGB colour values from this \href{https://en.wikipedia.org/wiki/Help:Link_color}{Wikipedia} page.
\end{document}
Going Further
As with many packages hyperref is well documented and packed with useful snippets, making the manual worth a read.