I'm trying to use moderncv. When I try to compile the following document


I get 8 times the error:

Undefined control sequence. \begin{document}

When I use any other documentclass, such as article or report everything works. I'm using texlive with texstudio on ubuntu and I compiled with PdfLaTeX.

Can anybody help me with this issue?

  • 4
    I get a different error, but the key here is that moderncv requires you to set up things in the preamble, which you have not done. Try \documentclass{moderncv} \moderncvstyle{classic} \moderncvcolor{green} \firstname{John} \familyname{Doe} \title{Curriculum Vitae} \begin{document} \maketitle Hello. \end{document} Aug 30, 2017 at 13:26

1 Answer 1


Well, class moderncv is different to the usual one class article etc.

Because it is supposed to typeset a curriculum vitae, there are more information needed than in an "usual" class.

Because a cv needs a name of the person the cv is for you have to add the information


Now you can compile your MWE with an added \name{John}{Doe} without errors but not with the layout of a cv:


% personal data




and the result:

enter image description here

That has compiled without errors, but is far away from a cv ...

To get a real cv you have to add more informations, for example the style of the layout. Then you need to add informations about education etc. Class moderncv provides special commands for that.

The absolut minimal code for an cv with moderncv is the following MWE:


% moderncv themes
 \moderncvstyle{classic} % 'casual' (default), 'classic', 'banking', 'oldstyle' and 'fancy'
 \moderncvcolor{blue}    % 'black' (default)

% character encoding

% adjust the page margins

% personal data
%\title{Resumé title}
%\address{street and number}{postcode city}{country}
%\email{[email protected]}




Hello.  % <========= to be deleted!


%% end of file `template.tex'.

I used the original template.tex file (an cv example) from moderncv and minimalized it. As you can see in the compiled following MWE, your input "Hello." makes no sense now ...

The result you get is:

resulting cv

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .