# Page margin, header and footer configuration

This is how my letter looks like

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


What like the pdf looks like

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


I want that H = F M1 = M2 and length S is too big. But now, H != F and M1 != M2. How I can achieve that?

## 1 Answer

For having H = F include includehead,includefoot in the option of geometry.

For reducing the space between the closing and the signature you can use the etoolbox package to patch the distance:

\usepackage{etoolbox}
\patchcmd{\closing}{6}{2}{}{}


or

\pathcmd{\closing}{6\medskipamount}{<insert the distance you prefer>}{}{}


It seems to me that to vertically center the content of the letter (i.e., M1 = M2) would require a substantial rewriting of the letter class. One has to consider whether it does not fit in one page, and then processing it accordingly.

• I added includehead,includefoot (\usepackage[hmargin=1in,vmargin=1.2in,includehead,includefoot]{geometry}). Still H != F. – user14416 Nov 16 '12 at 16:04
• Have you removed the \setlength{\headheight} line from your code? – Guido Nov 16 '12 at 17:48