First of all, great job with this template, I love it, thank you so much! However, I'd like to know if it's possible to have sections with different colors in the same page please? Like Education blue and Experience green? Thanks in advance
gcunhase
Curricula Vitae / Résumés ⇒ Each section a different color
NEW: TikZ book now 40% off at Amazon.com for a short time.

Each section a different color
Hi,
Sure, you can do this with the
Cheers,
Vel
Sure, you can do this with the
\color
command like this:Code: Select all
\section{\color{red}{Education}}
Vel
Founder and administrator of LaTeXTemplates.com and LaTeXTypesetting.com
-
- Posts: 679
- Joined: Tue Mar 03, 2015 4:01 pm
Re: Each section a different color
Thank you, but what about the bar to the left of the section name? It doesn't change color when I use this command. Thank you again 
gcunhase

gcunhase
Each section a different color
Hi,
This will be a bit trickier to change. The rule color is defined in this line in
You'll notice it's hard-coded for the document to be "color1". If you want to be able to change this per section, I'd recommend adding another parameter to
Good luck!
Cheers,
Vel
This will be a bit trickier to change. The rule color is defined in this line in
moderncvclassic.sty
:Code: Select all
\parbox[t]{\hintscolumnwidth}{\strut\raggedleft\raisebox{\baseletterheight}%
{\color{color1}\rule{\hintscolumnwidth}{0.95ex}}}
\section
with the color you'd like to use. You'll then always need to specify the color whenever you use \section
in the document.Good luck!
Cheers,
Vel
Founder and administrator of LaTeXTemplates.com and LaTeXTypesetting.com
-
- Posts: 1
- Joined: Thu Sep 27, 2018 4:32 am
Each section a different color
Hi, Vel!
I was looking for that rule color line that you said, but I didn't find it, maybe that line code does not exist in the last ModernCV version which is the one I'm using, but I'm not sure. Anyway, in the 2015 version, I think the line that modifies color in a section is found in the file moderncvbodyi.sty, and it is the following:
% styles
\renewcommand*{\sectionstyle}[1]{{\sectionfont\textcolor{color1}{#1}}}
\renewcommand*{\subsectionstyle}[1]{{\subsectionfont\textcolor{color1}{#1}}}
\renewcommand*{\hintstyle}[1]{{\hintfont\textcolor{color0}{#1}}}
However, I don't know how to modify that in order to have a different color in each section, included its bar to the left. tHe reason is that I want make my CV with a 'colorful' ModernCV style. Thus, could you explain me how can I bring your idea "add another parameter to \section with the color you'd like to use. You'll then always need to specify the color whenever you use \section in the document." to life?
Thanks in advance!
I was looking for that rule color line that you said, but I didn't find it, maybe that line code does not exist in the last ModernCV version which is the one I'm using, but I'm not sure. Anyway, in the 2015 version, I think the line that modifies color in a section is found in the file moderncvbodyi.sty, and it is the following:
% styles
\renewcommand*{\sectionstyle}[1]{{\sectionfont\textcolor{color1}{#1}}}
\renewcommand*{\subsectionstyle}[1]{{\subsectionfont\textcolor{color1}{#1}}}
\renewcommand*{\hintstyle}[1]{{\hintfont\textcolor{color0}{#1}}}
However, I don't know how to modify that in order to have a different color in each section, included its bar to the left. tHe reason is that I want make my CV with a 'colorful' ModernCV style. Thus, could you explain me how can I bring your idea "add another parameter to \section with the color you'd like to use. You'll then always need to specify the color whenever you use \section in the document." to life?
Thanks in advance!