5

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}
1

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.

0
10

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

\patchcmd{\makehead}
  {\setlength{\makeheaddetailswidth}{0.8\textwidth}}
  {\setlength{\makeheaddetailswidth}{\textwidth}}
  {}
  {}

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.

That is, add the following lines to your preamble:

\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{}}
\address{Mannerheimintie 21--23 C 38}{00250 \textsc{HELSINKI}}
\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} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.