Curricula Vitae / Résumés ⇒ Each section a different color
-
- Posts: 679
- Joined: Tue Mar 03, 2015 4:01 pm
Each section a different color
gcunhase
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Each section a different color
Sure, you can do this with the
\color
command like this:Code: Select all
\section{\color{red}{Education}}
Vel
-
- Posts: 679
- Joined: Tue Mar 03, 2015 4:01 pm
Re: Each section a different color

gcunhase
Each section a different color
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
-
- Posts: 1
- Joined: Thu Sep 27, 2018 4:32 am
Each section a different color
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!