Atualize para moderncv2.0.0:

Atualize para moderncv2.0.0:

Gosto do moderncv casualtema, mas gostaria de alterar a ordem da foto e o nome/título.

Eu tentei a solução descrita nesta pergunta:

Modificar cabeçalho moderncv

! Undefined control sequence.
\maketitle ->{{\firstnamestyle 
                               {\@firstname}~\familynamestyle {\@familyname}...
l.33 \maketitle

Código de exemplo:

\documentclass[11pt,a4paper]{moderncv}

% moderncv themes
\moderncvtheme[blue]{casual}
\AtBeginDocument
{
% reverse the name and photo
\makeatletter
% maketitle
\renewcommand*{\maketitle}{%
  {%
    {\firstnamestyle{\@firstname}~\familynamestyle{\@familyname}}}%
    \hfill%
    \ifthenelse{\isundefined{\@photo}}%
      {}%
      {{\color{firstnamecolor}\framebox{\includegraphics[width=\@photowidth]{\@photo}}}\\[-.35em]}%
    {\color{firstnamecolor}\rule{\textwidth}{.25ex}\\[2.5em]}%
% optional quote
  \ifthenelse{\isundefined{\@quote}}%
    {}%
    {{\centering{}\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}}%
  \par}% to avoid weird spacing bug at the first section if no blank line is left after \maketitle
\makeatother
}

\firstname{John}
\familyname{Doe}
\title{Curriculum Vitae}    
\address{Example Street}{12345 Exampe Town}
\photo{picture}

\begin{document}
\maketitle
\end{document}

Responder1

Uma forma de resolver o problema, essa classe moderncvmudou poderia ser o seguinte MWE. A parte seguinte \AtBeginDocumentreescreve a definição original em moderncv.

Por favor considerem: se a classe moderncvfor alterada novamente, talvez seja necessário alterar suas correções novamente. Talvez fosse uma boa ideia pedir ao autor que moderncvintegrasse uma opção para alterar a posição do nome e da imagem.

O MWE alterado:

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

O resultado é: Resultado do MWE

Atualize para moderncv2.0.0:

Como já mencionado acima, a classe moderncvmudou e, portanto, você precisa do seguinte código usando a classe version 2.0.0.

Com a versão atual moderncv 2015/07/28 v2.0.0 modern curriculum vitae and letter document classvocê pode definir o estilo casualcom uma opção adicional [left]de imprimir o nome à esquerda, a imagem à direita no título do CV conforme desejado nesta questão.

Veja que existem novos comandos disponíveis para definir números de telefone etc. e para adicionar novas informações como linkedinou github...

Consulte o seguinte MWE (novo código marcado com <======):

\documentclass[11pt,a4paper]{moderncv}

\moderncvstyle[left]{casual} % <========================================
\moderncvcolor{blue}

\name{John}{Doe} % <====================================================
\title{Resumé title}
\address{street and number}{postcode city}{country}
\phone[mobile]{+1~(234)~567~890} % <====================================
\phone[fixed]{+2~(345)~678~901} % <=====================================
\phone[fax]{+3~(456)~789~012} % <=======================================
\email{[email protected]}
\homepage{www.johndoe.com}
\social[linkedin]{john.doe} % <=========================================
\social[twitter]{jdoe} % <==============================================
\social[github]{jdoe} % <===============================================
\extrainfo{additional information}
\photo[64pt][0.4pt]{picture}
\quote{Some quote}

\setlength{\footskip}{84pt} % <=========================================


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

Veja que essa linha \setlength{\footskip}{84pt}só é necessária porque adicionei mais informações pessoais ao rodapé. Para o seu CV por favor não adicione esta linha, compile e verifique *.logse há um aviso no arquivo, que footskip is too small.use o valor arredondado fornecido naquele aviso para o seu CV ...

Responder2

A versão atualizada do moderncv torna isso obsoleto - há uma opção incluída no pacote para alterar isso. ao carregar o \moderncvstyle, inclua a opção [esquerda] assim:

\moderncvstyle[left]{casual}

informação relacionada