更改简历类别中各部分的颜色

更改简历类别中各部分的颜色

我想将顶部名称和标题的颜色更改rSection为“浅灰色”。我该怎么做?

%----------------------------------------------------------------------------------------
%   PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------

\documentclass[10pt,a4paper]{resume} % Use the custom resume.cls style

%------------------------------------------------------------------------------------------------------
% USED PACKAGES
%------------------------------------------------------------------------------------------------------

\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage{lipsum,textcomp}
\usepackage[scale=0.75]{geometry}
\usepackage[dvipsnames]{xcolor}


\name{firstName Name}% Your name
\address{Adress \\ City, country} % Your address
\address{(+49)~$\cdot$~(0)1111~$\cdot$~11111111 \\ [email protected]} % Your phone number and email

\begin{document}

%----------------------------------------------------------------------------------------
%   PERSONAL DATA
%----------------------------------------------------------------------------------------

\begin{rSection}{Personal Data}

{\bf Born in City, Country.} \hfill {\em Date, year}

\end{rSection}

\end{document}

答案1

  1. 一个简单的方法就是重新定义环境rSection

    \renewenvironment{rSection}[1]{
    \sectionskip
    \textcolor{lightgray}{\MakeUppercase{#1}}
    \sectionlineskip
    \hrule
    \begin{list}{}{
    \setlength{\leftmargin}{1.5em}
    }
    \item[]
    }{
    \end{list}
    }
    

    得出的结果是:

    在此处输入图片描述

  2. 上述方法的一个缺点是,如果文件resume.cls对环境进行了更改,rSection您将看不到它们。另一种方法是\MakeUppercase在我们之内环境rSection

    \let\OrigRSection\rSection
    \let\OrigEndRSection\endrSection
    \let\OrigMakeUppercase\MakeUppercase
    
    \renewenvironment{rSection}[1]{
        \renewcommand{\MakeUppercase}[1]{\textcolor{lightgray}{\OrigMakeUppercase{##1}}}%
        \OrigRSection{#1}%
    }{%
        \OrigEndRSection%
    }
    

笔记:


代码:重新定义rSection环境

\documentclass[10pt,a4paper]{resume} % Use the custom resume.cls style

%------------------------------------------------------------------------------------------------------
% USED PACKAGES
%------------------------------------------------------------------------------------------------------

\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage{lipsum,textcomp}
\usepackage[scale=0.75]{geometry}
\usepackage[dvipsnames]{xcolor}

\renewenvironment{rSection}[1]{
\sectionskip
\textcolor{lightgray}{\MakeUppercase{#1}}
\sectionlineskip
\hrule
\begin{list}{}{
\setlength{\leftmargin}{1.5em}
}
\item[]
}{
\end{list}
}





\name{firstName Name}% Your name
\address{Address \\ City, country} % Your address
\address{(+49)~$\cdot$~(0)1111~$\cdot$~11111111 \\ [email protected]} % Your phone number and email


\begin{document}

%----------------------------------------------------------------------------------------
%   PERSONAL DATA
%----------------------------------------------------------------------------------------

\begin{rSection}{Personal Data}

{\bfseries Born in City, Country.} \hfill {\emph{Date, year}}

\end{rSection}

\end{document}

代码:重新定义\MakeUppercase 之内 rSection

\documentclass[10pt,a4paper]{resume} % Use the custom resume.cls style

%------------------------------------------------------------------------------------------------------
% USED PACKAGES
%------------------------------------------------------------------------------------------------------

\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage{lipsum,textcomp}
\usepackage[scale=0.75]{geometry}
\usepackage[dvipsnames]{xcolor}

\let\OrigRSection\rSection
\let\OrigEndRSection\endrSection
\let\OrigMakeUppercase\MakeUppercase

\renewenvironment{rSection}[1]{
    \renewcommand{\MakeUppercase}[1]{\textcolor{lightgray}{\OrigMakeUppercase{##1}}}%
    \OrigRSection{#1}%
}{%
    \OrigEndRSection%
}



\name{firstName Name}% Your name
\address{Address \\ City, country} % Your address
\address{(+49)~$\cdot$~(0)1111~$\cdot$~11111111 \\ [email protected]} % Your phone number and email


\begin{document}

%----------------------------------------------------------------------------------------
%   PERSONAL DATA
%----------------------------------------------------------------------------------------

\begin{rSection}{Personal Data}

{\bfseries Born in City, Country.} \hfill {\emph{Date, year}}

\end{rSection}

\end{document}

相关内容