1

I would like to move the image of my CV with moderncv such that the upper edge of the image is at the same height like the upper part of my name:

current cv

Is this possible? And also in such a way that the text below will not move accordingly?

Used mwe.tex

\documentclass[11pt,a4paper,sans]{moderncv}

\usepackage[utf8]{inputenc}
\usepackage[scale=0.75,showframe]{geometry} % <=========================
\moderncvtheme[blue]{classic} % possible themes are "classic" and "casual"

\firstname{Name}
\familyname{Surname}
\title{Curriculum Vitae}
\address{street}{zip city\protect\\[0.1em] country\protect\\[0.2em]}
\mobile{+cell-phone}
\email{name@provider}
\photo[90pt]{example-image-10x16}
\quote{}

\setlength{\hintscolumnwidth}{3.6cm} 


\begin{document}

\makecvtitle

\section{Education}
\cventry{year--year}{Degree}{Institution--3}{City--4}{\textit{Grade}--5}{Description--6}  % arguments 3 to 6 can be left empty
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}

\section{Master thesis}
\cvitem{title}{\emph{Title}}
\cvitem{supervisors}{Supervisors}
\cvitem{description}{Short thesis abstract}

\section{Experience}
\subsection{Vocational}
\cventry{year--year}{Job title}{Employer}{City}{}{General description 
  no longer than 1--2 lines.\newline{}%
Detailed achievements:%
\begin{itemize}%
\item Achievement 1;
\item Achievement 2, with sub-achievements:
  \begin{itemize}%
  \item Sub-achievement (a);
  \item Sub-achievement (b), with sub-sub-achievements (don't do this!);
    \begin{itemize}
    \item Sub-sub-achievement i;
    \item Sub-sub-achievement ii;
    \item Sub-sub-achievement iii;
    \end{itemize}
  \item Sub-achievement (c);
  \end{itemize}
\item Achievement 3.
\end{itemize}}
\cventry{year--year}{Job title}{Employer}{City}{}{Description 
  line 1\newline{}Description line 2}

\end{document} 

log data:

This is LuaTeX, Version beta-0.80.0 (TeX Live 2015/Debian) (rev 5238)  (format=lualatex 2018.10.13)  2 FEB 2019 20:46
 restricted \write18 enabled.
LaTeX2e <2016/02/01>
Babel <3.9q> and hyphenation patterns for 1 language(s) loaded.
(/usr/share/texlive/texmf-dist/tex/latex/moderncv/moderncv.cls
Document Class: moderncv 2015/07/28 v2.0.0 modern curriculum vitae and letter do
1

New answer:

You can patch the class code with the following code:

\makeatletter
% to patch the code of moderncv, version 2.0.0
%\usepackage{etoolbox} % already loaded in moderncv <===================
\patchcmd{\makecvhead}%
  {\ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\titlestyle{\@title}}}% code to patch
  {\ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\titlestyle{\@title}}%
   \vspace{3.4cm}%
  }% new code <=========================================================
  {}% success
  {\fail}% failure
\makeatother

Change the value of 3.4cm in command \vspace{3.4cm} for your needs.

With the complete code

\documentclass[11pt,a4paper,sans]{moderncv}

\usepackage[utf8]{inputenc}

\usepackage[scale=0.75,showframe]{geometry} % <=========================

\moderncvtheme[blue]{classic} % possible themes are "classic" and "casual"

\makeatletter
% to patch the code of moderncv, version 2.0.0
%\usepackage{etoolbox} % already loaded in moderncv <===================
\patchcmd{\makecvhead}%
  {\ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\titlestyle{\@title}}}% code to patch
  {\ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\titlestyle{\@title}}%
   \vspace{3.4cm}%
  }% new code <=========================================================
  {}% success
  {\fail}% failure
\makeatother

\firstname{Name}
\familyname{Surname}
\title{Curriculum Vitae}
\address{street}{zip city\protect\\[0.1em] country\protect\\[0.2em]}
\mobile{+cell-phone}
\email{name@provider}
\photo[90pt]{example-image-10x16}
\quote{}

\setlength{\hintscolumnwidth}{3.6cm} 


\begin{document}

\makecvtitle

\section{Education}
\cventry{year--year}{Degree}{Institution--3}{City--4}{\textit{Grade}--5}{Description--6}  % arguments 3 to 6 can be left empty
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}

\section{Master thesis}
\cvitem{title}{\emph{Title}}
\cvitem{supervisors}{Supervisors}
\cvitem{description}{Short thesis abstract}

\section{Experience}
\subsection{Vocational}
\cventry{year--year}{Job title}{Employer}{City}{}{General description 
  no longer than 1--2 lines.\newline{}%
Detailed achievements:%
\begin{itemize}%
\item Achievement 1;
\item Achievement 2, with sub-achievements:
  \begin{itemize}%
  \item Sub-achievement (a);
  \item Sub-achievement (b), with sub-sub-achievements (don't do this!);
    \begin{itemize}
    \item Sub-sub-achievement i;
    \item Sub-sub-achievement ii;
    \item Sub-sub-achievement iii;
    \end{itemize}
  \item Sub-achievement (c);
  \end{itemize}
\item Achievement 3.
\end{itemize}}
\cventry{year--year}{Job title}{Employer}{City}{}{Description 
  line 1\newline{}Description line 2}

\end{document}

you get the wished result:

wished result

Old answer:

Well it seems you are using the moderncv style oldstyle. There are several styles available with moderncv causing different header, bodys and footer.

So in your case it is important to know the used style (that is the reason I asked already in your last question for an MWE, an compilable code we can copy and test on our computers ...)

You need to patch the building of your header like that:

\makeatletter
% to patch the code of moderncv, version 2.0.0
%\usepackage{etoolbox} % already loaded in moderncv <===================
\patchcmd{\makecvhead}%
  {\usebox{\makecvheadpicturebox}\\[2.5em]}% code to patch
  {\begin{minipage}[t]{\makecvheadpicturewidth}%
    \ifthenelse{\isundefined{\@photo}}%
    {}%
    {%
      \vspace{-1.8cm}%
      \color{color1}%
      \setlength\fboxrule{\@photoframewidth}%
      \ifdim\@photoframewidth=0pt%
        \setlength{\fboxsep}{0pt}\fi%
      \framebox{\includegraphics[width=\@photowidth]{\@photo}}%
    }%
   \end{minipage}\\[2.5em]%
  }% new code <======================================
  {}% success
  {\fail}% failure
\makeatother 

Please see that my used \vspace{-1.8cm}% depends on your used image, change the value -1.8cm for your needs ... Please see that I used option showframe for geometry to visualize the typing area and margins ...

With the complete code

\documentclass[11pt,a4paper,sans]{moderncv}

% moderncv themes
\moderncvstyle{oldstyle} 
\moderncvcolor{blue} 

\usepackage[utf8]{inputenc}

\usepackage[scale=0.75,showframe]{geometry} % <=========================

\makeatletter
% to patch the code of moderncv, version 2.0.0
%\usepackage{etoolbox} % already loaded in moderncv <===================
\patchcmd{\makecvhead}%
  {\usebox{\makecvheadpicturebox}\\[2.5em]}% code to patch
  {\begin{minipage}[t]{\makecvheadpicturewidth}%
    \ifthenelse{\isundefined{\@photo}}%
    {}%
    {%
      \vspace{-1.8cm}%
      \color{color1}%
      \setlength\fboxrule{\@photoframewidth}%
      \ifdim\@photoframewidth=0pt%
        \setlength{\fboxsep}{0pt}\fi%
      \framebox{\includegraphics[width=\@photowidth]{\@photo}}%
    }%
   \end{minipage}\\[2.5em]%
  }% new code <======================================
  {}% success
  {\fail}% failure
\makeatother


% personal data
\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]{example-image-10x16}
\quote{Some quote}


\begin{document}

\makecvtitle

\section{Education}
\cventry{year--year}{Degree}{Institution--3}{City--4}{\textit{Grade}--5}{Description--6}  % arguments 3 to 6 can be left empty
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}

\section{Master thesis}
\cvitem{title}{\emph{Title}}
\cvitem{supervisors}{Supervisors}
\cvitem{description}{Short thesis abstract}

\section{Experience}
\subsection{Vocational}
\cventry{year--year}{Job title}{Employer}{City}{}{General description 
  no longer than 1--2 lines.\newline{}%
Detailed achievements:%
\begin{itemize}%
\item Achievement 1;
\item Achievement 2, with sub-achievements:
  \begin{itemize}%
  \item Sub-achievement (a);
  \item Sub-achievement (b), with sub-sub-achievements (don't do this!);
    \begin{itemize}
    \item Sub-sub-achievement i;
    \item Sub-sub-achievement ii;
    \item Sub-sub-achievement iii;
    \end{itemize}
  \item Sub-achievement (c);
  \end{itemize}
\item Achievement 3.
\end{itemize}}
\cventry{year--year}{Job title}{Employer}{City}{}{Description 
  line 1\newline{}Description line 2}
\subsection{Miscellaneous}
\cventry{year--year}{Job title}{Employer}{City}{}{Description}

\section{Languages}
\cvitemwithcomment{Language 1}{Skill level}{Comment}
\cvitemwithcomment{\textbf{Language} 2}{\textbf{Skill} level}{Comment}
\cvitemwithcomment{Language 3}{Skill level}{Comment}


\section{Computer skills}
\cvdoubleitem{category 1}{XXX, YYY, ZZZ}{category 4}{XXX, YYY, ZZZ}
\cvdoubleitem{category 2}{XXX, YYY, ZZZ}{category 5}{XXX, YYY, ZZZ}
\cvdoubleitem{category 3}{XXX, YYY, ZZZ}{category 6}{XXX, YYY, ZZZ}

\section{Interests}
\cvitem{hobby 1}{Description}
\cvitem{hobby 2}{Description}
\cvitem{hobby 3}{Description}

\section{Extra 1}
\cvlistitem{Item 1}
\cvlistitem{Item 2}
\cvlistitem{Item 3. This item is particularly long and therefore 
  normally spans over several lines. Did you notice the indentation 
  when the line wraps?}

\section{Extra 2}
\cvlistdoubleitem{Item 1}{Item 4}
\cvlistdoubleitem{Item 2}{Item 5}
\cvlistdoubleitem{Item 3}{Item 6. Like item 3 in the single column list before, this item is particularly long to wrap over several lines.}

\section{References}
\begin{cvcolumns}
  \cvcolumn{Category 1}{\begin{itemize}\item Person 1\item Person 2\item Person 3\end{itemize}}
  \cvcolumn{Category 2}{Amongst others:\begin{itemize}\item Person 1, and\item Person 2\end{itemize}(more upon request)}
  \cvcolumn[0.5]{All the rest \& some more}{\textit{That} person, and \textbf{those} also (all available upon request).}
\end{cvcolumns}

\end{document}

you get the following result:

enter image description here

  • At first, thank you very much! I set up everything via " \moderncvtheme[blue]{classic} " but it does not work with your code. When I use " \moderncvstyle{oldstyle} \moderncvcolor{blue} " it works, but this changes almost everything I set up. Do you know how I can use both together? – Ben Feb 2 at 19:09
  • Thanks again! I didn't realize that I did not add the preamble. Sorry. I added it now. – Ben Feb 2 at 19:46
  • Thanks for the response! To be honest, I wasn't aware that the actual looking is that important. I just took an example and sketched my concern. I'm very sorry for the circumstances! I'll edit the image. – Ben Feb 9 at 12:03
  • Hi, thank you very much! Is it also possible to move the image only? At the moment the image moves and the information next to it (cell phone and so on). Additionally, is it also possible that the entire content below will not move? – Ben Feb 10 at 11:18
  • The image moves as desired. That's correct. It's just not only the image that moves - also the details left besides (address, phone number and so on). I would try to write something on my own but it seems there is no documentary available? I already wondered how you know what to do.. :D – Ben Feb 10 at 19:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.