我的信是这样的
\documentclass[a4paper, 11pt]{letter}
\usepackage{fontspec}
\usepackage{fancyhdr}
\newcommand{\DocumentTitle}{Motivation Letter}
\newcommand{\Author}{John Smith}
\setmainfont{Times New Roman}
\newfontfamily\hdrfont[ LetterSpace=5.0, WordSpace=1.0, Scale=0.9, Color=FFFFFF ]{Arial}
\usepackage[hmargin=1in,vmargin=1.8in]{geometry}
\linespread{1.2}
\pagestyle{fancy}
\fancyhf{} % clear all header and footers
\setlength{\headheight}{0.5in}
\fancyhead[L]{\hdrfont\textbf{\DocumentTitle} \\ \emph{\Author}}
\fancyhead[R]{\hdrfont\thepage}
\fancyfoot[L]{\hdrfont\textbf{\DocumentTitle} \\ \emph{\Author}}
\fancyfoot[R]{\hdrfont\thepage}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\begin{document}
\name{ \Author }
\signature{ \Author }
\begin{letter}{}
\renewcommand{\today}{ February 16, 2009 }
\opening{To Whom It May Concern,}
\thispagestyle{fancy}
\closing{Respectfully,}
My Letter
\end{letter}
\end{document}
PDF 是什么样子的
--------------------------------------- PAGE BEGIN
H
--------------------------------------- HEADER RULE
M1
To Whom It May Concern,---------------- TEXT BEGIN
My Letter
Respectfully,-------------------------- closing
S
John Smith----------------------------- signature
--------------------------------------- TEXT END
M2
--------------------------------------- FOOTER RULE
F
--------------------------------------- PAGE END
我想要的是H = F
M1 = M2
并且长度S
太大。但是现在,H != F
并且M1 != M2
。我该如何实现呢?
答案1
因为已将其H = F
纳入includehead,includefoot
选项中geometry
。
为了减少结束语和签名之间的距离,您可以使用etoolbox
包来修补距离:
\usepackage{etoolbox}
\patchcmd{\closing}{6}{2}{}{}
或者
\pathcmd{\closing}{6\medskipamount}{<insert the distance you prefer>}{}{}
在我看来,要垂直居中字母内容(即M1 = M2
),需要对letter
类进行大量重写。必须考虑它是否不适合一页,然后进行相应的处理。