\xpatchcmd{\makeletterclosing}{\bfseries \@firstname~\@lastname}
                              {\includegraphics[width=4cm, height=1cm]{unterschrift.jpg}
                               \bfseries \@firstname~\@lastname}
% personal data
\title{Lebenslauf}                               % optional, remove / comment the line if not wanted
\address{asdfdsf 12}{77777 scity}{Germany}
\phone[mobile]{+49~(xxx)~xxx~xxx}                   %
\usepackage{ifthen}       % <===========================================
\setboolean{CV}{false}    % <===========================================
\setboolean{Letter}{true} % <===========================================
\ifthenelse{\boolean{CV}}{% print CV
\ \\
\ \\
\includegraphics[width=4cm, height=1cm]{unterschrift.jpg} \\
ccity, 10. Oktober 2017
}{% print no CV
\title{Bewerbung um XXX}
\ifthenelse{\boolean{Letter}}{% print Cover Letter
\date{ccity, 10.10.2017}
\opening{\textbf{Sehr geehrte Damen und Herren},}
\closing{Mit freundlichen Gr"u"sen,}
\enclosure[Im Anhang]{Lebenslauf}          

Suspendisse commodo, massa eu congue tincidunt, elit mauris pellentesque orci, cursus tempor odio nisl euismod augue.

}{% print no Cover Letter


I want to add a title to my letter. The \title{} doesn't print any title. Can someone please help?

  • Welcome to TeX.SX! Please add a full minimal working example (MWE), i.e. a file starting with \documentclass{...} and ending with \end{document}. – diabonas Sep 14 '17 at 16:55
  • Do you want to add a title to the cover letter ? or Do you want to customize the cover letter to include more information ? -- which version of moderncv are you using ? v0.6, v1.2 or v.2.0 ? – Jaime Sep 14 '17 at 17:19
  • I added full working sample, I think I have the version 1.3c – Hakikat41 Sep 14 '17 at 17:36
  • I want customize the cover letter to include more information not add a huge title on the top. – Hakikat41 Oct 5 '17 at 13:25

In moderncv, the classic cover letter does not use the information you provide in the \title. Basically, it was written to create that page without providing any title.

How the cover letter is created

A cover letter is created using some macros to provide information, a macro to create a header and other to create the signature and footer:

\clearpage                             % start a new page

\recipient{ ... }                      % provide information
\opening{ ... }
\closing{ ... }
\enclosure[ ... ]{ ... }
\makelettertitle                       % print title / header

...                                    % print content
\makeletterclosing                     % print letter footer / signature

The \makelettertitle and \makeletterclosing do not use the information of the title (@title) to create the content.

How to add a title

At the end, A moderncv document is a LaTeX document. You can add content before or after the header provided by the template. For instance, you can add a title before the header or after the salutation.

\clearpage                             % start a new page
\recipient{ ... }                      % provide information

{\centering \Huge Add a title \par}    % add a text before header
\makelettertitle                       % print title / header
{\Huge Add another title \par}         % add a text after header   

Modifying moderncv

You may be interested on modifying the moderncv template. You can get the source code from Github.

If you want to change the code, note that moderncv has many "styles". The \makelettertitle is defined empty in the moderncv.cls file.

% makes the letter title
% usage: \makelettertitle
\newcommand*{\makelettertitle}{}    % for the version v1.2.0

The macro is redefined in each style. For instance, if you use the classic style, that style is defined in moderncvstyleclassic.sty file. You must look for the \renewcommand*{\makelettertitle} in the file for the style you are using and change the code.

| improve this answer | |

The banking moderncvstyle prints a title in the letter head. If you want to use a moderncvstyle of your choice, you will have to redefine the makeletterhead command.

| 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.