[Tex/LaTex] Name alignment in modern cv

moderncv

I would like that my given name (first name) in the CV appears aligned to the left, I am using \firstname{Juan Pablo}
\familyname{Romero Garza}

enter image description herethanks

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

\moderncvstyle{classic}                             
\moderncvcolor{black}                               

\usepackage[utf8]{inputenc}                       
\usepackage[scale=0.75]{geometry}
\setlength{\makecvtitlenamewidth}{8cm}          

% personal data
\firstname{Juan Pablo}}
\familyname{Romero Garza}
\title{Curriculum Vitae}                               
\address{Steer number}{City zipcode}{Country}
\phone[mobile]{+1~(811)~408~6080}                   
\email{email}                               
\extrainfo{*Possibility of moving to another city}                 
\photo[74pt][0.4pt]{picture.png}  

\begin{document}
\makecvtitle
\end{document}

Best Answer

It seems that you are using an older version of moderncv. You used the command \makecvtitlenamewidth that has been renamed with version 2.0.0 of moderncv to \makecvheadnamewidth. I changed it in the following MWE.

Because there is a little bug (and therefore an updating to the current version 2.0.0 can not help) in class moderncv I used an patch to get a better distance between first and last name line (change [1ex] to your needs):

\usepackage{xpatch}
\makeatletter
\xpatchcmd{\makecvhead}{%
\namestyle{\@firstname\ \@lastname}%
}{%
\namestyle{\@firstname\\[1ex]\@lastname}% [25pt]
}{}{false}
\makeatother

I hope with a new version of moderncv this workaround is no more neccessary.

With the following complete MWE

\documentclass[11pt,letterpaper,sans]{moderncv} % version 2.0.0

\moderncvstyle{classic}
\moderncvcolor{black}

\usepackage[utf8]{inputenc}
\usepackage[scale=0.75]{geometry}
\setlength{\makecvheadnamewidth}{8cm} % used in older versions of moderncv! makecvtitlenamewidth

\usepackage{xpatch}
\makeatletter
\xpatchcmd{\makecvhead}{%
\namestyle{\@firstname\ \@lastname}%
}{%
\namestyle{\@firstname\\[1ex]\@lastname}% [25pt] <==========================
}{}{false}
\makeatother

% personal data
\firstname{Juan Pablo}%}
\familyname{Romero Garza}
\title{Curriculum Vit\ae}
\address{Street number}{City zipcode}{Country}
\phone[mobile]{+1~(811)~408~6080}
\email{email}
\extrainfo{*Possibility of moving to another city}
\photo[74pt][0.4pt]{example-image-a}

\begin{document}
\makecvtitle
\end{document}

you will get the wanted result:

enter image description here

The advantage of patching (instead of writing \familyname{\\[1ex]Romero Garza}) is that the resulting pdf has no errors in the bookmarks of the pdf.