How can I get hyperref
to format the link, but not actually link to anything. For instance, in the Legend section in the MWE below I would prefer that clicking on the links not actually attempt to open anything. But, at the same time, I need hyperref
to do formatting of the link so that it is consistent with the rest of the document.
Using \hypersetup{draft}
does not seem to have any effect.
References:
- How to disable links completely using hyperref package? shows how to disable all links.
- Selectively de-activate links with hyperref shows how to make the links not be noticeable, but the clicking will still attempt to open the link.
Code:
\documentclass{article}
\usepackage{xcolor}
\usepackage[colorlinks=false, pdfborderstyle={/S/U/W 1}, runbordercolor=red]{hyperref}
\begin{document}
\begingroup
\hypersetup{draft}% <-- This has no effect.
\textbf{Legend:} Want these two links to \emph{not} be clickable
\begin{itemize}
\item Web links are displayed as \href{http://www.google.com}{site name} and
\item links to local pdf file are displayed as \href{run:foo.pdf}{PDF name}
\end{itemize}
\endgroup
\medskip
\textbf{Main Document}\par
A good search engine: \href{http://www.google.com}{Google}
A good place for news: \href{http://www.yahoo.com}{Yahoo}
Here is an important PDF file: \href{run:foo.pdf}{My PDF}
\end{document}