[Tex/LaTex] problem with name being too long for moderncv title

moderncv

Is there a way to fit the whole "jesse jaanila | curriculum vitae" title on the same row with the banking style. My simplified code shows that with the font fouriernc that I like, it doesn't seem to fit on a single row.

\documentclass[12pt,a4paper,finnish]{moderncv} 
\moderncvstyle{banking}
\moderncvcolor{blue}
 \usepackage{babel}
 \usepackage[latin1]{inputenc}
  \usepackage[T1]{fontenc}
 \usepackage{fouriernc}
 \usepackage[scale=0.75]{geometry}

 \firstname{XXX}
 \familyname{XXX}

 \title{Curriculum Vit\ae{}}

\mobile{+358 45 2580 777}


\begin{document}
\thispagestyle{empty}
\pagestyle{empty}
 \makecvtitle
 \end{document}

Best Answer

This works:

\documentclass[12pt,a4paper,finnish]{moderncv} 
\moderncvstyle{banking}
\moderncvcolor{blue}
 \usepackage{babel}
 \usepackage[latin1]{inputenc}
  \usepackage[T1]{fontenc}
 \usepackage{fouriernc}
 \usepackage[scale=0.75]{geometry}

 \makeatletter
\renewcommand*{\maketitle}{%
  \setlength{\maketitlewidth}{\textwidth}%
  \hfil%
  \parbox{\maketitlewidth}{%
    \centering%
    % name and title
    \namestyle{\@firstname~\@lastname}%
    \ifthenelse{\equal{\@title}{}}{}{\titlestyle{~|~\@title}}\\% \isundefined doesn't work on \@title, as LaTeX itself defines \@title (before it possibly gets redefined by \title) 
    % detailed information
    \addressfont\color{color2}%
    \ifthenelse{\isundefined{\@addressstreet}}{}{\addtomaketitle{\addresssymbol\@addressstreet}%
      \ifthenelse{\equal{\@addresscity}{}}{}{\addtomaketitle[~--~]{\@addresscity}}% if \addresstreet is defined, \addresscity and \addresscountry will always be defined but could be empty
      \ifthenelse{\equal{\@addresscountry}{}}{}{\addtomaketitle[~--~]{\@addresscountry}}%
      \flushmaketitle\@firstmaketitleelementtrue\\}%
    \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
      \addtomaketitle{\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}%
    \ifthenelse{\isundefined{\@email}}{}{\addtomaketitle{\emailsymbol\emaillink{\@email}}}%
    \ifthenelse{\isundefined{\@homepage}}{}{\addtomaketitle{\homepagesymbol\httplink{\@homepage}}}%
    \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
      \addtomaketitle{\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}%
    \ifthenelse{\isundefined{\@extrainfo}}{}{\addtomaketitle{\@extrainfo}}%
    \flushmaketitle}\\[2.5em]}% need to force a \par after this to avoid weird spacing bug at the first section if no blank line is left after \maketitle

 \makeatother

 \firstname{Jesse}
 \familyname{Jaanila}

 \title{Curriculum Vit\ae{}}
\address{Mannerheimintie 21--23 C 38}{00250 \textsc{HELSINKI}}
\mobile{+358 45 2580 777}
\email{jesse.jaanila@aalto.fi}

\begin{document}
\thispagestyle{empty}
\pagestyle{empty}
 \makecvtitle
 \end{document}

The problem is that the \maketitle definition in the banking style arbitrarily redefines the length \maketitlewidth to be 80% of \textwidth so you cannot change that from outside the macro definition. The quick and dirty hack here is to copy over the original definition from moderncvstylebanking.sty and modify the first line so that \maketitlewidth is set to the full \textwidth. A better patch would just remove that line altogether from the definition so that you can set the \maketitlewidth in your preamble to adjust it to your preferences.