![cvdoublecolumn 在 latex 中使用现代 CV 包进行引用时产生错误](https://linux22.com/image/334284/cvdoublecolumn%20%E5%9C%A8%20latex%20%E4%B8%AD%E4%BD%BF%E7%94%A8%E7%8E%B0%E4%BB%A3%20CV%20%E5%8C%85%E8%BF%9B%E8%A1%8C%E5%BC%95%E7%94%A8%E6%97%B6%E4%BA%A7%E7%94%9F%E9%94%99%E8%AF%AF%20.png)
我正在使用 TeX 包制作简历moderncv
。我希望在简历中输入参考资料。当我使用双列命令时出现错误。错误是
未定义控制序列 \listdoublecolumnwidth
以下是我的代码。提前致谢。
\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}
{[email protected]}
{+91-11-41493939}
}
答案1
嗯,你的代码中有几个错误。
您定义了两个具有不同数量参数的命令:
\cvdoublecolumn{col1}{col2}
\cvreference{name}{addr1}{addr2}{addr3}{addr4}{email}{phone}
然后你必须在代码中按如下方式使用它们(请注意我移动了定义前线\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}%
{[email protected]}%
{+91-11-41493939}%
}{\cvreference{name}{addr1}{addr2}{addr3}{addr4}{email}{phone}}
\end{document}
结果:
答案2
您的文件moderncv.cls
(或许还有其他.sty
文件)肯定已过期。请更新它(它们),从https://github.com/xdanaux/moderncv。