1

I found a screenshot of a cv that is obviously an adaption of the moderncv class with casualsettings: desired cv style

The two differences to the normal casualsetting are that the photo is below the name and title, instead of the left upper corner. Furthermore the title 'curriculum vitae' has a different position. While I managed to shift the title to the left, I still cannot figure out how to move the photo.

Can you help me to adapt the moderncvclass example to look like depicted in the picture? Thanks a lot in advance! (I left out shifting the title to the left in the MWE, for simplicity)

MWE:

\documentclass[11pt,a4paper,roman]{moderncv}        
\moderncvstyle{casual}                             
\moderncvcolor{blue}                              
\usepackage[scale=0.75]{geometry}       
\name{John}{Doe}
%\title{Curriculum Vitae} % Commented it out, as most important step would be photo   
\photo[80pt][0.4pt]{foto.png}
% document                         
\begin{document}
\makecvtitle
\section{Personal Data}
\cvitem{Name}{John}
\cvitem{Surname}{Doe}
\cvitem{...}{...}

\end{document}

1 Answers1

5
\documentclass[11pt,a4paper,roman]{moderncv}        
% moderncv themes
\moderncvstyle{casual}                             
\moderncvcolor{blue}                              
\usepackage[scale=0.75]{geometry}       
\name{John}{Doe}
\title{Curriculum Vitae}   
\photo[80pt][0.4pt]{example-image-A}
%%%%%% The following passage moves 'Curriculum Vitae' from right to left:
\renewcommand*{\titlefont}{\LARGE\mdseries\upshape}
\makeatletter
\renewcommand*{\makecvtitle}{%
% recompute lengths (in case we are switching from letter to resume, or vice versa)
\recomputecvlengths%
% ensure footer with personal information
\makecvfoot%
% optional picture
\newbox{\makecvtitlepicturebox}%
\savebox{\makecvtitlepicturebox}{%
\ifthenelse{\isundefined{\@photo}}%
  {}%
  {%
   \setlength\fboxrule{\@photoframewidth}%
   \ifdim\@photoframewidth=0pt%
     \setlength{\fboxsep}{0pt}\fi%
    {\color{color1}\framebox{\includegraphics[width=\@photowidth]{\@photo}}}}}%
\hfill%\usebox{\makecvtitlepicturebox}%
% name
\@initializelength{\makecvtitlepicturewidth}%
\settowidth{\makecvtitlepicturewidth}{\usebox{\makecvtitlepicturebox}}%
\parbox[b]{\textwidth-\makecvtitlepicturewidth}{%
 \raggedleft\namefont{\color{color2!50}\@firstname} {\color{color2}\@familyname}}\\        [-.35em]% 
{\color{color2!50}\rule{\textwidth}{.25ex}}%
% optional title
\ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\null\titlestyle{\@title}}
\hfill\smash{\raisebox{\dimexpr-\ht\makecvtitlepicturebox+\baselineskip\relax}{%
  \usebox{\makecvtitlepicturebox}}}\\[2.5em]  % optional quote
\ifthenelse{\isundefined{\@quote}}%
{}%
{{\null\hfill\begin{minipage}   {\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\hfill\null\\[2.5em]}}%
\par}%
\makeatother
%%%%%%% End of passage

% document                         
\begin{document}
\makecvtitle
\section{Personal Data}
\cvitem{Name}{John}
\cvitem{Surname}{Doe}
\cvitem{...}{...}

\end{document}

enter image description here

I'm not sure how much font matching you wanted to the image you were showing, but here are a few other possible changes:

enter image description here

which is obtained with

\documentclass[11pt,a4paper,roman]{moderncv}        
% moderncv themes
\moderncvstyle{casual}                             
\moderncvcolor{blue}                              
\usepackage[scale=0.75]{geometry}       
\name{John}{Doe}
\title{\textsf{\textit{Curriculum Vitae}}}   
\photo[80pt][0.4pt]{example-image-A}
%%%%%% The following passage moves 'Curriculum Vitae' from right to left:
\renewcommand*{\titlefont}{\LARGE\mdseries\upshape}
\makeatletter
\renewcommand*{\makecvtitle}{%
% recompute lengths (in case we are switching from letter to resume, or vice versa)
\recomputecvlengths%
% ensure footer with personal information
\makecvfoot%
% optional picture
\newbox{\makecvtitlepicturebox}%
\savebox{\makecvtitlepicturebox}{%
\ifthenelse{\isundefined{\@photo}}%
  {}%
  {%
   \setlength\fboxrule{\@photoframewidth}%
   \ifdim\@photoframewidth=0pt%
     \setlength{\fboxsep}{0pt}\fi%
    {\color{color1}\framebox{\includegraphics[width=\@photowidth]{\@photo}}}}}%
\hfill%\usebox{\makecvtitlepicturebox}%
% name
\@initializelength{\makecvtitlepicturewidth}%
\settowidth{\makecvtitlepicturewidth}{\usebox{\makecvtitlepicturebox}}%
\parbox[b]{\textwidth-\makecvtitlepicturewidth}{%
 \raggedleft\namefont{\color{color2!50}\textsf{\@firstname}} {%
  \color{color2}\textsf{\@familyname}}}\\        [-.35em]% 
{\color{color2!50}\rule{\textwidth}{.25ex}}%
% optional title
\ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\null\titlestyle{\@title}}
\hfill\smash{\raisebox{\dimexpr-\ht\makecvtitlepicturebox+\baselineskip\relax}{%
  \usebox{\makecvtitlepicturebox}}}\\[0.5em]  % optional quote
\ifthenelse{\isundefined{\@quote}}%
{}%
{{\null\hfill\begin{minipage}   {\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\hfill\null\\[2.5em]}}%
\par}%
\makeatother
%%%%%%% End of passage

% document                         
\begin{document}
\makecvtitle
\section{Personal Data}
\cvitem{Name}{John}
\cvitem{Surname}{Doe}
\cvitem{...}{...}

\end{document}
  • Wow thank you, that is exactly what I was looking for! :) Turned out that the cv looks better without the 'curriculum vitae' title. Anybody who wants to do that can simply write \title{~} (if you comment it out, this example does not work any more) Anyway thank you, my cv is almost done and looks really good! – Ronin100 Mar 27 '15 at 19:16
  • @Ronin100 I'm happy it works for you. If you like this answer, you can click the check mark to the left of it, indicating that you accept it as the best answer to your question. – Steven B. Segletes Mar 27 '15 at 19:19
  • I see. I will do that – Ronin100 Mar 27 '15 at 19:33
  • 1
    These examples did not work out-of-the-box for me, I needed to change \makecvfooter to \makecvfoot, see here – Dominikus K. Jun 07 '17 at 21:16
  • 1
    @DominikusK. Thanks for that note. I guess the document class format changed in the last 2 years. I have revised the code to reflect it. – Steven B. Segletes Jun 08 '17 at 00:38
  • Why do most of your lines end with a %? I don't see what starting a comment there would do. – Sinjai Oct 23 '20 at 07:56
  • @Sinjai Mostly out of habit. However, any line that does not end in a command sequence or % will introduce a space. Often, the space will have no ill effect, but many times, it will introduce an extraneous space in the typeset material. Inside of \newcommands and \defs, one must be very careful on this. – Steven B. Segletes Oct 23 '20 at 13:10
  • @StevenB.Segletes thanks for the explanation. By command sequence, you just mean \somecommand{}, right? In that case I'm not sure I see how any of those are needed above -- or are they not? Would the line after \ifthenelse{\isundefined{\@quote}}% create a space, , in the output? – Sinjai Oct 29 '20 at 03:56
  • @Sinjai Yes, that is what I mean by command sequence. And you are again correct that after \ifthenelse{\isundefined{\@quote}}, the trailing % is not required because \ifthenelse is still absorbing two of its arguments at that point, so any spaces there would be absorbed as \ifthenelse looks for those two arguments. So, as I said, I insert them by habit, because it makes debugging easier. – Steven B. Segletes Oct 29 '20 at 09:09
  • Thanks Steven, really appreciate it. New to LaTeX. I did not know spaces can separate arguments like that -- scary. How does something like \cventry This is a sentence with a bunch of spaces. work? If there's only one argument is there special treatment or what? – Sinjai Nov 02 '20 at 21:35
  • @Sinjai I haven't looked at the particulars, but would guess that \cventry needs its argument in braces, such as \cventry{my data}. Maybe it needs more than one such chunk of data. With braces, the braced quantity (including its spaces) are digested as a single argument. Without braces, as you have shown, T would be taken as the first argument h as the second (if it takes more than one argument), etc. – Steven B. Segletes Nov 03 '20 at 00:01