4

I tried inserting a clickable URL into ModernCV but somehow the output doesn't feature a clickable URL. This has worked in the past(on Ubuntu 12.04; with few changes such as including hyperref. Not required now since moderncv includes it) but no longer works in Ubuntu 13.10.

Here's an MWE demonstrating the issue. On compiling this, I get "Google" highlighted in NavyBlue but it is not clickable. Could someone point out what could be possibly wrong!

\documentclass[11pt,a4paper,usenames,dvipsnames,svgnames,table]{moderncv}

\moderncvtheme[blue]{classic}
\usepackage[scale=0.8]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{xcolor}

\firstname{First name}
\familyname{Last name}
\title{Curriculum Vitae}
\address{Address line 1}{Address line 2}
\mobile{Phone}
\email{Email}

\AtBeginDocument{\hypersetup{colorlinks, urlcolor=NavyBlue}}

\begin{document}
  \section{Education}
  \cventry{Year}{Degree}{University}{Location}{GPA. \href{http://google.com}{Google}}{}
\end{document}

I think I've explained the issue clearly but if there is something I could add, kindly do let me know. I'm running the following version of pdflatex on Ubuntu 13.10:

$ pdflatex -v
pdfTeX 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)
kpathsea version 6.1.1
Copyright 2013 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.2.49; using libpng 1.2.49
Compiled with zlib 1.2.8; using zlib 1.2.8
Compiled with poppler version 0.24.1

Edit: Corrected arguments of \cventry and \address.

Edit 2: Turns out what @IanThompson suspected was true. It is an issue with the PDF viewer I was using - Okular; the URL works fine with xpdf and Evince. I'm not closing this question though. I know it's not strictly a TeX issue but varying outputs on different editors doesn't seem good(at least to me) - a potential employer finds an unclickable URL might get annoyed, causing unnecessary issues(there can be more possible cases too). If someone can propose a solution to this, it would be great. And no @IanThompson's answer of adding 'www.' before 'google.com' didn't work either.

  • There’s a spurious closing brace } after Google, which leads to an error message. If you remove that brace, you should be fine. – doncherry Dec 6 '13 at 14:37
  • In addition, \address requires two arguments. – Ian Thompson Dec 6 '13 at 14:39
  • @doncherry Ah yes I see that. Not sure how I overlooked it. I have corrected it but it doesn't fix the issue. – dnivra Dec 6 '13 at 14:48
  • @IanThompson Ah true but that doesn't matter here I think. Nevertheless, I have changed that as well. – dnivra Dec 6 '13 at 14:49
  • 1
    Have you included the package hyperref? if not try including that. \usepackage{hyperref} – ashensw Jan 6 '16 at 6:16
2

I think you need www. before google.com. The following example caused the same problem in Adobe Reader 9 (linux), though it worked ok for some other viewers. After inserting www. it worked for all the viewers I tried.

\documentclass[11pt]{article}
\usepackage{hyperref}
\begin{document}
\href{http://google.com}{Google} % Insert www. before google!
\end{document}
  • I tried this out and it still doesn't work with Okular; the highlight works though. Seems to be fine with xpdf and Evince. Guess I'll just not use Okular for now. – dnivra Dec 6 '13 at 15:48
1

For Okular choose View->Presentation mode and you'll get what you want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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