# How to move name, address, phone, email to the middle and add a headline below it?

I am trying to create my cover letter with class moderncv but I don't quite know how to move the name, address, phone, email to the top center of the page. I would like to make it look like the one in second picture (it's a screenshot of a word document).

\documentclass[11pt,a4paper,roman]{moderncv}
\usepackage[english]{babel}

\moderncvstyle{classic}
\moderncvcolor{green}

% character encoding
\usepackage[utf8]{inputenc}

\usepackage[scale=0.75]{geometry}

% personal data
\name{John}{Doe}

\phone[mobile]{0123-123456789}
\email{john@doe.com}

\begin{document}

\recipient{To}{Employer}
\date{\today}
\opening{Hi!}
\enclosure[Attachment]{CV}
\makelettertitle


That is want I want to get:

# EDIT:

Thank you again for the suggestion. I have almost everything I need for the cover letter except for the address part. When I add the address below name, it creates space between the address and the phone/email. I tried reducing the space but it didn't work. How can I reduce the space? Thanks!

% personal data
\name{John}{Doe}
\phone {(111)-111-111}
\email{johndoe@johndoe.com}


• Welcome to TeX.SX! Probably you are more satisfied with the banking style. For an example output see here: mirror.physik-pool.tu-berlin.de/pub/CTAN/macros/latex/contrib/… – leandriis Jul 29 '19 at 18:09
• Yeah, banking style sounds good. However, it is a resume and I'm looking to integrate that style on my cover letter. – Akboh Jul 29 '19 at 18:39
• Page 4 of the above mentioned example document shows the corresponding cover letter. – leandriis Jul 29 '19 at 18:44
• @leandriis where do I find that template? edit: I found it. – Akboh Jul 30 '19 at 1:24
• If you like my answer and it was helpful, please consider upvoting (by clicking on the arrows next to the score) and/or marking it as the accepted answer (by clicking on the checkmark ✓). That is the way here to say "Thank you for your help!" – Mensch Aug 19 '19 at 17:54

The issue here has two parts:

1. Choose the right/best layout for the cover letter
2. Add the title at the proper place

Because you did not tell us if you build your cv and the cover letter in one file I guess you do ...

So you have first to change for the cover letter the used head (it is easier to use an already existing layout than to complete rewrite the code for the header ...) like this:

\title{title of the job} % <============================================
\makeatletter
{\ifthenelse{\equal{\@title}{}}{}{\titlestyle{~|~\@title}}\\}%
{\ifthenelse{\equal{\@title}{}}{}{\\}}% <=============================
{}%
{}


Command \moderncvhead{3} uses the header used in style banking and with the following patchcmd I simply deleted the predefined title. We add the missing title with the code:

\patchcmd{\makeletterhead}%
{\par}%
{%
\par%
\textbf{\@title}\\[2em]% <==========================================
}%
{}%
{}
\makeatother


Please see that \makeatletter and \makeatother are needed to be able to use @ in the code ...

Of course you can use another value instead my used 2em to define the space between the title and the following To: in line

\textbf{\@title}\\[2em]% <==========================================


So please see the following complete mwe

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

\usepackage[english]{babel}
\usepackage{blindtext}

\moderncvstyle{classic} % <================================ classic banking head 3, body 3
\moderncvcolor{green}

% character encoding
\usepackage[utf8]{inputenc}

\usepackage[scale=0.75]{geometry}

% personal data
\name{John}{Doe}

\phone[mobile]{0123-123456789}
\email{john@doe.com}

\title{title of the job} % <============================================
\makeatletter
{\ifthenelse{\equal{\@title}{}}{}{\titlestyle{~|~\@title}}\\}%
{\ifthenelse{\equal{\@title}{}}{}{\\}}% <=============================
{}%
{error}

{\par}%
{%
\par%
\textbf{\@title}\\[2em]% <==========================================
}%
{}%
{}
\makeatother

\begin{document}

\recipient{To}{Employer}
\date{\today}
\opening{Hi!}
\enclosure[Attachment]{CV}
\makelettertitle

\blindtext
\end{document}


and its result:

# EDIT (for first comment):

To get a smaller gap between the name and the jobtitle add the following code

\patchcmd{\makehead}%
{\\[2.5em]}%
{\\[1em]}% <=============================
{}%
{}


Change my used [1em] to a value fitting your needs ...

See the complete mwe

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

\usepackage[english]{babel}
\usepackage{blindtext}

\moderncvstyle{classic} % <================================ classic banking head 3, body 3
\moderncvcolor{green}

% character encoding
\usepackage[utf8]{inputenc}

\usepackage[scale=0.75]{geometry}

% personal data
\name{John}{Doe}

\phone[mobile]{0123-123456789}
\email{john@doe.com}

\title{title of the job} % <============================================
\makeatletter
{\ifthenelse{\equal{\@title}{}}{}{\titlestyle{~|~\@title}}\\}%
{\ifthenelse{\equal{\@title}{}}{}{\\}}% <=============================
{}%
{}

{\\[2.5em]}%
{\\[1em]}% <=============================
{}%
{}

{\par}%
{%
\par%
\textbf{\@title}\\[2em]% <==========================================
}%
{}%
{}
\makeatother

\begin{document}

\recipient{To}{Employer}
\date{\today}
\opening{Hi!}
\enclosure[Attachment]{CV}
\makelettertitle

\blindtext
\end{document}


and its result:

# EDIT (for your edit in question):

You need to add another patch to the code:

\patchcmd{\makehead}% <=================================================
{\\\null}%
{\\}% <=============================
{}%
{}


With the complete mwe

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

\usepackage[english]{babel}
\usepackage{blindtext}

\moderncvstyle{classic} % <================================ classic banking head 3, body 3
\moderncvcolor{green}

% character encoding
\usepackage[utf8]{inputenc}

\usepackage[scale=0.75]{geometry}

% personal data
\name{John}{Doe}
\phone {(111)-111-111}
\email{johndoe@johndoe.com}

\title{title of the job} % <============================================
\makeatletter
{\ifthenelse{\equal{\@title}{}}{}{\titlestyle{~|~\@title}}\\}%
{\ifthenelse{\equal{\@title}{}}{}{\\}}% <=============================
{}%
{}

{\\[2.5em]}%
{\\[1em]}% <=============================
{}%
{}

{\\\null}%
{\\}% <=============================
{}%
{}

{\par}%
{%
\par%
\textbf{\@title}\\[2em]% <==========================================
}%
{}%
{}
\makeatother

\begin{document}

\recipient{To}{Employer}
\date{\today}
\opening{Hi!}

• @AbhinavKonagala Please do not use this outdated class resume.cls and please note the code you gave there is not compilable!). Why do you not use class moderncv for your cv too, then you can keep cover letter and cv in one file ... – Mensch Jul 30 '19 at 15:41