# problem with name being too long for moderncv title

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}

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
\flushmaketitle\@firstmaketitleelementtrue\\}%
\collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
\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{}}
\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.

## Update (moderncv v2.0)

With moderncv v2.0, the command to be patched is no more \maketitle but \makehead and the length to be changed is now \makeheaddetailswidth, so the correct patch for this version is

{}
{}

## Original answer (works with older versions of moderncv)

Making it a little simpler, you can patch \maketitle through the \patchcmd command from etoolbox (loaded by moderncv) so to set the length \maketitlewidth to \textwidth.

\patchcmd{\maketitle}
{\setlength{\maketitlewidth}{0.8\textwidth}}
{\setlength{\maketitlewidth}{\textwidth}}
{}
{}

MWE:

\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{Jesse}
\familyname{Jaanila}

\title{Curriculum Vit\ae{}}
\mobile{+358 45 2580 777}
\email{jesse.jaanila@aalto.fi}

\patchcmd{\maketitle}
{\setlength{\maketitlewidth}{0.8\textwidth}}
{\setlength{\maketitlewidth}{\textwidth}}
{}
{}

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