0

I'm trying to build a cv with moderncv where everything is black except the urls. Therefore, after having tried other option (see commented lines), I want to manually set the color of the url locally. However the url then is display one line underneath the proper entry. What am I doing wrong?

enter image description here

%\PassOptionsToPackage{pdfpagelabels=false}{hyperref} 
\documentclass[11pt,a4paper,sans]{moderncv} 

\moderncvstyle{classic} 
\moderncvcolor{black} 

\usepackage[scale=0.75]{geometry} 
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 
\usepackage{lmodern} 
\setlength{\hintscolumnwidth}{2.6cm} 
\setlength{\makecvheadnamewidth}{5.6cm} % <==== old: makecvtitlenamewidth

\geometry{
    a4paper,
    total={170mm,257mm},
    left=20mm,
    top=20mm,
}

%\usepackage[colorlinks]{hyperref}
%\hypersetup{
%   colorlinks,
%   filecolor=magenta,
%   linkcolor=blue,
%   citecolor=mypink1,      
%   urlcolor=cyan,
%   final
%}
\definecolor{myblue}{RGB}{0, 32, 255}
%\AfterPreamble{\hypersetup{
%%  pdfauthor={Rob Ward},
%%  pdftitle={CV for Rob Ward},
%%  pdfsubject={Detailed CV for Rob},
%
%  colorlinks,
%  linkcolor=blue,
%  urlcolor=blue,
%}}
\title{John Doe}
\name{Curriculum Vitae}{}

\begin{document} 


\section{Personal information}
\cventry{website}{\color{myblue}{\url{www.google.com}}}{}{}{}{} 
\end{document} 

1 Answer 1

1

You should use \textcolor not \color here. Actually you are already using the syntax of \textcolor as \color{blue} does npt take an argument.

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

\moderncvstyle{classic} 
\moderncvcolor{black} 

\usepackage[scale=0.75]{geometry} 
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 
\usepackage{lmodern} 
\setlength{\hintscolumnwidth}{2.6cm} 
\setlength{\makecvheadnamewidth}{5.6cm} % <==== old: makecvtitlenamewidth

\geometry{
    a4paper,
    total={170mm,257mm},
    left=20mm,
    top=20mm,
}

%\usepackage[colorlinks]{hyperref}
%\hypersetup{
%   colorlinks,
%   filecolor=magenta,
%   linkcolor=blue,
%   citecolor=mypink1,      
%   urlcolor=cyan,
%   final
%}
\definecolor{myblue}{RGB}{0, 32, 255}
%\AfterPreamble{\hypersetup{
%%  pdfauthor={Rob Ward},
%%  pdftitle={CV for Rob Ward},
%%  pdfsubject={Detailed CV for Rob},
%
%  colorlinks,
%  linkcolor=blue,
%  urlcolor=blue,
%}}
\title{John Doe}
\name{Curriculum Vitae}{}

\begin{document} 


\section{Personal information}
\cventry{website}{\textcolor{myblue}{\url{www.google.com}}}{}{}{}{} 
\end{document} 

enter image description here

You must log in to answer this question.

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