[Tex/LaTex] Change position of \enclosure in \makeletterclosing in moderncv template

moderncv

While writing the cover letter, the \makeletterclosing automatically adds \enclosure at the end of the page. Is there a way to reduce the space between Name and the \enclosure information.Reduce this space

Best Answer

At last it depends on your used \moderncvstyle.

For example if you use \moderncvstyle{classic} the command \makeletterclosing is defined as:

\renewcommand*{\makeletterclosing}{
  \@closing\\[3em]%
  {\bfseries\@firstname~\@lastname}%
  \ifthenelse{\isundefined{\@enclosure}}{}{%
    \\%
    \vfil%
    {\color{color2}\itshape\enclname: \@enclosure}}%
    \vfil}

In your case you need to delete \vfil and add a little space after the signature like:

\makeatletter
\renewcommand*{\makeletterclosing}{
  \@closing\\[3em]%
  {\bfseries\@firstname~\@lastname}%
  \ifthenelse{\isundefined{\@enclosure}}{}{%
    \\[1cm]% <==========================================================
    {\color{color2}\itshape\enclname: \@enclosure}}%
}
\makeatother

Change the value 1cm in \\[1cm] for your needs ...

With the following compiling MWE (please add one to your next question by your own)

\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
\renewcommand*{\makeletterclosing}{
  \@closing\\[3em]%
  {\bfseries\@firstname~\@lastname}%
  \ifthenelse{\isundefined{\@enclosure}}{}{%
    \\[1cm]% <==========================================================
    {\color{color2}\itshape\enclname: \@enclosure}}%
}
\makeatother


\begin{document}

%-----       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[Attached]{curriculum vit\ae{}}
\makelettertitle
%\raggedbottom

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.

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 the result:

enter image description here