![删除 moderncv 中 header 下方的空格](https://linux22.com/image/347677/%E5%88%A0%E9%99%A4%20moderncv%20%E4%B8%AD%20header%20%E4%B8%8B%E6%96%B9%E7%9A%84%E7%A9%BA%E6%A0%BC.png)
我正在准备简历,需要更多空间来完成。我想删除标题下方的空间(红色),并减少章节和段落之间的空间
我的代码:
\documentclass[11pt,a4paper]{moderncv}
\usepackage[francais]{babel}
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage[scale=0.95]{geometry}
\moderncvtheme[blue]{classic}
\firstname {Name}
\lastname {LastName}
\title {Job}
\address{Adress}{Adress}
\mobile {123456}
%\phone {number}
\email {[email protected]}
\social[linkedin][link]{name}
%\homepage {link}
%\extrainfo {}
\photo[70pt][0.6pt]{maphoto}
\quote {}
\begin{document}
\makecvtitle
\vspace*{-20mm}
\section{Formation}
\cventry{2015--2017}{Text}{}{}{}{Text.}
\cventry{2012--2015}{Text}{}{}{}{Text}
\cventry{2008--2012}{Text}{}{}{}{Text}
\section{Expériences professionnelles}
\cventry{Juin 2016}{Text}{}{}{}{Text}
\section{Projets académiques}
\cventry{Jan 2016 - Mai 2016}{Text}{}{}{}{Text}
\end{document}
答案1
这是一种从标题中删除更多空间的方法。添加以下几行:
\usepackage{xpatch}
\xpatchcmd\makecvhead{1.25em}{0em}{}{}% <<<<< 0em = space between name and title
\xpatchcmd\makecvhead{[b]}{[t]}{}{}
\xpatchcmd\makecvhead{[b]}{[t]}{}{}
\xpatchcmd\makecvhead{[b]}{[t]}{}{}
\makeatletter
\xpatchcmd\makecvhead
{\includegraphics[width=\@photowidth]{\@photo}}%
{\raisebox{-1.6cm}{\includegraphics[width=\@photowidth]{\@photo}}}% <<<<< -1.6cm: modify to align the image with the rest
{}{}
\makeatother
\begin{document}
\makecvtitle
\vspace*{-40mm}% <<<< modify to adjust the distance between title and contents
根据需要调整上面标记的三个数字。请注意,这实际上是一种黑客行为,可能会在下一版中停止工作moderncv
。
\documentclass[11pt,a4paper]{moderncv}
\usepackage[francais]{babel}
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage[scale=0.95]{geometry}
\moderncvtheme[blue]{classic}
\firstname {Name}
\lastname {LastName}
\title {Job}
\address{Adress}{Adress}
\mobile {123456}
%\phone {number}
\email {[email protected]}
\social[linkedin][link]{name}
%\homepage {link}
%\extrainfo {}
\photo[70pt][0.6pt]{example-image}
\quote {}
\usepackage{xpatch}
\xpatchcmd\makecvhead{1.25em}{0em}{}{}
\xpatchcmd\makecvhead{[b]}{[t]}{}{}
\xpatchcmd\makecvhead{[b]}{[t]}{}{}
\xpatchcmd\makecvhead{[b]}{[t]}{}{}
\makeatletter
\xpatchcmd\makecvhead
{\includegraphics[width=\@photowidth]{\@photo}}%
{\raisebox{-1.6cm}{\includegraphics[width=\@photowidth]{\@photo}}}%
{}{}
\makeatother
\begin{document}
\makecvtitle
\vspace*{-40mm}
\section{Formation}
\cventry{2015--2017}{Text}{}{}{}{Text.}
\cventry{2012--2015}{Text}{}{}{}{Text}
\cventry{2008--2012}{Text}{}{}{}{Text}
\section{Expériences professionnelles}
\cventry{Juin 2016}{Text}{}{}{}{Text}
\section{Projets académiques}
\cventry{Jan 2016 - Mai 2016}{Text}{}{}{}{Text}
\end{document}