moderncv - 如何移动姓名和电子邮件的位置?

moderncv - 如何移动姓名和电子邮件的位置?

我无法安排姓名和电子邮件部分的位置。我想将电子邮件部分移到我的名字下面,然后将姓名 + 电子邮件移动到与照片相同的高度(到附图中的虚线处),但我找不到这样做的方法。

我想要的安排如下图所示: 在此处输入图片描述

梅威瑟:

\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{[email protected]}
\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. 选择适合头部的银行业务
  2. 删除centering姓名和电子邮件地址
  3. 更改姓名和电子邮件地址使用的文本宽度
  4. 使用包eso-pic插入所需图像
  5. 使用正文来设置classic文档的样式

请注意,您必须使用所使用的值,它们取决于您正在使用的图像......

现在让我们逐一看一下这些步骤:

  1. 风格banking

    \moderncvstyle[left,norules]{banking}
    
  2. 删除centering

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

    \patchcmd{\makehead}
      {%
        \setlength{\makeheaddetailswidth}{0.8\textwidth}%
      }%%search
      {%
        \setlength{\makeheaddetailswidth}{0.9\textwidth}% <=================
      }%%replace
      {}%%success
      {fehlerb}%%failure
    
  4. 使用包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. 使用主体样式classic

    \moderncvbody{1}
    
  6. 请注意,您必须使用所使用的值,它们取决于您正在使用的图像......

请参阅以下完整的 MWE(重要代码以 标记<=====):

\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{[email protected]}
%\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}

及其生成的pdf:

生成的 pdf

相关内容