Update auf moderncv2.0.0:

Update auf moderncv2.0.0:

Mir gefällt das moderncv casualThema, aber ich möchte die Reihenfolge der Fotos und den Namen/Titel ändern.

Ich habe die in dieser Frage beschriebene Lösung ausprobiert:

ModernCV-Header ändern

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

Beispielcode:

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

Antwort1

Eine Möglichkeit, das Problem, dass sich die Klasse geändert hat, zu lösen, moderncvkönnte das folgende MWE sein. Der Teil danach \AtBeginDocumentschreibt die ursprüngliche Definition in neu moderncv.

bitte bedenke: Wenn die Klasse moderncverneut geändert wird, müssen Sie Ihre Korrekturen möglicherweise erneut vornehmen. Vielleicht wäre es eine gute Idee, den Autor zu bitten, moderncveine Option zum Ändern der Position von Name und Bild einzubauen.

Das geänderte MWE:

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

Das Ergebnis ist: Ergebnis von MWE

Update auf moderncv2.0.0:

Wie oben bereits erwähnt moderncvhat sich die Klasse geändert und daher benötigen Sie den folgenden Code mit der Klasse „Version“ 2.0.0.

Mit der aktuellen Version können Sie bei dieser Frage mit der zusätzlichen Option moderncv 2015/07/28 v2.0.0 modern curriculum vitae and letter document classden Stil festlegen , ob der Name links und das Bild rechts im Titel des Lebenslaufs gedruckt werden soll.casual[left]

Bitte beachten Sie, dass neue Befehle zum Definieren von Telefonnummern usw. und zum Hinzufügen neuer Informationen wie linkedinoder github... verfügbar sind.

Bitte beachten Sie den folgenden MWE (neuer Code mit gekennzeichnet <======):

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

Bitte beachten Sie, dass diese Zeile \setlength{\footskip}{84pt}nur benötigt wird, weil ich weitere persönliche Informationen in die Fußzeile eingefügt habe. Fügen Sie diese Zeile für Ihren Lebenslauf bitte nicht hinzu. Kompilieren und überprüfen Sie die *.logDatei auf eine Warnung. footskip is too small.Verwenden Sie dann den in dieser Warnung angegebenen gerundeten Wert für Ihren Lebenslauf ...

Antwort2

Die aktualisierte Version von moderncv macht dies überflüssig – im Paket ist eine Option enthalten, um dies zu ändern. Wenn Sie \moderncvstyle laden, schließen Sie die Option [left] wie folgt ein:

\moderncvstyle[left]{casual}

verwandte Informationen