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

I have a question about moderncv. I want to work with the moderncv style classic. But I found out, that the theme casual produces a horizontal line underneath the name. Is it possible, to get the same line in the classic theme?

My header:





Then there is the personal information, ...

share|improve this question

The rule added by the casual theme uses the following code:


Adding \par on either side allows for vertical spacing between document elements. The casual theme actually uses something similar to


to insert space above and below the horizontal rule.

I've added the above \par-suggestion inside a redefinition of \makecvtitle - the macro that creates the CV header/title - from the classic theme. It is clearly marked as follows:

{\par\color{color2!50}\rule{\textwidth}{.25ex}\par}% <----- ADDED RULE

The MWE below is taken from template.tex, distributed with moderncv:

enter image description here

%% start of file `template.tex'.
%% Copyright 2006-2012 Xavier Danaux (xdanaux@gmail.com).
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License version 1.3c,
% available at http://www.latex-project.org/lppl/.

\documentclass[11pt,a4paper,sans]{moderncv}   % possible options include font size ('10pt', '11pt' and '12pt'), paper size ('a4paper', 'letterpaper', 'a5paper', 'legalpaper', 'executivepaper' and 'landscape') and font family ('sans' and 'roman')

\moderncvstyle{classic}                  % style options are 'casual' (default), 'classic', 'oldstyle' and 'banking'

% moderncv themes
\moderncvcolor{red}                         % color options 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black'
%\renewcommand{\familydefault}{\sfdefault}    % to set the default font; use '\sfdefault' for the default sans serif font, '\rmdefault' for the default roman one, or any tex font name
%\nopagenumbers{}                             % uncomment to suppress automatic page numbering for CVs longer than one page

% character encoding
%\usepackage[utf8]{inputenc}                  % if you are not using xelatex ou lualatex, replace by the encoding you are using
%\usepackage{CJKutf8}                         % if you need to use CJK to typeset your resume in Chinese, Japanese or Korean

% adjust the page margins
%\setlength{\hintscolumnwidth}{3cm}           % if you want to change the width of the column with the dates
%\setlength{\maketitlenamewidth}{10cm}        % for the 'classic' style, if you want to force the width allocated to your name and avoid line breaks. be careful though, the length is normally calculated to avoid any overlap with your personal info; use this at your own typographical risks...

  % recompute lengths (in case we are switching from letter to resume, or vice versa)
  % optional detailed information box
        \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}}% if \addresstreet is defined, \addresscity will always be defined but could be empty
  % optional picture box
  % name and title
  \ifthenelse{\lengthtest{\makecvtitlenamewidth=0pt}}% check for dummy value (equivalent to \ifdim\makecvtitlenamewidth=0pt)
    \namestyle{\@firstname\ \@familyname}%
  % detailed information
  \llap{\usebox{\makecvtitledetailsbox}}% \llap is used to suppress the width of the box, allowing overlap if the value of makecvtitlenamewidth is forced
  {\par\color{color2!50}\rule{\textwidth}{.25ex}\par}% <----- ADDED RULE
  % optional photo
  % optional quote
  \par}% to avoid weird spacing bug at the first section if no blank line is left after \makecvtitle

% personal data
\title{Resume title (optional)}               % optional, remove the line if not wanted
\address{street and number}{postcode city}    % optional, remove the line if not wanted
\mobile{+1~(234)~567~890}                     % optional, remove the line if not wanted
\phone{+2~(345)~678~901}                      % optional, remove the line if not wanted
\fax{+3~(456)~789~012}                        % optional, remove the line if not wanted
\email{john@doe.org}                          % optional, remove the line if not wanted
\homepage{www.johndoe.com}                    % optional, remove the line if not wanted
\extrainfo{additional information}            % optional, remove the line if not wanted
%\photo[64pt][0.4pt]{picture}                  % '64pt' is the height the picture must be resized to, 0.4pt is the thickness of the frame around it (put it to 0pt for no frame) and 'picture' is the name of the picture file; optional, remove the line if not wanted
\quote{Some quote (optional)}                 % optional, remove the line if not wanted

% to show numerical labels in the bibliography (default is to show no labels); only useful if you make citations in your resume

% bibliography with mutiple entries
%            content
%\begin{CJK*}{UTF8}{gbsn}                     % to typeset your resume in Chinese using CJK
%-----       resume       ---------------------------------------------------------

\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}  % arguments 3 to 6 can be left empty

\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}

\section{Extra 1}
\cvlistitem{Item 1}
\cvlistitem{Item 2}
\cvlistitem{Item 3}

\renewcommand{\listitemsymbol}{-~}            % change the symbol for lists

\section{Extra 2}
\cvlistdoubleitem{Item 1}{Item 4}
\cvlistdoubleitem{Item 2}{Item 5\cite{book1}}
\cvlistdoubleitem{Item 3}{}

% Publications from a BibTeX file without multibib\renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}% for BibTeX numerical labels
\bibliography{publications}                   % 'publications' is the name of a BibTeX file

% Publications from a BibTeX file using the multibib package
%\bibliographybook{publications}              % 'publications' is the name of a BibTeX file
%\bibliographymisc{publications}              % 'publications' is the name of a BibTeX file

%-----       letter       ---------------------------------------------------------
% recipient data
\recipient{Company Recruitment team}{Company, Inc.\\123 somestreet\\some city}
\date{January 01, 1984}
\opening{Dear Sir or Madam,}
\closing{Yours faithfully,}
\enclosure{curriculum vit\ae{}}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis ullamcorper neque sit amet lectus facilisis sed luctus nisl iaculis. Vivamus at neque arcu, sed tempor quam. Curabitur pharetra tincidunt tincidunt. Morbi volutpat feugiat mauris, quis tempor neque vehicula volutpat. Duis tristique justo vel massa fermentum accumsan. Mauris ante elit, feugiat vestibulum tempor eget, eleifend ac ipsum. Donec scelerisque lobortis ipsum eu vestibulum. Pellentesque vel massa at felis accumsan rhoncus.

Suspendisse commodo, massa eu congue tincidunt, elit mauris pellentesque orci, cursus tempor odio nisl euismod augue. Aliquam adipiscing nibh ut odio sodales et pulvinar tortor laoreet. Mauris a accumsan ligula. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Suspendisse vulputate sem vehicula ipsum varius nec tempus dui dapibus. Phasellus et est urna, ut auctor erat. Sed tincidunt odio id odio aliquam mattis. Donec sapien nulla, feugiat eget adipiscing sit amet, lacinia ut dolor. Phasellus tincidunt, leo a fringilla consectetur, felis diam aliquam urna, vitae aliquet lectus orci nec velit. Vivamus dapibus varius blandit.

Duis sit amet magna ante, at sodales diam. Aenean consectetur porta risus et sagittis. Ut interdum, enim varius pellentesque tincidunt, magna libero sodales tortor, ut fermentum nunc metus a ante. Vivamus odio leo, tincidunt eu luctus ut, sollicitudin sit amet metus. Nunc sed orci lectus. Ut sodales magna sed velit volutpat sit amet pulvinar diam venenatis.


%\clearpage\end{CJK*}                         % if you are typesetting your resume in Chinese using CJK; the \clearpage is required for fancyhdr to work correctly with CJK, though it kills the page numbering by making \lastpage undefined

%% end of file `template.tex'.

You may want to modify the spacing, if it doesn't suit your liking. Also, you may have to modify \makecvtitle further if you actually include an image.

share|improve this answer
Worked perfectly and the result is exactly was I was looking for! Thank you. – maad Jul 1 '12 at 15:07

If one uses the image, simply move the above mentioned code a line down. color1 is the theme color, color2 is dark grey, color0 is black.

\llap{\usebox{\makecvtitledetailsbox}}% \llap is used to suppress the width of the box, allowing overlap if the value of makecvtitlenamewidth is forced
% optional photo (rendering)
share|improve this answer
Welcome to TeX.SX! – Adam Liter Apr 6 '14 at 4:53
Thank you! I've been lurking for months and got so much useful information from this forum. – Niko Z. Apr 6 '14 at 5:17

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.