TransWikia.com

How to change the color of href links... for real

TeX - LaTeX Asked on October 1, 2021

I would like web links generated by the href command to be colored in my Beamer presentation. Passing the colorlinks option to hyperref leads to navigation links within the PDF receiving (default, ugly) colors. OTOH, without passing that option hyperref doesn’t apply any color to links at all.

definecolor{links}{HTML}{2A1B81}
hypersetup{urlcolor=links} % Does not apply color to href's
hypersetup{colorlinks,urlcolor=links} % href's are correct, but navigation links are magenta

Is there a way to tell hyperref to apply a color only to links generated by href (or url), and leave navigation links alone? (I know that I could define a command myhref to do the color-changing manually; I am looking for a solution that uses the built-in facilities of hyperref/beamer.)

2 Answers

You could add hypersetup{linkcolor=} in order to remove the coloring of internal links used for navigation purposes:

documentclass{beamer}
definecolor{links}{HTML}{2A1B81}
hypersetup{colorlinks,linkcolor=,urlcolor=links}
usetheme{Frankfurt}
begin{document}
section{Test}
begin{frame}
  url{http://tex.stackexchange.com/}
  href{http://tex.stackexchange.com/questions/13423/how-to-color-href-links-in-beamer}{Your question}
end{frame}
end{document}

works fine for me as you can see in the headline - the navigation link is colored in the default gray tone, while the links are colored in the desired blue.

Correct answer by diabonas on October 1, 2021

If you're looking for something simpler, here's another alternative.

href{https://www.url.com/}{color{blue}{underline{Demo}}}

enter image description here

Answered by fingerprints on October 1, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP