# Disable exceptional behavior of the first page in letter

I use the following code for my letter:

\documentclass[a4paper, 11pt]{letter}

\usepackage{fontspec}
\usepackage{fancyhdr}

\newcommand{\DocumentTitle}{Motivation Letter}
\newcommand{\Author}{Johm Smith}

\setmainfont{Times New Roman}

\usepackage[hmargin=1in,vmargin=1in]{geometry}

\pagestyle{fancy}
\fancyhf{} % clear all header and footers
\fancyfoot[L]{\DocumentTitle \\ \Author}
\fancyfoot[R]{\thepage}

\renewcommand{\footrulewidth}{0.4pt}
\thispagestyle{fancy}

\begin{document}

\begin{letter}{ }

\signature{\Author}

\opening{To Whom It May Concern,}
\closing{Respectfully,}

\end{letter}

\end{document}


But there is no these header and footer on the first page. How to change this behavior?

-
Try \thispagestyle{fancy}. –  Peter Grill Nov 15 '12 at 19:30
Possible Duplicate: Putting the title in the header for an article. –  Peter Grill Nov 15 '12 at 19:32
@Peter Grill Where I must put this. –  user14416 Nov 15 '12 at 19:38
You would normally add it to the preamble, but your code seems to work fine with the letter class. So, while code snippets are useful in explanations, I recommend you compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. –  Peter Grill Nov 15 '12 at 19:39

In the letter document class, \opening issues \thispagestyle{firstpage}, where \ps@firstpage is defined in letter.cls for the first page of a letter. To apply the same header/footer to this page, you can \let the firstpage style to be fancy, using

\let\ps@firstpage\ps@fancy


A complete example:

\documentclass[a4paper, 11pt]{letter}

\usepackage{fontspec}
\usepackage{fancyhdr}

\newcommand{\DocumentTitle}{Motivation Letter}
\newcommand{\Author}{Johm Smith}

%\setmainfont{Times New Roman}

\usepackage[hmargin=1in,vmargin=1in]{geometry}

\pagestyle{fancy}
\fancyhf{} % clear all header and footers
\fancyfoot[L]{\DocumentTitle \\ \Author}
\fancyfoot[R]{\thepage}

\renewcommand{\footrulewidth}{0.4pt}

\makeatletter
\let\ps@firstpage\ps@fancy
\makeatother

\begin{document}

\begin{letter}{ }
\signature{\Author}

\opening{To Whom It May Concern,}
\closing{Respectfully,}

\end{letter}
\end{document}


I commented out the line \setmainfont{Times New Roman} in my example code, since I don't have this font in my system.

-