# Why is this giving the error “Missing number, treated as zero”?

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}%
}%
}

% 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{#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{References}

\end{document}


• 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

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{\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}%
}%
}

% 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{#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}

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}.
• It won't compile if you uncomment %\AtBeginDocument{\setlength{\maketitlenamewidth}{9cm}}. – Bernard Oct 15 '15 at 0:45