1

I keep getting an error while trying to use class moderncv with \moderncvstyle{banking}. This is the error that I get:

! Undefined control sequence.
\makehead ...sfont \color {color2}\@moreextrainfo
\par }\medskip
l.77 \makecvtitle

The same happens with the \makelettertitle. Any suggestions on what's going on or how to fix this?

\documentclass[12pt,a4paper,sans]{moderncv}      
\moderncvstyle{banking}                             
\moderncvcolor{blue}                             
\usepackage[utf8]{inputenc} 
\usepackage{lipsum}
\usepackage[scale=0.775,top=2cm,bottom=2cm]{geometry}

THIS IS WHAT IS CAUSING THE PROBLEM, but I don't know how to fix it

\newcommand\moreextrainfo[1]{\def\@moreextrainfo{#1}}
\patchcmd\makehead{\\[2.5em]}

{\par{\centering\addressfont\color{color2}\@moreextrainfo\par}\medskip}% {}{}



% personal data
\name{J.}{Doe}
\title{}                               
\phone[home]{{\faHome} somewhere} 
\phone[mobile]{+1~(000)~000~0000}                   
\email{somewhere@gmail.com}                              
\quote{N/A}                                

\begin{document}

\makecvtitle
\vspace{-2.5em}
  • 1
    That is not an mwe. We need a full but minimal example, that we can copy and test as is. Here we have to guess half the contents. – daleif Apr 6 '18 at 16:30
0

Well, your given code is not complete or compilable :-((

Your given error Undefined control sequence. should not occur with your given code snippet.

Please see the following MWE (important code additions are marked with <=====) I created with some wild guessing:

\documentclass[12pt,a4paper,sans]{moderncv}

\moderncvstyle{banking}
\moderncvcolor{blue}
\usepackage[utf8]{inputenc}

\usepackage[scale=0.775,top=2cm,bottom=2cm]{geometry}

\makeatletter % <=======================================================
\newcommand\moreextrainfo[1]{\def\@moreextrainfo{#1}}
\patchcmd\makehead
  {\\[2.5em]}%
  {\par{\centering\addressfont\color{color2}\@moreextrainfo\par}\medskip}%
  {}{}
\makeatother % <========================================================

\name{J.}{Doe}
\title{empty title}
\address{Address}{1111}{FRANCE}
\phone[home]{{\faHome} somewhere}
\phone[mobile]{+1~(000)~000~0000}
\email{somewhere@gmail.com}
\moreextrainfo{more extra info more extra info} % <=====================

\quote{N/A}


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

With an defined content for command \moreextrainfo and masking the usage of @ with commands \makeatletter and \makeatother you get then the following resulting page:

resulting page

Please see that with this code you have to define an \moreextrainfo!

Next time please add an complete code (short MWE, minimal working example) to your question we can copy and play with ...

If my guess does not reflect your situation change your question please by adding an complete short code resulting in your issue. Add the version of moderncv you are using (I'm using the current one: 2.0.0) ...

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.