1

I am trying to perform the following: Control the space before and after \closure

What I am looking for is specified in the following picture: enter image description here

Which is produced using the following MWE:

    \documentclass[11pt,a4paper,sans]{moderncv} 
\moderncvstyle{classic} 
\moderncvcolor{blue} 
\usepackage{lipsum} 

\usepackage[scale=0.75]{geometry} 
\usepackage[english]{babel}
\usepackage{blindtext}

\makeatletter

\renewcommand*{\makelettertitle}{%
    \recomputeletterlengths%
    \begin{minipage}{.5\textwidth}%
        \raggedright
        \addressfont\textcolor{color2}{%
            \makebox[\textwidth][l]{\makebox[2\textwidth]{\bfseries\upshape\@firstname~\@lastname\hfill\normalfont\textcolor{black}{\@date}}}\@firstdetailselementfalse%
            \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%
                \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% 
                \ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%
            \collectionloop{phones}{%
                \makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}%
            \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
            \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%
            \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}%
    \end{minipage}\\[1em]
    \begin{minipage}[t]{.5\textwidth}
        \raggedright%
        \addressfont%
        {@recipientname}\\%
        \@recipientaddress%
    \end{minipage} \\[2em]
    \raggedright%
    \@opening\\[1.5em]%
    \hspace{0pt}\par\vspace{-\baselineskip}\vspace{-\parskip}}

\renewcommand*{\makeletterclosing}{
    \@closing\\[3cm]%Change to your liking
    {\bfseries \@firstname~\@lastname}%
    \ifthenelse{\isundefined{\@enclosure}}{}{%
        \\[3cm]%Change to your liking
        {\color{color2}\itshape\enclname: \@enclosure}}}
\makeatother


\firstname{XXXXXX} 
\familyname{XXXXXX} 
\title{CV}
\address{XXXXXX,12}{12345,XXXXXX}
\email{XXXXXXXXXXXXXX@XXXX.XXX}

\begin{document}
    \recipient{XXXX}{XXXX\\XXXXXXXXXXXX\\1234 XXXXXX\\XXXXXX} 
    \date{\today} 
    \opening{blablabla,} 
    \closing{blablabla} 

    \enclosure[Im Anhang]{\begin{itemize}       \item Lebenslauf        \item Zeugnisse     \end{itemize}} % List of enclosed documents

    \makelettertitle 
    \blindtext[3]
    \makeletterclosing 
    \clearpage
\end{document}
0

Take the definition of the style and recode it.

\documentclass[11pt,a4paper,sans]{moderncv} 
\moderncvstyle{classic} 
\moderncvcolor{blue} 
\usepackage{lipsum} 

\usepackage[scale=0.75]{geometry} 
\usepackage[english]{babel}
\usepackage{blindtext}

\makeatletter

\renewcommand*{\makelettertitle}{%
    \recomputeletterlengths%
    \begin{minipage}{.5\textwidth}%
        \raggedright
        \addressfont\textcolor{color2}{%
            \makebox[\textwidth][l]{\makebox[2\textwidth]{\bfseries\upshape\@firstname~\@lastname\hfill\normalfont\textcolor{black}{\@date}}}\@firstdetailselementfalse%
            \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%
                \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% 
                \ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%
                \collectionloop{phones}{%
                \makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}%
                \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
                \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%
                \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}%
            \end{minipage}\\[1em]
            \begin{minipage}[t]{.5\textwidth}
                \raggedright%
                \addressfont%
                {@recipientname}\\%
                \@recipientaddress%
            \end{minipage} \\[2em]
            \raggedright%
            \@opening\\[1.5em]%
            \hspace{0pt}\par\vspace{-\baselineskip}\vspace{-\parskip}}

\renewcommand*{\makeletterclosing}{
  \@closing\\[1em]%Change to your liking
  {\bfseries \@firstname~\@lastname}%
  \ifthenelse{\isundefined{\@enclosure}}{}{%
      \\[1cm]%Change to your liking
    {\color{color2}\itshape\enclname: \@enclosure}}}
            \makeatother


            \firstname{XXXXXX} 
            \familyname{XXXXXX} 
            \title{CV}
            \address{XXXXXX,12}{12345,XXXXXX}
            \email{XXXXXXXXXXXXXX@XXXX.XXX}

            \begin{document}
            \recipient{XXXX}{XXXX\\XXXXXXXXXXXX\\1234 XXXXXX\\XXXXXX} 
            \date{\today} 
            \opening{blablabla,} 
            \closing{blablabla} 
            \enclosure[Im Anhang]{CV} 

            \makelettertitle 
            \blindtext[3]
            \makeletterclosing 
            \clearpage
            \end{document}
6
  • Unfortunately, this is not doing it. If give 2cm , it will break the closing to the second page, although there is still enough space in the first page. Jun 25 '15 at 11:36
  • I just set both values to two centimeters, and it generates only one page. Your real document might behave different than you minimal working example. Does that work? If not, we need to fix that first, then we can look closer at the real document.
    – Johannes_B
    Jun 25 '15 at 11:44
  • In my document, I have a list of the attached files. I just updated the MWE so you can get the page break. Jun 25 '15 at 11:49
  • Alright, please add showframe as an option to geometry to see where the textblock ends. It just doesn't fit anymore. Using \geometry{textheight=25cm}eveerything will fit again. You can play around with the margins.
    – Johannes_B
    Jun 25 '15 at 11:59
  • The showframe is a very interesting option . Thanks! Where exactly should I use \geometry{textheight=25cm} If i want it to affect only the first page (i.e only the cover letter)? Jun 25 '15 at 12:07

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.