我想写出有moderncv-Classic
风格的简历。你能告诉我如何删除每个部分左侧的水平线吗?
答案1
干得好:
\RenewDocumentCommand{\section}{sm}{%
\strut\sectionstyle{#2\hfill}%
\par\nobreak\addvspace{1ex}\@afterheading
}
上面的代码是所需的核心。现在是 MWE 的时间了:
数学家协会
\documentclass[12pt,letterpaper]{moderncv}
\moderncvstyle{classic}
\moderncvcolor{blue}
\usepackage{libertine}
\usepackage[left=1cm,right=1cm,top=1cm,bottom=1cm]{geometry}
\usepackage{kantlipsum}
\makeatletter
\RenewDocumentCommand{\section}{sm}{%
\strut\sectionstyle{#2\hfill}%
\par\nobreak\addvspace{1ex}\@afterheading
}
\RenewDocumentCommand{\subsection}{sm}{
\strut\subsectionstyle{#2}{\color{color1}{\subsectionfill}}%
\par\nobreak\addvspace{0.5ex}\@afterheading}
%
\makeatother
\name{SUBHAM}{SONI}
\address{ABC}{XYZ}{PQR}
\phone[mobile]{1234567}
\begin{document}
\makecvtitle
\section{CAREER OBJECTIVE}
\kant[1]
\end{document}
答案2
这在很大程度上取决于您使用的样式(以及的版本moderncv
),这就是 MWE 良好的原因。
假设你正在使用最新版本的 moderncv 和classic
或casual
主题,你可以
\makeatletter
\RenewDocumentCommand{\section}{sm}{%
\par\addvspace{2.5ex}%
\phantomsection{}% reset the anchor for hyperrefs
\addcontentsline{toc}{section}{#2}%
\parbox[t]{\hintscolumnwidth}{\strut\raggedleft\raisebox{\baseletterheight}{\rule{\hintscolumnwidth}{0ex}}}%
\hspace{\separatorcolumnwidth}%
\parbox[t]{\maincolumnwidth}{\strut\sectionstyle{#2}}%
\par\nobreak\addvspace{1ex}\@afterheading}% to avoid a pagebreak after the heading
\makeatother
在你的序言中(之前\begin{document}
),得到一个不可见的栏目或
\makeatletter
\RenewDocumentCommand{\section}{sm}{%
\par\addvspace{2.5ex}%
\phantomsection{}% reset the anchor for hyperrefs
\addcontentsline{toc}{section}{#2}%
{\strut\sectionstyle{#2}}%
\par\nobreak\addvspace{1ex}\@afterheading}% to avoid a pagebreak after the heading
\makeatother
以彻底移除该杆。