I was wondering if there are any way to set the background color of the header part (the one that contains personal info) of a file that uses moderncv in order to visually differentiate the header and the content.

I tried with minipage, \hfill and so on but I guess that moderncv uses a heavily customized template and everything I've tried so far lead to a compile error.

  • What do you mean with the "header" part? Is it the header as in headers/footers of a document or is it the part containing the name and personal information? Which theme (casual, classic) are you using? Mar 5, 2014 at 23:54
  • I mean the part containing personal info. Currently I'm using the classic theme.
    – Ketouem
    Mar 6, 2014 at 0:00

1 Answer 1


One option using the tikzmark library:


\address{\tikzmark{start}street and number}{postcode city}{country}
\email{[email protected]}
\extrainfo{additional information\tikzmark{end}}
\quote{Some quote}


\begin{tikzpicture}[remember picture,overlay]
  (current page.north west) rectangle ([yshift=-1cm]current page.east|-{pic cs:end});



\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}  \cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}

\section{Master thesis}
\cvitem{description}{Short thesis abstract}

\cventry{year--year}{Job title}{Employer}{City}{}{General description no longer than 1--2 lines.\newline{}%
Detailed achievements:%
\item Achievement 1;
\item Achievement 2, with sub-achievements:
  \item Sub-achievement (a);
  \item Sub-achievement (b), with sub-sub-achievements (don't do this!);
    \item Sub-sub-achievement i;
    \item Sub-sub-achievement ii;
    \item Sub-sub-achievement iii;
  \item Sub-achievement (c);
\item Achievement 3.


enter image description here

You place some mark(s) using \tikzmark and then use those marks to draw a rectangle filled with the desired color. In my example code I used

\begin{tikzpicture}[remember picture,overlay]
  (current page.north west) rectangle ([yshift=-1cm]current page.east|-{pic cs:end});

which draws a rectangle having opposite vertices in (current page.north west) (i.e., the upper left corner of the page) and in the point with coordinates ([yshift=-1cm]current page.east|-{pic cs:end}) (this means 1cm below the point that has the same x-coordinate as the leftmost end of the page and the y-coordinate of the point marked end); the end mark was placed inside \extrainfo which was the lowest element used in the personal information. I also placed a start mark in the upper field of the personal information, but I never used this mark.

Feel free to change the colors, and position of the colored background, according to your needs.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .