[Tex/LaTex] Change color of sections in resume class

colorcvresumesectioning

I would like to change the color of the name on top and the titles of the rSection in "light gray". How can I do that?

%----------------------------------------------------------------------------------------
%   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 \\ name@name.com} % 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}

Best Answer

  1. A simple way would be to just redefine the rSection environment:

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

    which yields:

    enter image description here

  2. One downside of the above is that if the resume.cls file makes changes to the rSection environment you will not see them. An alternative is to redefine the \MakeUppercase macro when we are within the rSection environment.

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

Notes:


Code: Redefine rSection environment

\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 \\ name@name.com} % 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}

Code: Redefine \MakeUppercase within 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 \\ name@name.com} % 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}
Related Question