1

I have trouble arranging the position of the name and email section. I want to move the email section under my name, then move the name + email to the same height as the photo (to the dash line in the attached image) but I couldn't find the way to do it.

The arrangement I want is in this image: enter image description here

MWE:

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

\moderncvstyle{classic} 
\moderncvcolor{blue}

\usepackage{lipsum} 
\usepackage[scale=0.8, top=1.5cm, bottom=1cm]{geometry}
\setlength{\hintscolumnwidth}{3cm} 

%----------------------------------------------------------------------------------------
%   NAME AND CONTACT INFORMATION SECTION
%----------------------------------------------------------------------------------------

\firstname{First name} % Your first name
\familyname{Last name} % Your last name


\title{}
\email{xxx@gmail.com}
\photo[100pt][0pt]{Head.jpg} 
%----------------------------------------------------------------------------------------


\begin{document}
\makecvtitle % Print the CV title
\vspace*{-0.5cm}

%----------------------------------------------------------------------------------------
%   EDUCATION SECTION
%----------------------------------------------------------------------------------------

\section{Education}

\cventry{2017--2019}{M.S. in Physics}{}{}{}{}

\cventry{2013--2017}{B.S. in Physics}{}{}{}{}
1
  • 1
    Welcome to TeX.SX! ModernCV is not that customisable. Use the style it is or dig into the code and examples and make a copy of the classic style and rewrite the section placement... – DG' Nov 11 '19 at 8:23
1

There are several steps needed to get what you want:

  1. Choose style banking for the head
  2. Delete centering for the name and email-address
  3. Change the used textwidth for Name and email-address
  4. Use package eso-pic to insert the needed image
  5. Use body for style classic for your document

Please see that you have to play with the used values, they depend on the image you are using ...

Now let us see the steps one by one:

  1. Style banking:

    \moderncvstyle[left,norules]{banking}
    
  2. Delete centering:

    \patchcmd{\makehead}
      {%
        \centering%
      }%%search
      {%
         % <================================================================
      }%%replace
      {}%%success
      {fehler}%%failure
    
  3. Change textwidth:

    \patchcmd{\makehead}
      {%
        \setlength{\makeheaddetailswidth}{0.8\textwidth}%
      }%%search
      {%
        \setlength{\makeheaddetailswidth}{0.9\textwidth}% <=================
      }%%replace
      {}%%success
      {fehlerb}%%failure
    
  4. Use package eso-pic:

    \usepackage{eso-pic} % <================================================
    \newcommand\AtPageUpperMyleft[1]{\AtPageUpperLeft{%
     \put(\LenToUnit{15.5cm},\LenToUnit{-3.5cm}){#1}% <===================== x-axis, y-axis
     }}%
    
    \AddToShipoutPictureBG*{%
    \AtPageUpperMyleft{\fboxsep1.5pt\fcolorbox{white}{white}%
      {\includegraphics[width=80pt,height=3cm,keepaspectratio]{example-image}}% <====================
     }%
    }
    
  5. Use body for style classic:

    \moderncvbody{1}
    
  6. Please see that you have to play with the used values, they depend on the image you are using ...

Please see the following complete MWE (important codes marked with <=====):

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

\moderncvstyle[left,norules]{banking} %<================================ classic casual
\moderncvcolor{blue}

\usepackage{lipsum} 
\usepackage[scale=0.8, top=1.5cm, bottom=1cm]{geometry}
\setlength{\hintscolumnwidth}{3cm} 

\patchcmd{\makehead}
  {%
    \centering%
  }%%search
  {%
     % <================================================================
  }%%replace
  {}%%success
  {fehler}%%failure

\patchcmd{\makehead}
  {%
    \setlength{\makeheaddetailswidth}{0.8\textwidth}%
  }%%search
  {%
    \setlength{\makeheaddetailswidth}{0.9\textwidth}% <=================
  }%%replace
  {}%%success
  {fehlerb}%%failure

\usepackage{eso-pic} % <================================================
\newcommand\AtPageUpperMyleft[1]{\AtPageUpperLeft{%
 \put(\LenToUnit{15.5cm},\LenToUnit{-3.5cm}){#1}% <===================== x-axis, y-axis
 }}%

\AddToShipoutPictureBG*{%
\AtPageUpperMyleft{\fboxsep1.5pt\fcolorbox{white}{white}%
  {\includegraphics[width=80pt,height=3cm,keepaspectratio]{example-image}}% <====================
 }%
}

\name{First name}{Last name} % Your first name Your last name

\title{}
\email{xxx@gmail.com}
%\photo[100pt][0pt]{example-image} 

\moderncvbody{1} % <==================================================== classic body


\begin{document}

\makecvtitle % Print the CV title
\vspace*{-0.5cm} % <==================================================== better not??

\section{Education}

\cventry{2017--2019}{M.S. in Physics}{Test}{TestTest}{Test}{Test Test Test Test Test Test}

\cventry{2013--2017}{B.S. in Physics}{}{}{}{}

\end{document}

and its resulting pdf:

resulting pdf

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.