![moderncv 中的深蓝色条](https://linux22.com/image/413552/moderncv%20%E4%B8%AD%E7%9A%84%E6%B7%B1%E8%93%9D%E8%89%B2%E6%9D%A1.png)
对于我的简历,我使用以下模板:现代简历
模板包含一个命令,可以设置条形的颜色
\moderncvcolor{black} % CV color - options include: 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black'
对于我的应用程序,我想使用深蓝色,如下图所示
你们中有人知道该怎么做吗?
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{classic}
\moderncvcolor{blue}
\usepackage{lipsum}
\usepackage[scale=0.75]{geometry}
\begin{document}
\section{Education}
\cventry{2011--2012}{Masters of Commerce}{The University of California}{Berkeley}{\textit{GPA -- 8.0}}{First Class Honours}
\end{document}
答案1
您需要为规则专门定义一种新颜色,然后重新定义命令\section
。操作方法如下:
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{classic}
\moderncvcolor{blue}
\definecolor{color4}{RGB}{5,40,135}% dark blue
\makeatletter
\@initializelength{\baseletterheight}
\settoheight{\baseletterheight}{\sectionstyle{o}}
\setlength{\baseletterheight}{\baseletterheight-0.95ex}
\RenewDocumentCommand{\section}{sm}{%
\par\addvspace{2.5ex}%
\phantomsection{}% reset the anchor for hyperrefs
\addcontentsline{toc}{section}{#2}%
\cvitem[0ex]{\strut\raggedleft\raisebox{\baseletterheight}{\color{color4}\rule{\hintscolumnwidth}{0.95ex}}}{\strut\sectionstyle{#2}}%
\par\nobreak\addvspace{1ex}\@afterheading}%
\makeatother
\usepackage{lipsum}
\usepackage[scale=0.75]{geometry}
\firstname{John}
\familyname{Doe}
\begin{document}
\section{Education}
\cventry{2011--2012}{Masters of Commerce}{The University of California}{Berkeley}{\textit{GPA -- 8.0}}{First Class Honours}
\end{document}