Curricula Vitae / Résuméshow to color the name of section?

ModernCV, Friggeri, Plasmati, Classicthesis-CV, and more
Post Reply
fritteille
Posts: 2
Joined: Sun Sep 06, 2015 6:57 am

how to color the name of section?

Post by fritteille »

Hi there!
The template "medium-length-professional" is super, I was looking exactly for that.
I was just wondering: Is it possible to color the name for each section? I tried various things but nothing worked.
Thank you very much.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

how to color the name of section?

Post by Johannes_B »

Place the following right before \begin{document}.

Code: Select all

\usepackage{xcolor}
\colorlet{sectioncolor}{blue!70!black}
\renewenvironment{rSection}[1]{ % 1 input argument - section name
  \sectionskip
  \begingroup
  \color{sectioncolor}
  \MakeUppercase{\bfseries#1} % Section title
  \endgroup
  \sectionlineskip
  \hrule % Horizontal line
  \begin{list}{}{ % List for each individual item in the section
    \setlength{\leftmargin}{1.5em} % Margin within the section
  }
  \item[]
}{
  \end{list}
}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
fritteille
Posts: 2
Joined: Sun Sep 06, 2015 6:57 am

Re: how to color the name of section?

Post by fritteille »

Thank you so much!!! It's exactly what I was looking for.

I was considering know if it was possibile to color also the line under the title..
If not, no worries, It's perfect anyway!
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

how to color the name of section?

Post by Johannes_B »

Just move the \endgroup below the \hrule.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
DonQuijotedelaMancha
Posts: 2
Joined: Sat Feb 01, 2025 2:24 pm

Re: how to color the name of section?

Post by DonQuijotedelaMancha »

Hi all,
I just tried this and it crashes the formatting. Any other ideas how to color the name, titles, (optional: lines) and in addition change the main color?
Thanks! DQ
DonQuijotedelaMancha
Posts: 2
Joined: Sat Feb 01, 2025 2:24 pm

Re: how to color the name of section?

Post by DonQuijotedelaMancha »

I tried to use the package xcolor and there seems to be a conflict between xcolor and makeuppercase.
https://tex.stackexchange.com/questions ... kagexcolor

Also \bf seems to be outdated.
https://tex.stackexchange.com/questions ... euppercase

If I use the package \usepackage{xcolor}
and replace "\MakeUppercase{\textbf{#1}} % Section title"
by "\textcolor{blue}{\normalfont\bfseries\MakeUppercase{#1}}% Section title"
it works for me.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10281
Joined: Mon Mar 10, 2008 9:44 pm

Re: how to color the name of section?

Post by Stefan Kottwitz »

Yes, \bf is deprecated and should be replaced by \bfseries. However, also \textbf is fine. This should also work:

\textcolor{blue}{\normalfont\textbf{\MakeUppercase{#1}}}% Section title

It's good to know that everything works for you now!

Stefan
LaTeX.org admin
Post Reply