\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{banking}
\moderncvcolor{purple}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.915]{geometry}
\usepackage{import}
\name{Name}{}
\phone[mobile]{ph}
\email{[email protected]}
\homepage{www.linkedin.com/in/profile}
\begin{document}
\maketitle
\section{Education}
\vspace{0pt}
\item{\cventry{Expected Graduation: June 2022}{Bachelors in engineering}{Name of the university}{location}{\textit{}}{}}
\vspace{1pt}
\end{document}
答案1
您需要修补\makehead
文件中的命令moderncvheadiii.sty
。最后它包含代码
\flushmakeheaddetails}\fi}\\[2.5em]}
并\\[2.5em]
负责处理你不喜欢的空白。在序言中使用以下补丁
\usepackage{etoolbox} % <===============================================
\patchcmd{\makehead}{\\[2.5em]}{\\[0em]}{}{} % <========================
0em
根据您的需要更改值...
请参阅以下完整的 MWE:
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{banking}
\moderncvcolor{purple}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.915]{geometry}
\usepackage{import}
\usepackage{etoolbox} % <===============================================
\patchcmd{\makehead}{\\[2.5em]}{\\[0em]}{}{} % <========================
\name{Name}{}
\phone[mobile]{ph}
\email{[email protected]}
\homepage{www.linkedin.com/in/profile}
\begin{document}
\maketitle
\section{Education}
\vspace{0pt}
\begin{itemize} % <=====================================================
\item \cventry{Expected Graduation: June 2022}{Bachelors in engineering}{Name of the university}{location}{\textit{}}{}
\end{itemize} % <=======================================================
\vspace{1pt}
\end{document}
您在代码中使用了 而\item
没有使用\begin{itemize}
and 。这给出了一条错误消息,我通过在 MWE 中添加and进行了更正。请注意,该命令不带参数!\end{itemize}
\begin{itemize}
\end{itemize}
\item
现在您有一个超出规则的段落,如您在以下屏幕截图中看到的那样:
在我回答问题时moderncv 扩展 hrule您可以找到代码来纠正这个错误。