1

I am writing a cover letter using moderncv. Everything works fine so far, but since I am not using any \opening{}, I am having a large empty vertical spacing and I don't know how to get rid of it.

\documentclass[11pt,a4paper,sans,french]{moderncv}        
\usepackage{ragged2e}
% moderncv themes
\moderncvstyle{classic}                           
\moderncvcolor{green}                             

\usepackage[utf8]{inputenc}                  
\usepackage[scale=0.75]{geometry}

\name{XXX}{XXX}
\title{}                            
\address{XXXX}{XXX}% optional, remove / comment the line if not wanted; the "postcode city" and and "country" arguments can be omitted or provided empty
\phone[mobile]{+XXX}               
\email{XXX}                            

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\renewcommand{\baselinestretch}{1.25}

\begin{document}
% recipient data
\recipient{XXX}{XXX}
\opening{}
\closing{Sincerely,}
\makelettertitle
\justify
Dear Mr. XXX,

\makeletterclosing

\end{document}

enter image description here

How can I control those spacings? More precisely, how can I make them smaller?

3

The \opening command, internally \@opening is used in the moderncv mechanism like this:

 \@opening\\[1.5em]

One dirty but quick and painless way to make it work is to use, in your document, the opening command with \vspace*{-1.5em} to counter the spacing later introduced by the class, i.e.

 \opening{\vspace*{-1.5em}}

Here a full code sample

\documentclass[11pt,a4paper,sans,french]{moderncv}        
\usepackage{ragged2e}
% moderncv themes
\moderncvstyle{classic}                           
\moderncvcolor{green}    
\usepackage[utf8]{inputenc}                  
\usepackage[scale=0.75]{geometry}

\name{XXX}{XXX}
\title{}                            
\address{XXXX}{XXX}% optional, remove / comment the line if not wanted; the "postcode city" and and "country" arguments can be omitted or provided empty
\phone[mobile]{+XXX}               
\email{XXX}                            

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\renewcommand{\baselinestretch}{1.25}

\begin{document}
% recipient data
\recipient{XXX}{XXX}
\opening{\vspace*{-1.5em}}
\closing{Sincerely,}
\makelettertitle
\justify
\vspace*{-1.5em}
Dear Mr. XXX,

\makeletterclosing

\end{document}

Which produces:

enter image description here

  • I don't think it's dirty. This saved my issue. Thanks! – Joker 00 May 5 '17 at 20:02

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.