3

I am using Texmaker to update my CV, but i am having problem with the \extrainfo. I am using moderncv documentclass and moderncvstyle {classic}. I want extrainfo to appear in my curriculum but not in my cover letter. Latex Template code is given below:

\documentclass[11pt,a4paper,sans]{moderncv}
\pagestyle{fancy}
\usepackage{moderntimeline}
\moderncvstyle{classic}
\moderncvcolor{green}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.75]{geometry}
\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}
\extrainfo{additional information}
\photo[64pt][0.4pt]{picture}
\quote{Some quote}
\begin{document}
\makecvtitle

Then code goes on with section, subsections for CV until we arrive at the coverleter part

    \recipient{Company Recruitment team}{Company, Inc.\\123 somestreet\\some city}
    \date{January 01, 1984}
    \opening{Dear Sir or Madam,}
    \closing{Yours faithfully,}
    \enclosure[Attached]{curriculum vit\ae{}}  
    \makelettertitle
    \makeletterclosing
    \end{document}

What i get in Cv and cover letter is shown below: enter image description here

Same 'Additional information' appear in the cover letter as:enter image description here

Now I want to keep this Additional information in my Cv but want to remove it from the cover letter. Any help????

3

Instead of patching \makelettertitle, you can just set the "additional information" macro (\@extrainfo) to \relax:

\makeatletter
\let\@extrainfo\relax% Remove \@extrainfo
\makeatother
\makelettertitle
3

add

\patchcmd\makelettertitle{\makenewline\@extrainfo}{}{}{}

after

\moderncvstyle{classic}

In more details, what this does is to edit \makelettertitle from moderncvstyleclassic.sty removing the call to \@extrainfo:

\renewcommand*{\makelettertitle}{%
[...] 
     \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}} %% patchcmd edits this line removing the \@extrainfo command that is responsible for inserting the "additional information" inside the letter title
[...]

the etoolbox package (which allows you to use patchcmd) is already loaded by moderncv so you just need to use it.

  • How would I achieve the same result, but using the 'banking' style? – MLC Aug 22 '16 at 23:46
1

It seems that the easiest way would be to add an empty \extrainfo{} before the command \makelettertitle. Thereby you would overwrite the previous information.

\documentclass[11pt,a4paper,sans]{moderncv}
\pagestyle{fancy}
\usepackage{moderntimeline}
\moderncvstyle{classic}
\moderncvcolor{green}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.75]{geometry}
\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}
\extrainfo{additional information}
%\photo[64pt][0.4pt]{picture}
\quote{Some quote}
\begin{document}
\makecvtitle
\clearpage
\recipient{Company Recruitment team}{Company, Inc.\\123 somestreet\\some city}
\date{January 01, 1984}
\opening{Dear Sir or Madam,}
\closing{Yours faithfully,}
\enclosure[Attached]{curriculum vit\ae{}}  
\extrainfo{}                    % <== that's the magic
\makelettertitle
\makeletterclosing
\end{document}

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.