求职信 moderncv 开头和结尾间距

求职信 moderncv 开头和结尾间距

我正在使用 moderncv 写求职信。到目前为止一切正常,但由于我没有使用任何\opening{},所以我有一个很大的空白垂直间距,我不知道如何摆脱它。

\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}

在此处输入图片描述

我该如何控制这些间距?更确切地说,我该如何使它们更小?

答案1

\opening命令\@opening在内部的使用moderncv机制如下:

 \@opening\\[1.5em]

一个肮脏但快速而无痛的方法就是在文档中使用命令来opening抵消\vspace*{-1.5em}该类后来引入的间距,即

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

这是一个完整的代码示例

\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}

其结果为:

在此处输入图片描述

相关内容