Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How can I have both boxed and color links in the same document? I know I can use \usepackage[colorlinks]{hyperref} and have colored links instead of boxes, but how do I have both in the same document. The MWE below yields:

enter image description here

Notes:

  • This is intended for use only in the review version of the document where I want to be able to distinguish different types of links. In the final version there will be a single style.

Code:

\documentclass{article}
\usepackage{hyperref}

\begin{document}
\href{www.google.com}{The Google} 

\hypersetup{colorlinks=true, urlcolor=blue}
\href{www.google.com}{The Google} 

\hypersetup{colorlinks=false}
\href{www.google.com}{The Google} 
\end{document}
share|improve this question
    
Related Question: How can I have colored and underlined links with hyperref?. –  Peter Grill Jun 23 '13 at 21:35
add comment

1 Answer 1

up vote 4 down vote accepted

If colorlinks is activated, then the color can be disabled by using the current color . that is provided by package xcolor. The setting for pdfborder enables or disables the annotation frame:

\documentclass{article}
\usepackage{xcolor}
\usepackage[colorlinks]{hyperref}

\AtBeginDocument{%
  \hypersetup{pdfborder={0 0 1}, urlcolor=.}%
}

\begin{document}
\href{www.google.com}{The Google}

\hypersetup{pdfborder={0 0 0}, urlcolor=blue}
\href{www.google.com}{The Google}

\hypersetup{pdfborder={0 0 1}, urlcolor=.}
\href{www.google.com}{The Google}

\textcolor{red}{\href{www.google.com}{The Google}}
\end{document}

Result

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.