0

I am using

\documentclass[11pt,a4paper,sans]{moderncv}

\newcommand{\MYhref}[3][blue]{\href{#2}{\color{#1}{#3}}}

for one of my links, I am using:

\cventry{MSc THESIS}{``Title here''}{}{}{}{\begin{itemize}
\item Link to article: 
\MYhref{https://www.researchgate.net/publication/title_here}
{www.researchgate.net/publication/title\_here}
\end{itemize}

However, here the link to the article appears in blue as expected, but the link goes beyond the margin (part of the link not being visible). I would like to break the link into two lines.

I tried using the solutions provided in this tex.stackexchange link and this tex.stackexchange link to no avail. When I try

\PassOptionsToPackage{hyphens}{url}\usepackage{hyperref}

I get an error stating

! LaTeX Error: Option clash for package hyperref.
Srivatsan
  • 723

1 Answers1

1

After several hours of Googling, I found an answer to my question.

Just by using:

\MYhref{https://www.researchgate.net/publication/title_here}
{\nolinkurl{www.researchgate.net/publication/title\_here}}

by using the option \nolinkurl{}, latex automatically breaks the link.

Srivatsan
  • 723