使用“lettre”类时调整空间

使用“lettre”类时调整空间

我是使用 LaTeX 写信的新手,我想知道是否有办法调整发件人电子邮件地址末尾和信件主题之间的空格(见下图)。我阅读了文件,lettre.cls但找不到我想要的内容。

绿色箭头代表我需要修改长度的空间

以下是我迄今为止使用的代码:

\documentclass[11pt]{lettre}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{eurosym}
\usepackage[english]{babel}
\makeatletter
\newcommand*{\NoRule}{\renewcommand*{\rule@length}{0}}
\makeatother


\begin{document}
\begin{letter}
\name{}
\signature{SMITH John}

\address{SMITH John\\New-York\\90 California Street\\FRANCE}
\lieu{}
\telephone{+33 00 00 00 00 00}
\email{[email protected]}
\nofax
\nodate
\nobreak
\NoRule
\pagestyle{empty}
\def\concname{}


\conc{Subject : Speculative Job Application - NASA}

\opening{Dear Mr Doe,}

I am writing to express my interest in working with you.

\closing{Yours sincerely,}


\end{letter}

\end{document}

提前感谢你的帮助,Arnaud。

答案1

该类lettre在地址块后添加了一个相当大的空格,另外还在\openingspace主题和开头行之间添加了两倍的 。

您可以修补该\letteropening命令以添加不同的间距(也可以是负数,如下例所示)。

\documentclass[11pt]{lettre}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{eurosym}
\usepackage[english]{babel}
\usepackage{etoolbox}

% The default value of \openingspace is 1cm.
% Instead of -\openingspace use the length you prefer
% for instance -0.5cm or whatever
\patchcmd{\letteropening}{2\openingspace}{-\openingspace}{}{}

\makeatletter
\newcommand*{\NoRule}{\renewcommand*{\rule@length}{0}}
\makeatother



\begin{document}
\begin{letter}
\name{}
\signature{SMITH John}

\address{SMITH John\\New-York\\90 California Street\\FRANCE}
\lieu{}
\telephone{+33 00 00 00 00 00}
\email{[email protected]}
\nofax
\nodate
\nobreak
\NoRule
\pagestyle{empty}
\def\concname{}


\conc{Subject: Speculative Job Application - NASA}

\opening{Dear Mr Doe,}

I am writing to express my interest in working with you.

\closing{Yours sincerely,}


\end{letter}

\end{document}

在此处输入图片描述

答案2

如果您有兴趣以更舒适的方式处理信件内容,我建议您放弃lettre文档类并使用 来制作您自己的信件article。这非常简单,因为您不必指定那些没有放置在您想要的位置的 manu 参数……您只需指定您想要的内容,在您想要的位置:

在此处输入图片描述

\documentclass{article}

\usepackage[utf8]{inputenc}

\usepackage{geometry}
\geometry{%
  hmargin=2in,% horizontal margin of 2in
  vmargin=1in % vertical margin of 1in
}

\setlength{\parindent}{0pt}% No paragraph indent
\pagestyle{empty}% No header/footer

\begin{document}

\hspace*{-1in}% Move address/reference 1in into left margin
\begin{tabular}{@{}l}
  SMITH John \\
  New-York \\
  90 California Street \\
  FRANCE \\[\medskipamount]
  Tél. +33 00 00 00 00 00 \\
  E-Mail: \texttt{[email protected]}
\end{tabular}

\bigskip% Space between address/reference and Subject

Subject: Speculative Job Application - NASA

\bigskip% Space between Subject and opening

Dear Mr Doe,

\medskip% Space between opening and letter content

I am writing to express my interest in working with you.

\bigskip% Space between letter content and closing

Yours sincerely,

\bigskip\bigskip% Space between closing and signature

\hfill% Signature is flush right
SMITH John% Signature

\end{document}

以上所有位置和长度均可根据您的要求进行更改。我发现代码的可读性更强,因此易于操作/更改。

相关内容