ModernCV(新版):右侧为图片,左侧为姓名

ModernCV(新版):右侧为图片,左侧为姓名

不幸的是,ModernCV 又变了。我使用了问题的答案ModernCV 休闲标题上次我使用 CV 时,它运行得很好,但现在我收到错误“未定义控制序列。\makecvtitle”。我真的不知道要更改什么才能让它再次运行。非常感谢您的帮助!

平均能量损失

\documentclass[11pt,a4paper]{moderncv}

\moderncvstyle{casual}
\moderncvcolor{blue}

\firstname{John}
\familyname{Doe}
\title{Resumé title}
\address{street and number}{postcode city}
\mobile{+1~(234)~567~890}
\phone{+2~(345)~678~901}
\fax{+3~(456)~789~012}
\email{[email protected]}
\homepage{www.johndoe.com}
\extrainfo{additional information}
\photo[64pt][0.4pt]{picture}
\quote{Some quote}

\makeatletter
%\AtBeginDocument
%{
% reverse the name and photo
\renewcommand*{\makecvtitle}{%
  \recomputecvlengths%
  \makecvfooter%
  % define optional picture
  \newbox{\makecvtitlepicturebox}%
  \savebox{\makecvtitlepicturebox}{%
    \ifthenelse{\isundefined{\@photo}}%
      {
        \@initializelength{\makecvtitlepicturewidth}% Damit Länge bekannt bei Name
        \settowidth{\makecvtitlepicturewidth}{0pt}%
      }%
      {%
       \setlength\fboxrule{\@photoframewidth}%
       \ifdim\@photoframewidth=0pt%
         \setlength{\fboxsep}{0pt}\fi%
       {\color{color1}\framebox{\includegraphics[width=\@photowidth]{\@photo}}}}
        \@initializelength{\makecvtitlepicturewidth}% Damit Länge bekannt bei Name
        \settowidth{\makecvtitlepicturewidth}{\usebox{\makecvtitlepicturebox}}%
      }%
  % end define optional picture

  % name
%    \parbox[b]{\textwidth-\makecvtitlepicturewidth}{%
 {   \raggedright\namefont{\color{color2!50}\@firstname} {\color{color2}\@familyname}}%\lastname -> error
    \hfill\usebox{\makecvtitlepicturebox}%
%    \parbox[b]{\textwidth-\makecvtitlepicturewidth}{%
%   \raggedleft\namefont{\color{color2!50}\@firstname} {\color{color2}\@lastname}}%\familyname
\\[-.35em]%
  {\color{color2!50}\rule{\textwidth}{.25ex}}%
  % optional title
  \ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\null\hfill\titlestyle{\@title}}\\[2.5em]% 
  % optional quote
  \ifthenelse{\isundefined{\@quote}}%
    {}%
    {{\null\hfill\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\hfill\null\\[2.5em]}}%
  \par}% 
%}% AtBeginDocument ende
\makeatother


\begin{document}
\makecvtitle

\section{Education}
\cventry{year--year}{Degree}{Institution}{City}{ \textit{Grade} }{Description}  % arguments 3 to 6 can be left empty
\cvitem{title}{ \emph{Title} }
\cvitemwithcomment{Language 1}{Skill level}{Comment}
\cvdoubleitem{category X}{XXX, YYY, ZZZ}{category Y}{XXX, YYY, ZZZ}
\cvlistitem{Item 1}
\cvlistdoubleitem{Item 2}{Item 3}
\end{document}

结果应该是: MWE 结果

答案1

我刚刚在更新中看到,包中现在包含这样的选项。您必须在 \moderncvstyle 中包含选项 [left]。下次我会提前学习阅读变更日志。

相关内容