在 moderncv classic 中移动图片

在 moderncv classic 中移动图片

嘿,我一直在用 moderncv 经典风格写简历。它看起来已经很漂亮了,但我仍然想把图片往下移。目前,图片的底部与简历的线对齐(见图中的水平线)。在此处输入图片描述

我想要做的是对齐图片,使图片的中间线大致与姓名“John Doe”在同一条线上。另一方面,标题和图片顶部之间的距离以及单词“简历”和“个人资料”(a)之间的距离应该相同。

我对上图使用的 MWE 如下:

\documentclass[12pt,a4paper,sanserif]{moderncv} 

\usepackage[latin1]{inputenc}
\usepackage{graphicx}
\usepackage[ngerman]{babel}
\usepackage{marvosym}
\usepackage{fancyhdr}
\pagestyle{fancy}

% HEADER
\chead{John Doe | Doestreet 10 | 12345 Doetown | \Mobilefone\hspace{0,2cm}+1234567 \\ \Letter \hspace{0,1cm} [email protected] | \ComputerMouse \hspace{0,1cm} [EnterFancyLinkHere]\\
\hline}

 \moderncvstyle{classic} % CV theme - options include: 'casual' (default), 'classic', 'oldstyle' and 'banking'
\moderncvcolor{black} % CV color - options include: 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black'

\usepackage[scale=0.8]{geometry} % Reduce document margins

\AtBeginDocument{\recomputelengths}
\AtBeginDocument{\definecolor{sectionrectanglecolor}{rgb}{0,0,0}}
\AtBeginDocument{\definecolor{sectiontitlecolor}{rgb}{1,0,0}}

\firstname{\Huge John} % Your first name
\familyname{Doe} % Your last name
\title{Curriculum Vitae}

\photo[150pt][0pt]{pictures/John_Doe_Picture.png} % The first bracket is the picture height, the second is the thickness of the frame around the picture (0pt for no frame)

%----------------------------------------------------------------------------------------
\let\sffamily\rmfamily

\begin{document}
\makecvtitle % Print the CV title
\section{Personal Data}
\cvitem{Date of Birth}{01.01.2000}
\cvitem{Place of Birth}{Doetown}

\end{document}

如果目标或问题不明确,请随时告诉我们 :)。非常感谢您的帮助。

最好的祝愿,

塞巴斯蒂安

答案1

您可以使用 修补\makecvhead命令 \raisebox。注意,我不得不更改一些图标命令,因为加载marvosym 与类冲突。解决此冲突的方法是声明图标的来源marvosym并使用 中的名称moderncviconsmarvosym.sty。此外,简历中使用无衬线字体的选项是sans,而不是 sanserif。

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

\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage[ngerman]{babel}
\moderncvicons{marvosym}
\usepackage{fancyhdr}
\pagestyle{fancy}

% HEADER
\chead{John Doe | Doestreet 10 | 12345 Doetown | \mobilephonesymbol\hspace{0,2cm}+1234567 \\ \addresssymbol \hspace{0,1cm} [email protected] | \homepagesymbol \hspace{0,1cm} [EnterFancyLinkHere]\\
\hrule}

\moderncvstyle{classic} % CV theme - options include: 'casual' (default), 'classic', 'oldstyle' and 'banking'
\moderncvcolor{black} % CV color - options include: 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black'

\usepackage[scale=0.8]{geometry} % Reduce document margins

\AtBeginDocument{\recomputelengths}
\AtBeginDocument{\definecolor{sectionrectanglecolor}{rgb}{0,0,0}}
\AtBeginDocument{\definecolor{sectiontitlecolor}{rgb}{1,0,0}}

\firstname{\Huge John} % Your first name
\familyname{Doe} % Your last name
\title{Curriculum Vitae}

\photo[150pt][0pt]{wolf1} % The first bracket is the picture height, the second is the thickness of the frame around the picture (0pt for no frame)

%----------------------------------------------------------------------------------------

\usepackage{xpatch}
\xpatchcmd{\makecvhead}{%
\usebox{\makecvheadpicturebox}\fi%
}{%
\raisebox{-0.3\height}{\usebox{\makecvheadpicturebox}}\fi%
}{}{}

 \begin{document}

\makecvtitle % Print the CV title
\section{Personal Data}
\cvitem{Date of Birth}{01.01.2000}
\cvitem{Place of Birth}{Doetown}

\end{document} 

在此处输入图片描述

相关内容