I am making my CV using the TeX package moderncv. I wish to enter references in my CV. I am getting an error when I use the command for double column. The error is

undefined control sequence \listdoublecolumnwidth

Following is my code. Many thanks in advance.

\documentclass[11pt,a4paper]{moderncv}
\moderncvtheme[green]{classic}   
 \usepackage[utf8]{inputenc}     
\usepackage{hyperref}                               
\definecolor{linkcolour}{rgb}{0,0.2,0.6}
\hypersetup{colorlinks,breaklinks,urlcolor=linkcolour, linkcolor=linkcolour}
\firstname{Ridhima}
\familyname{Gupta}
\begin{document}
\maketitle

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

    \newcommand{\cvreference}[7]{%
    \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}}

 \cvdoublecolumn{\cvreference{E. Somanathan}
{Professor}
{Economics and Planning Unit}
{Indian Statistical Institute}
{Delhi-110016}
 {som@isid.ac.in}
{+91-11-41493939}
}

closed as unclear what you're asking by Heiko Oberdiek, marmot, Sebastiano, Mico, Bobyandbob May 27 at 6:05

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

Well, you have several errors in your code.

You defined two commands with different number of parameters:

\cvdoublecolumn{col1}{col2}
\cvreference{name}{addr1}{addr2}{addr3}{addr4}{email}{phone}

Then you have to use them as follows in your code (please see that I moved the definitions before line \begin{document}:

\documentclass[11pt,a4paper]{moderncv}
\moderncvtheme[green]{classic}   

\usepackage[utf8]{inputenc}     
%\usepackage{hyperref}

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

\newcommand{\cvreference}[7]{%
  \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}%
}


\definecolor{linkcolour}{rgb}{0,0.2,0.6}
%\hypersetup{colorlinks,breaklinks,urlcolor=linkcolour, linkcolor=linkcolour}

\firstname{Ridhima}
\familyname{Gupta}


\begin{document}

\maketitle

\cvreference{name}{addr1}{addr2}{addr3}{addr4}{email}{phone}

\cvdoublecolumn{% 
  \cvreference{E. Somanathan}%
    {Professor}%
    {Economics and Planning Unit}%
    {Indian Statistical Institute}%
    {Delhi-110016}%
    {som@isid.ac.in}%
    {+91-11-41493939}%
}{\cvreference{name}{addr1}{addr2}{addr3}{addr4}{email}{phone}}

\end{document}

and the result:

enter image description here

  • I copy pasted just your commands and ran them in a new tex file, I get an error saying ./Untitled-2.tex:49: Undefined control sequence. <argument> \listdoubleitemcolumnwidth l.49 ...addr1}{addr2}{addr3}{addr4}{email}{phone}} ? I also don't want my output to look like this. I don't want fields like name, addr1 etc. to appear. It should look like tex.stackexchange.com/questions/34881/… – Ridhima May 19 '16 at 16:01
  • Add \listfiles as first line to the MWE, compile 3 times and check the log file at the end for a list of used packages and versions. Add this list to your question. I'm sure you are using an outdated version of moderncv ... – Kurt May 19 '16 at 16:05
  • Okay Kurt will do that but will take me time, thanks a lot! – Ridhima May 19 '16 at 16:15
  • @Ridhima Do you have any news for us? Can you now add the requested listfile and versionnumber of moderncv? – Kurt Jun 15 '16 at 22:53
  • 1
    @Ridhima Do you have any news for us? – Kurt Nov 7 '17 at 17:13

Your moderncv.cls (and perhaps some other .sty files) must be out of date. Update it (them), from https://github.com/xdanaux/moderncv.

Not the answer you're looking for? Browse other questions tagged or ask your own question.