TransWikia.com

Hyperlink in moderncv with acrobat reader

TeX - LaTeX Asked by Satoshi Nawata on January 26, 2021

The hyperref in moderncv for urls and the email address cannot be opened with adobe acrobat reader. The links are working in other pdf readers. It’s only an issue with moderncv opened in adobe acrobat reader. I tried to make a minimal example that shows the behavior. It is the same for href and url. Does anybody know a resolution?

documentclass[11pt,a4paper]{moderncv}

moderncvtheme[grey]{classic}
firstname{Test}
familyname{Test}

begin{document}

cventry{2012}{test}{test}{texttt{href{http://www.google.com}{click me}}}{}{}
cventry{2012}{test}{test}{texttt{url{http://www.google.com}}}{}{}

end{document}

3 Answers

Actually, I face exactly the same issue with Adobe Acrobat Reader 9.

The url works in other pdf readers, but not in adobe.

I think you gotta update the Adobe Acrobat Reader to a higher version (>10).

Answered by Omid1989 on January 26, 2021

On the moderncv.cls file I removed the baseurl= http:// option under hypersetup and it worked. I'm not sure why but it did.

Answered by an1234 on January 26, 2021

I ran into the same issue with Adobe Acrobat 9 and Acrobat X Pro on two different computers. Strangely, I did not encounter an error using TeXstudio's internal PDF viewer -- the links work as is.

I started with this MWE based on the one in the question:

documentclass[11pt,a4paper]{moderncv}

moderncvtheme[grey]{classic}
firstname{Test}
familyname{Test}

begin{document}

cventry{2012}{test}{test}{texttt{href{http://www.google.com}{http://www.google.com}}}{}{}

end{document}

When attempting to click a link using Acrobat I receive the following error:

enter image description here

I found an alternate solution based on an1234's answer: add AtBeginDocument{hypersetup{baseurl={}}} in the preamble (you can also add other options like colorlinks). Acrobat no longer generates the error with the fixed MWE:

documentclass[11pt,a4paper]{moderncv}

moderncvtheme[grey]{classic}
firstname{Test}
familyname{Test}

AtBeginDocument{hypersetup{baseurl={}}}

begin{document}

cventry{2012}{test}{test}{texttt{href{http://www.google.com}{http://www.google.com}}}{}{}

end{document}

I think this solution is preferable since you don't have to modify the moderncv.cls file.

Answered by Null on January 26, 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