In LaTeX, how can one add a header/footer in the document class Letter?

Posted by Brian M. Hunt on Stack Overflow See other posts from Stack Overflow or by Brian M. Hunt
Published on 2009-02-18T05:19:06Z Indexed on 2010/06/02 4:03 UTC
Read the original article Hit count: 330

Filed under:
|
|

In LaTeX, how can one create a document using the Letter documentclass, but with customized headers and footers?

Typically I would use:

\usepackage{fancyhdr}

\pagestyle{fancy}
\lhead{\footnotesize \parbox{11cm}{Custom left-head-note} }
\lfoot{\footnotesize \parbox{11cm}{\textit{#2}}}
\rfoot{\footnotesize Page \thepage\ of \pageref{LastPage}}
\renewcommand\headheight{24pt}
\renewcommand\footrulewidth{0.4pt}

However, with \documentclass{letter}, this doesn't work at all. Suggestions are duly appreciated.

EDIT: Here is sample code that doesn't work (for any apparent reason):

\documentclass[12pt]{letter}

\usepackage{fontspec}% font selecting commands 
\usepackage{xunicode}% unicode character macros 
\usepackage{xltxtra} % some fixes/extras 

% page counting, header/footer
\usepackage{fancyhdr}
\usepackage{lastpage}

\pagestyle{fancy}
\lhead{\footnotesize \parbox{11cm}{Draft 1} }
\lfoot{\footnotesize \parbox{11cm}{\textit{2}}}
\cfoot{}
\rhead{\footnotesize 3}
\rfoot{\footnotesize Page \thepage\ of \pageref{LastPage}}
\renewcommand{\headheight}{24pt}
\renewcommand{\footrulewidth}{0.4pt}

\begin{document}
\name{ Joe Laroo }
\signature{ Joe Laroo }
\begin{letter}{ To-Address }
\renewcommand{\today}{ February 16, 2009 }
\opening{ Opening }
Content of the letter.
\closing{ Yours truly, }
\end{letter}
\end{document}

© Stack Overflow or respective owner

Related posts about latex

Related posts about header