1

I need a bold heading above the "Dear Sir or Madam," in the Cover Letter made with the moderncv template, like this:

enter image description here

Obviously there must be a new line above and under the newly created heading, but I could not edit the picture that way easily.

I am new to LaTeX and I do not even know where I can find the part which controlls the letter heading.

Thats the project's github page: ModernCV I use the classic design.

  • 2
    Welcome to TeX.SE! Your question is not clear! Please add a screenshot (and the code) to your question and mark there where you want to get the bold header. – Mensch May 14 '18 at 10:38
  • I added a screenshot. Like I said, I am not sure where the code is which is responsible for the heading. – Gerolsteiner May 14 '18 at 10:53
1

With version 2.0.0 of moderncv the title of the letter is defined in macro \makeletterhead.

To get the result you want you need to patch this macro with the following code:

\patchcmd{\makeletterhead}{%search
          \raggedright%
  \@opening\\[1.5em]%
        }{%replace
          \raggedright%
  \textbf{\@title}\\[1.5em]
  \@opening\\[1.5em]%
        }{%success
  }{%failure
  }

It adds \title you have to define before as bold heading before the opening text.

With the complete MWE

\documentclass[11pt,a4paper,sans]{moderncv}

% moderncv themes
\moderncvstyle{classic} % casual, classic, banking, oldstyle and fancy
\moderncvcolor{blue} 

\usepackage[utf8]{inputenc}

\usepackage[scale=0.75]{geometry}

% personal data
\name{John}{Doe}
\title{Resumé title}
\address{street and number}{postcode city}{country}
\phone[mobile]{+1~(234)~567~890}
\phone[fixed]{+2~(345)~678~901}
\phone[fax]{+3~(456)~789~012}
\email{john@doe.org}
\homepage{www.johndoe.com}
\social[linkedin]{john.doe}
\social[twitter]{jdoe}
\social[github]{jdoe}
\extrainfo{additional information}
\photo[64pt][0.4pt]{example-image-a}
\quote{Some quote}

\setlength{\footskip}{66pt}

\makeatletter % needed for @ <==========================================
\patchcmd{\makeletterhead}{%search
          \raggedright%
  \@opening\\[1.5em]%
        }{%replace
          \raggedright%
  \textbf{\@title}\\[1.5em]
  \@opening\\[1.5em]%
        }{%success
  }{%failure
  }
\makeatother % needed for @ <===========================================


\begin{document}

%-----       letter       ---------------------------------------------------------
% recipient data
\recipient{Company Recruitment team}{Company, Inc.\\123 somestreet\\some city}
\title{Heading should look like this} % <===============================
\date{January 01, 1984}
\opening{Dear Sir or Madam,}
\closing{Yours faithfully,}
\enclosure[Attached]{curriculum vit\ae{}}
\makelettertitle

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.

Albert Einstein discovered that $e=mc^2$ in 1905.

\[ e=\lim_{n \to \infty} \left(1+\frac{1}{n}\right)^n \]

\makeletterclosing

\end{document}

you get then the following resulting letter:

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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