[Tex/LaTex] Modern CV Banking, title and name on different lines

moderncv

I have a problem with moderncv banking. I'd like to put my name and the title on different lines. There are some solutions on the subjects, but they did not work fine for me unfortunately. Here is a solution I have found here (I tried it but didn't work so far):

Name and Title on separate lines in Modern CV

\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{banking}
\moderncvcolor{blue}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.85, top=1.5cm, bottom=1cm]{geometry}
\usepackage{enumitem}

\name{John}{Smith}
\title{Engineering Degree} 
\phone[mobile]{00.00.00.00}
\email{john.smith@blabla.com}
\social[linkedin]{john-smith}

\usepackage{xpatch}
\makeatletter
\xpatchcmd{\maketitle}{\titlestyle{~|~\@title}}{\par\vskip1ex\titlestyle{\@title}}{}{}
\makeatother

Best Answer

The solution proposed in Name and Title on separate lines in Modern CV still works, but with a small modification: Replace \maketitle by \makehead in the patch command such that the extra code in the preamble reads

\usepackage{xpatch}
\makeatletter
\xpatchcmd\makehead
   {\titlestyle{~|~\@title}}%
   {\par\vskip1ex\titlestyle{\@title}}%
   {}{}
\makeatother

The problem with patches is that they stop working as soon as the internals of the patched code change. Apparently code that before was in the macro \maketitle has been moved to \makehead in later versions.

Here is a complete example.

enter image description here

\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{banking}
\moderncvcolor{blue}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.85, top=1.5cm, bottom=1cm]{geometry}
\usepackage{enumitem}

\name{John}{Smith}
\title{Engineering Degree} 
\phone[mobile]{00.00.00.00}
\email{john.smith@blabla.com}
\social[linkedin]{john-smith}

\usepackage{xpatch}
\makeatletter
\xpatchcmd\makehead
   {\titlestyle{~|~\@title}}%
   {\par\vskip1ex\titlestyle{\@title}}%
   {}{}
\makeatother

\begin{document}
\maketitle
\end{document}