TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Using moderncv, I want to print the section number before the section name. Does anyone know how to do it?

share|improve this question
Welcome to TeX.sx! Please add a minimal working example (MWE) that shows what you have done so far. – lockstep Dec 25 '12 at 22:52
up vote 6 down vote accepted

The moderncv class has no provision for numbering sections; it uses a modified \section command, so no counter and so on.

You can still modify the \section command to produce a number, by adding code such as this in the preamble:

\patchcmd{\section}{\sectionstyle{#1}}{\sectionstyle{\numbersec #1}}{}{}

The \section command is patched to produce a number before the section title.

Complete example

This is taken from the template provided by moderncv



\patchcmd{\section}{\sectionstyle{#1}}{\sectionstyle{\numbersec #1}}{}{}

% personal data
\title{Resum\'e title}
\address{street and number}{postcode city}
\extrainfo{additional information}
\quote{Some quote}



\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.
\cventry{year--year}{Job title}{Employer}{City}{}{Description line 1\newline{}Description line 2}
\cventry{year--year}{Job title}{Employer}{City}{}{Description}

\cvitemwithcomment{Language 1}{Skill level}{Comment}
\cvitemwithcomment{Language 2}{Skill level}{Comment}
\cvitemwithcomment{Language 3}{Skill level}{Comment}

\section{Computer skills}
\cvdoubleitem{category 1}{XXX, YYY, ZZZ}{category 4}{XXX, YYY, ZZZ}
\cvdoubleitem{category 2}{XXX, YYY, ZZZ}{category 5}{XXX, YYY, ZZZ}
\cvdoubleitem{category 3}{XXX, YYY, ZZZ}{category 6}{XXX, YYY, ZZZ}

\cvitem{hobby 1}{Description}
\cvitem{hobby 2}{Description}
\cvitem{hobby 3}{Description}


enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.