0

I'm working on my CV. When i compile the follwing code i get the following error : Undefined control sequence \makecvtitle The code doesn't work and i didn't find the problem source.

\documentclass[11pt,a4paper,sans]{moderncv} % Font sizes: 10, 11, or 12; paper sizes: a4paper, letterpaper, a5paper, legalpaper, executivepaper or landscape; font families: sans or roman

\moderncvstyle{casual} % CV theme - options include: 'casual' (default), 'classic', 'oldstyle' and 'banking'
\moderncvcolor{blue} % CV color - options include: 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black'

%\usepackage{lipsum} % Used for inserting dummy 'Lorem ipsum' text into the template

%\usepackage[scale=0.75]{geometry} % Reduce document margins
%\setlength{\hintscolumnwidth}{3cm} % Uncomment to change the width of the dates column
%\setlength{\makecvtitlenamewidth}{10cm} % For the 'classic' style, uncomment to adjust the width of the space allocated to your name

\moderncvstyle{classic}


\usepackage{tikz}
\newcommand{\grade}[1]{%
\begin{tikzpicture}
\clip (1em-.3em,-.3em) rectangle (5em +.5em ,.3em);
\begin{scope}
\clip (1em-.3em,-.3em) rectangle (#1em +.5em ,.3em);
\foreach \x in {1,2,...,5}{
 \path[fill=red] (\x em,0) circle (.25em);
}
\end{scope}
\foreach \x in {1,2,...,5}{
 \draw (\x em,0) circle (.25em);
}
\end{tikzpicture}%
}

\makeatletter
\renewcommand*{\makecvtitle}{%
  % recompute lengths (in case we are switching from letter to resume, or vice versa)
  \recomputecvlengths%
  % optional detailed information box
  \newbox{\makecvtitledetailsbox}%
  \savebox{\makecvtitledetailsbox}{%
    \addressfont\color{color2}%
    \begin{tabular}[b]{@{}p{10cm}@{}}%
      \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet %
        \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}} % if \addresstreet is defined, \addresscity will always be defined but could be empty
      \ifthenelse{\isundefined{\@mobile}}{}{\makenewline\mobilesymbol\@mobile} %
      \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
    \end{tabular}
  }%
  % optional photo (pre-rendering)
  \newbox{\makecvtitlepicturebox}%
  \savebox{\makecvtitlepicturebox}{%
    \ifthenelse{\isundefined{\@photo}}%
    {}%
    {%
     % \hspace*{\separatorcolumnwidth}%
      \color{color1}%
      \setlength{\fboxrule}{\@photoframewidth}%
      \ifdim\@photoframewidth=0pt%
        \setlength{\fboxsep}{0pt}\fi%
      \framebox{\includegraphics[width=\@photowidth]{\@photo}}}}%
  % name and title
  \newlength{\makecvtitledetailswidth}\settowidth{\makecvtitledetailswidth}{\usebox{\makecvtitledetailsbox}}%
  \newlength{\makecvtitlepicturewidth}\settowidth{\makecvtitlepicturewidth}{\usebox{\makecvtitlepicturebox}}%
  \ifthenelse{\lengthtest{\makecvtitlenamewidth=0pt}}% check for dummy value (equivalent to \ifdim\makecvtitlenamewidth=0pt)
    {\setlength{\makecvtitlenamewidth}{\textwidth-\makecvtitlepicturewidth
}}%
    {}%
 % \begin{minipage}[b]{\makecvtitlenamewidth}%
    \raggedright\namestyle{\@firstname\ \@familyname}\par\medskip%
    \ifthenelse{\equal{\@title}{}}{}{{\centering\titlestyle{\@title}\par}\medskip}%
  %\hfill%
  % detailed information
%  \llap{
%
\usebox{\makecvtitledetailsbox}%
%\end{minipage}\ignorespaces%
%}% \llap is used to suppress the width of the box, allowing overlap if the value of makecvtitlenamewidth is forced
  % optional photo (rendering)
  \usebox{\makecvtitlepicturebox}\\[2.5em]%
  % optional quote
  \ifthenelse{\isundefined{\@quote}}%
    {}%
    {{\centering\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}}%
  \par}% to avoid weird spacing bug at the first section if no blank line is left after \makecvtitle
\makeatother

\usepackage[scale=0.75]{geometry}
% personal data
\name{Aaa}{Jjjj}
\title{Phd student}
\address{xxxx}{xxx}{xxxxx}
\phone[mobile]{0000000}
\email{xxxxxxxxxx}
\photo[64pt][0.4pt]{picture}

%----------------------------------------------------------------------------------------

\begin{document}


%----------------------------------------------------------------------------------------
%   CURRICULUM VITAE
%----------------------------------------------------------------------------------------

\makecvtitle
\end{document}

Could you please help me ?

Thank you,

marked as duplicate by Mensch, Troy, Bobyandbob, user121799, Mico May 14 '18 at 15:31

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • you're missing an \end{document} – naphaneal Apr 18 '18 at 9:39
  • Yes you're right! just i forgot to write it in the question message. I will add it. But it's not the problem source. – Zoya Apr 18 '18 at 9:41
  • Maybe your template bases on an outdated moderncv version. It works for me with TeXLive2014. But with newer TL versions I get an error regarding undefined control sequence \makecvtitlenamewidth. – esdd Apr 18 '18 at 10:12
  • the error lies inside the renewcommand of makecvtitle. I'll try to figure it out later this day, if someone else does not beat me to it. – naphaneal Apr 18 '18 at 10:42
  • I downloed the moderncv from this link : ctan.org/tex-archive/macros/latex/contrib/moderncv?lang=en. I'm working with TeXstudio 2.7.0 – Zoya Apr 18 '18 at 15:15

Browse other questions tagged or ask your own question.