Classic Style with Picture - How do I move my name above the adress?

Asked by Madelen Mueller on 2012-08-08

Dear Xavier,

I have not too much experience with Latex, so I do not know how to solve this problem - and if it is possible at all:

I use the moderncv style classic with a profile picture. Unfortunately both my name and my e-mail-address are very long (e-mail-address has got 33 signs, including 3 m and 1 w). I already used a box for the name and a little trick to include a line break* in the e-mail-adress, but it does not look right this way.

Is there a possibility to have the name being written above the adress in a way that those are all raggedleft and are flush with the picture?

Ex.: [some free space here] my first name [my picture]
                                                     my last name [my picture]
                                                           my adress [my picture]

I tried to understand what I would have to change in the moderncvstyleclassic.sty, but I did not get it. Could you please explain it to me?

Best regards,
Madelen.

*PS: Is there a way to have line breaks within the cv-items?

Question information

Language:
English Edit question
Status:
Solved
For:
moderncv Edit question
Assignee:
Xavier Danaux Edit question
Solved by:
Xavier Danaux
Solved:
2012-08-09
Last query:
2012-08-09
Last reply:
2012-08-09
Best Xavier Danaux (xdanaux) said : #1

Hi Madelen,

You will need to redefine \makecvtitle. The following definition should achieve what you described:

\renewcommand{\makecvtitle}{%
  \recomputecvlengths%
  % optional picture box
  \newbox{\makecvtitlepicturebox}%
  \savebox{\makecvtitlepicturebox}{%
    \ifthenelse{\isundefined{\@photo}}%
    {}%
    {%
      \hspace*{\separatorcolumnwidth}%
      \color{color1}%
      \setlength{\fboxrule}{\@photoframewidth}%
      \ifdim\@photoframewidth=0pt%
        \setlength{\fboxsep}{0pt}\fi%
      \framebox{\includegraphics[width=\@photowidth]{\@photo}}}}%
  \newlength{\makecvtitlepicturewidth}\settowidth{\makecvtitlepicturewidth}{\usebox{\makecvtitlepicturebox}}%
  % name and title
  \setlength{\makecvtitlenamewidth}{\textwidth-\makecvtitlepicturewidth}%
  \begin{minipage}[b]{\makecvtitlenamewidth}%
    \namestyle{\@firstname}\\%
    \namestyle{\@familyname}\\[1em]%
    \addressfont\color{color2}%
    \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\@addressstreet%
      \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}}%
    \ifthenelse{\isundefined{\@mobile}}{}{\makenewline\mobilesymbol\@mobile}%
    \ifthenelse{\isundefined{\@phone}}{}{\makenewline\phonesymbol\@phone}%
    \ifthenelse{\isundefined{\@fax}}{}{\makenewline\faxsymbol\@fax}%
    \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
    \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%
    \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}%
  \end{minipage}%
  \hfill%
  % optional picture box
  \usebox{\makecvtitlepicturebox}\\[2.5em]%
  % optional quote
  \ifthenelse{\isundefined{\@quote}}%
    {}%
    {{\centering\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}}%
  \par}%

Give the above definition is using "@" variables, you will need to enclose it between \makeatletter and \makeatother, i.e.
  \makeatletter
  \renewcommand{\makecvtitle}{...}
  \makeatother

Let me know if this works as intended.

Kind regards,

Madelen Mueller (mohnmaedchen) said : #2

Thank you very much! That was exactly what I needed to solve my problem(s).

I just added a \raggedleft:

 \begin{minipage}[b]{\makecvtitlenamewidth}%
   \raggedleft% --> here
   \namestyle{\@firstname}\\%

so it would be aligned to the picture.

Best regards,
Madelen.

Madelen Mueller (mohnmaedchen) said : #3

Thanks Xavier Danaux, that solved my question.

Xavier Danaux (xdanaux) said : #4

Great! I indeed forgot the \raggedleft as you noticed :)