1

I cannot understand why on earth the following latex code is giving error. Nothing seems wrong to me. Could you please find why this error occurring? I have added an image to show the error message. I wrote this in TeXStudio and MiKTEX.

\documentclass[11pt,a4paper]{moderncv}

% moderncv themes
%\moderncvtheme[blue]{casual}                 % optional argument are 'blue' (default), 'orange', 'red', 'green', 'grey' and 'roman' (for roman fonts, instead of sans serif fonts)
\moderncvtheme[blue]{classic}                    % idem

% character encoding
\usepackage[applemac]{inputenc}     % to print ä ö ü

% adjust the page margins
\usepackage[scale=0.85]{geometry}
\setlength{\hintscolumnwidth}{3cm}                      % if you want to change the width of the column with the dates
\AtBeginDocument{\setlength{\maketitlenamewidth}{9cm}}  % only for the classic theme, if you want to change the width of your name placeholder (to leave more space for your address details
\AtBeginDocument{\recomputelengths}                     % required when changes are made to page layout lengths


% Define \cvdoublecolumn, which sets its arguments in two columns without any labels

\newcommand{\cvdoublecolumn}[2]{%
    \cvitem[0.75em]{}{%
        \begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#1\end{minipage}%
        \hfill%
        \begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#2\end{minipage}%
    }%
}

% usage: \cvreference{name}{address line 1}{address line 2}{address line 3}{address line 4}{e-mail address}{phone number}
% Everything but the name is optional
% If \addresssymbol, \emailsymbol or \phonesymbol are specified, they will be used.
% (Per default, \addresssymbol isn't specified, the other two are specified.)
% If you don't like the symbols, remove them from the following code, including the tilde ~ (space).

\newcommand{\cvreference}[8]{%
    \textbf{#1}\newline% Name
    \ifthenelse{\equal{#2}{}}{}{\addresssymbol~#2\newline}%
    \ifthenelse{\equal{#3}{}}{}{#3\newline}%
    \ifthenelse{\equal{#4}{}}{}{#4\newline}%
    \ifthenelse{\equal{#5}{}}{}{#5\newline}%
    \ifthenelse{\equal{#6}{}}{}{\emailsymbol~\texttt{#6}\newline}%
    \ifthenelse{\equal{#7}{}}{}{\phonesymbol~#7\newline}%
    \ifthenelse{\equal{#8}{}}{}{\mobilephonesymbol~#8}
}



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


\makeatletter
\renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}
\makeatother

% bibliography with mutiple entries
%\usepackage{multibib}
%\newcites{book,misc}{{Books},{Others}}

%\nopagenumbers{}                             % uncomment to suppress automatic page numbering for CVs longer than one page
%----------------------------------------------------------------------------------
%            content
%----------------------------------------------------------------------------------
\begin{document}
\maketitle

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

\section{Personal Information}

\section{Personal Statement}

\section{Masters Thesis}

\section{Professional Experience}




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


\section{Project Experience}

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

\section{Technical Skills}

\section{Web Links}

%---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
\section{References}



\end{document}

This is the error report!

8
  • Welcome to TeX.SX! I get a lot of other errors -- \familyname --> unset, \maketitlenamewidth --> unknown – user31729 Oct 14 '15 at 23:49
  • You wrote this under MiKTeX and use applemac encoding? – Bernard Oct 14 '15 at 23:55
  • I have absolutely no problem after I've changed the input encoding to utf8. – Bernard Oct 14 '15 at 23:59
  • @Bernard: Even after changing to utf8 I can't compile this. I get the error that the length \maketitlenamewidth is unknown – user31729 Oct 15 '15 at 0:02
  • @Bernard Why is Latex so inconsistent? – the_naive Oct 15 '15 at 0:17
3

You showed us not which command throws the "Missing number" error.

For me is clear that you use an old version of class moderncv. The current one is moderncv 2015/07/28 v2.0.0 modern curriculum vitae and letter document class.

With the following corrections and adding some dummy infos I can compile without any error.

MWE

\documentclass[11pt,a4paper]{moderncv}

% moderncv themes
%\moderncvtheme[blue]{casual}                 % optional argument are 'blue' (default), 'orange', 'red', 'green', 'grey' and 'roman' (for roman fonts, instead of sans serif fonts)
\moderncvtheme[blue]{classic}                    % idem

% character encoding
\usepackage[utf8]{inputenc}     % to print ä ö ü

% adjust the page margins
\usepackage[scale=0.85]{geometry}
\setlength{\hintscolumnwidth}{3cm}                      % if you want to change the width of the column with the dates
%\AtBeginDocument{\setlength{\maketitlenamewidth}{9cm}}  % only for the classic theme, if you want to change the width of your name placeholder (to leave more space for your address details
\AtBeginDocument{\setlength{\makecvheadnamewidth}{9cm}}
\AtBeginDocument{\recomputelengths}                     % required when changes are made to page layout lengths


% Define \cvdoublecolumn, which sets its arguments in two columns without any labels

\newcommand{\cvdoublecolumn}[2]{%
    \cvitem[0.75em]{}{%
        \begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#1\end{minipage}%
        \hfill%
        \begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#2\end{minipage}%
    }%
}

% usage: \cvreference{name}{address line 1}{address line 2}{address line 3}{address line 4}{e-mail address}{phone number}
% Everything but the name is optional
% If \addresssymbol, \emailsymbol or \phonesymbol are specified, they will be used.
% (Per default, \addresssymbol isn't specified, the other two are specified.)
% If you don't like the symbols, remove them from the following code, including the tilde ~ (space).

\newcommand{\cvreference}[8]{%
    \textbf{#1}\newline% Name
    \ifthenelse{\equal{#2}{}}{}{\addresssymbol~#2\newline}%
    \ifthenelse{\equal{#3}{}}{}{#3\newline}%
    \ifthenelse{\equal{#4}{}}{}{#4\newline}%
    \ifthenelse{\equal{#5}{}}{}{#5\newline}%
    \ifthenelse{\equal{#6}{}}{}{\emailsymbol~\texttt{#6}\newline}%
    \ifthenelse{\equal{#7}{}}{}{\phonesymbol~#7\newline}%
    \ifthenelse{\equal{#8}{}}{}{\mobilephonesymbol~#8}
}



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


\makeatletter
\renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}
\makeatother

% bibliography with mutiple entries
%\usepackage{multibib}
%\newcites{book,misc}{{Books},{Others}}

%\nopagenumbers{}                             % uncomment to suppress automatic page numbering for CVs longer than one page
%----------------------------------------------------------------------------------
%            content
%----------------------------------------------------------------------------------

\name{John}{Doe}
\title{CV}
\address{street and number}{postcode city}
\mobile{+1~(234)~567~890}
\phone{+2~(345)~678~901}
\fax{+3~(456)~789~012}
\email{john@doe.com}
\homepage{www.johndoe.com}


\begin{document}
\maketitle


\section{Personal Information}

\section{Personal Statement}

\section{Masters Thesis}

\section{Professional Experience}

\section{Project Experience}
\section{Technical Skills}
\section{Web Links}
\section{References}
\end{document}

See the changed line \AtBeginDocument{\setlength{\makecvheadnamewidth}{9cm}}. With the new version maketitlenamewidth has to be changed as shown.

See the added dummy infos before \begin{document}.

Result:

enter image description here

2
  • It won't compile if you uncomment %\AtBeginDocument{\setlength{\maketitlenamewidth}{9cm}}. – Bernard Oct 15 '15 at 0:45
  • Possibly, but the error message says it doen't know it (and I'm using version 2.0) and I checked it's not even mentioned elsewhere in the whole bunch of files. – Bernard Oct 15 '15 at 0:53

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.