I'm writing an article and would like to section it with the same style of modernCV, but cannot find any suggestion.

Can someone help me? =)enter image description here

  • Welcome to TeX.SX! Please help us and add a minimal working example (MWE) that shows a basic document and your attempts at solving the question. The horizontal bar can be done with a \rule
    – ienissei
    Apr 27, 2016 at 8:37
  • Package titlesec can do that.
    – Bernard
    Apr 27, 2016 at 9:59
  • If your question is answered, please mark a solution. Apr 30, 2016 at 18:35

1 Answer 1


I found this in the sources of moderncv


it creates the box. The full definition for the section is

  \phantomsection{}% reset the anchor for hyperrefs
  \par\nobreak\addvspace{1ex}\@afterheading}% to avoid a pagebreak after the heading

You just have to replace the cvitem and all the variables.

Edit(This includes all the necessary lengths, you have to insert the color yourself):

\newlength{\hintscolumnwidth} \setlength{\hintscolumnwidth}{0.175\textwidth}
\newlength{\baseletterheight} \settoheight{\baseletterheight}{o}
\newlength{\separatorcolumnwidth} \setlength{\separatorcolumnwidth}{0.025\textwidth}
% fonts
% styles
    \par\nobreak\addvspace{1ex}\@afterheading}% to avoid a pagebreak after the heading
  • I am quite new to latex, so I have to ask you further help if possible. I should copy the text (\RenewDocumentCommand...etc) before \begin{document}. Which variables have I to change and how? Instead of "\cvitem" what should I insert? Sorry for my inexpert questions :) Apr 27, 2016 at 11:12
  • You have to use \usepackage{xparse} and insert the command. You then should remove \cvitem[0ex] and replace the values of \baseletterheight, \hintscolumnwidth, color1, \sectionstyle by whatever they are set to in the original source. And then you have to fiddle around a bit until it's exactly the way you want it.
    – BenjaminH
    Apr 27, 2016 at 11:27

You must log in to answer this question.

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