Miktex 更新后 moderncv 出现问题

Miktex 更新后 moderncv 出现问题

我最近一直在使用 moderncv 生成一些求职信和简历。一切都运行良好,直到我进行了 Miktex 更新。我不断收到Undefined control sequence. \makelettertitle以下 MWE 的错误(以前可以毫无问题地运行!):

\documentclass[12pt,a4paper,sans]{moderncv} 
\moderncvstyle{classic} 
\moderncvcolor{blue} 
\usepackage{lipsum} 

\usepackage[scale=0.82]{geometry} \geometry{textheight=25cm}
\usepackage[ngerman]{babel}
\usepackage{blindtext}
\usepackage{ragged2e}
\usepackage{pdfpages}
%%%%%%%%%%%%%%%%%%%

\makeatletter

\renewcommand*{\makelettertitle}{%
  % recompute lengths (in case we are switching from letter to resume, or vice versa)
  \recomputeletterlengths%
  % sender contact info
  %\hfill%
  \begin{minipage}{.5\textwidth}%
    \raggedright% \raggedleft
    \addressfont\textcolor{color2}{%
      \makebox[\textwidth][l]{\makebox[2\textwidth]{\bfseries\upshape\@firstname~\@lastname\hfill\normalfont\textcolor{black}{\@date}}}\@firstdetailselementfalse%
      \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%
        \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% if \addresstreet is defined, \addresscity and addresscountry will always be defined but could be empty
        \ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%
      \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
        \makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}%
      \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
      \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%
      \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}%
    \end{minipage}\\[3em]
  % recipient block
  \begin{minipage}[t]{.5\textwidth}
    \raggedright%
    \addressfont%
    {\@recipientname}\\%
    \@recipientaddress%
  \end{minipage} \\[2em]
  % date
  %\hfill% US style
%  \\[1em]% UK style
  %\@date\\[2em]% US informal style: "January 1, 1900"; UK formal style: "01/01/1900"
  % opening
  \raggedright%
  \@opening\\[1.5em]%
  % ensure no extra spacing after \makelettertitle due to a possible blank line
%  \ignorespacesafterend% not working
  \hspace{0pt}\par\vspace{-\baselineskip}\vspace{-\parskip}} 

\setlength{\makecvtitlenamewidth}{12cm}
\renewcommand*{\namefont}{\fontsize{24}{29}\mdseries\upshape}

\makeatother

%\patchcmd{\makeletterclosing}{[2em]}{[1em]}{}{}
\firstname{XXXXXX} % Your first name
\familyname{XXXXXX} 
\title{CV}
\address{XXXXXX,12}{12345,XXXXXX}
\email{[email protected]}
\begin{document}
\recipient{XXXX}{XXXX\\XXXXXXXXXXXX\\1234 XXXXXX\\XXXXXX} 
\date{\today} % Letter date
\opening{blablabla,} % Opening greeting
\closing{blablabla} % Closing phrase
\enclosure[Im Anhang]{CV} % List of enclosed documents

\makelettertitle % Print letter title
\blindtext[3]
\makeletterclosing % Print letter signature
\clearpage

%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Lebenslauf
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\clearpage

\makecvtitle % Print the CV title

\section{EDV- Kenntnisse}

\cvitem{Tool}{C, C++, VHDL}
\cvitem{Betriebssystem}{Unix, Windows}
\cvitem{Simulations-Tools}{Tool, Tool, Tool II, Tool}

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

\end{document}

任何帮助都将受到赞赏。

更新: 根据日志文件,错误如下:

  • Undefined control sequence. \setlength{\makecvtitlenamewidth}{12cm}
  • Missing number, treated as zero. \renewcommand
  • Illegal unit of measure (pt inserted). \renewcommand

它们分别源自两个命令:

 \setlength{\makecvtitlenamewidth}{12cm}
\renewcommand*{\namefont}{\fontsize{24}{29}\mdseries\upshape}

答案1

\makecvtitlenamewidth作为一部分而存在moderncv1.5.0,但被从moderncv1.5.1- 当前最新版本。

当前的替代品似乎是\makecvheadnamewidth,这是的默认值0pt(用于自动设置宽度的条件)。

该类经历了许多变化,导致旧版本的文档与当前版本不兼容。如果您希望保留旧格式,则需要维护该类的临时版本。否则,您必须相应地更新您的文件。

相关内容