One way to solve the problem, that class moderncv
has changed could be the following MWE. The part after \AtBeginDocument
rewrites the original definition in moderncv
.
Please keep in mind: if the class moderncv
is changed again, you may need to change your corrections again. Perhaps it would be a good idea to ask the author of moderncv
to integrate an option to change the position of name and picture.
The changed 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{john@doe.org}
\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}
The result is:
Update to moderncv
2.0.0:
As already mentioned above class moderncv
has changed and therefore you need the following code using class version 2.0.0
.
With the current version moderncv 2015/07/28 v2.0.0 modern curriculum vitae and letter document class
you can define for style casual
with an additional option [left]
to get the name printed left, the image right in the title of the CV as wished in this question.
Please see that there are new commands available to define phone numbers etc. and to add new infos like linkedin
or github
...
Please see the following MWE (new code marked with <======
):
\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{john@doe.org}
\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}
Please see that line \setlength{\footskip}{84pt}
is only needed because I added more personal infos into the footer. For your CV please do not add this line, compile and check the *.log
file for a warning, that footskip is too small.
use the rounded value given in that warning for your CV ...
Font styling of elements like title are controlled by corresponding commands of the form \titlefont
. The default in your case is \LARGE\mdseries\slshape
. So to get upright, replace the latter by \upshape
. For the positioning the title, I am afraid you have to copy the style file's definition of \makecvtitle
and remove the \hfill
before the title insertion. As this definition includes internal commands with @
in them, you have to enclose the redifinition in a \makeatletter/\makeother
pair.
\documentclass{moderncv}
\usepackage{moderncvstylecasual}
\firstname{Roozbeh} \familyname{Sasan} \title{Curriculum Vitae}
\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
\makecvfooter%
% 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}}}}}%
\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}}\\[2.5em] % optional quote
\ifthenelse{\isundefined{\@quote}}%
{}%
{{\null\hfill\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\hfill\null\\[2.5em]}}%
\par}%
\makeatother
\begin{document}
\makecvtitle
Test.
\end{document}
ADDED in response to comment:
To make similar adjustments for the name, look at the lines containing \@firstname
. Changing \raggedleft
to \raggedright
there will make the name left aligned. Finally removing the \color
commands will give you black text. These lines then become:
\parbox[b]{\textwidth-\makecvtitlepicturewidth}{%
\raggedright\namefont{\@firstname} {\@familyname}}\\[-.35em]%
{\rule{\textwidth}{.25ex}}%
and a complete document is:
\documentclass{moderncv}
\usepackage{moderncvstylecasual}
\firstname{Roozbeh} \familyname{Sasan} \title{Curriculum Vitae}
\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
\makecvfooter%
% 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}}}}}%
\usebox{\makecvtitlepicturebox}%
% name
\@initializelength{\makecvtitlepicturewidth}%
\settowidth{\makecvtitlepicturewidth}{\usebox{\makecvtitlepicturebox}}%
\parbox[b]{\textwidth-\makecvtitlepicturewidth}{%
\raggedright\namefont{\@firstname} {\@familyname}}\\[-.35em]%
{\rule{\textwidth}{.25ex}}%
% optional title
\ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\null\titlestyle{\@title}}\\[2.5em] % optional quote
\ifthenelse{\isundefined{\@quote}}%
{}%
{{\null\hfill\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\hfill\null\\[2.5em]}}%
\par}%
\makeatother
\begin{document}
\makecvtitle
Test.
\end{document}
Best Answer
In command
\makecvhead
you can find the definition for the title:To be able to use in your cv the commands
we need to add a mechanismn for
\titleb
.In the following MWE I did that (see marking
<======
for important code changes):with the following result:
The advantage is that you will get the usual layout without or with
\titleb
and without any warnings fromhyperref
about wrong tokens like\\
...