1

I'm writing latex code with overleaf and I want to make hyperlinks with the hyperref packages. From Googling, I learned that by default (or setting colorlinks=false) should make borders around the links. However, this doesn't work for me. Here is my code:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[colorlinks=false]{hyperref}
\usepackage{amsthm}

\title{Test}

\begin{document}

\newtheorem{theorem}{Theorem}

\maketitle

\section{Introduction}

\begin{theorem} \label{theorem1}
Famous theorem
\end{theorem}

\newpage

Using Theorem \ref{theorem1}.

\end{document}
1
  • Strange, I do see a red border with my pdf viewer (okular) in the "using theorem 1" sentence. Do you have a recent tex distribution?
    – tobiasBora
    Sep 16, 2021 at 20:03

1 Answer 1

3

It fully depends on the PDF viewer you are using. Some viewers show this border while some others don't.

This is when your document was viewed using Adobe Acrobat Reader and the box was visible. Adobe

And this is when your document was viewed using the Brave browser and the box disappeared. Brave

Also, if you print your document, this box won't get printed. If you want to highlight a link, I think it's better to use color or underline or both.

2
  • 1
    About the final remark: I always considered that the box doesn't get printed the biggest advantage of using these boxes. Marked links in printed documents always feels odd IMO since you can't actually click them, so the fact that they used to be links feels rather irrelevant. Sep 16, 2021 at 20:09
  • 1
    @MarcelKrüger Yes, I also agree that highlighted links in the printed document are of no use. However, I don't like these red boxes, so I usually hide these boxes and instead highlight the links.
    – Imran
    Sep 16, 2021 at 20:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .