1

I would be happy if anyone can help me to color differently only one specific hyperlink, (preferably, without setting \hypersetup{}. Many thanks in advance.

  \documentclass{article}
\usepackage{soul}
\usepackage{hyperref}


    \begin{document}
    {\setulcolor{red}\ul{Package Pomodoro CRAN:}}
    
    {\underline{\setulcolor{red}{\href{https://cran.r-project.org/web/packages/pomodoro/index.html}{WANNA UNDERLINE THIS BLACK TEXT WITH RED:}}}}

    \end{document}

1 Answer 1

3
\documentclass{article}
\usepackage{soul,xcolor}
\usepackage{hyperref}


    \begin{document}
    {\setulcolor{red}\ul{Package Pomodoro CRAN:}}

    {\setulcolor{red}\ul{\mbox{\href{https://cran.r-project.org/web/packages/pomodoro/index.html}{WANNA UNDERLINE THIS BLACK TEXT WITH RED:}}}}

    \end{document}

And no, you can't avoid the \mbox. soul won't like it. If you want underlining with a linebreak you should either use \hypersetup or lualatex and the lua-ul package.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .