Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Is there is any possibility to put an image header in a letter class document? I can put a footer image and an image for my signature, but I want to put an image on the top of the letter.

share|improve this question
    
Welcome to TeX.sx! I took the liberty to rephrase your text a little bit. The way to was didn't sounded correct. I hope you don't mind. –  Martin Scharrer Jan 27 '12 at 13:41

2 Answers 2

up vote 9 down vote accepted

The letter class uses a page style called firstpage on the first page ...

\documentclass{letter}

\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{geometry}
\usepackage{lipsum}

\geometry{headheight = 0.6in}
\fancypagestyle{firstpage}{\fancyhf{}\fancyhead[R]{\includegraphics[height=0.5in, keepaspectratio=true]{logo.pdf}}}
\fancypagestyle{plain}{\fancyhf{}\fancyhead[L]{\includegraphics[height=0.5in, keepaspectratio=true]{logo.pdf}}}
\pagestyle{plain}
\begin{document}%
    \begin{letter}{}%
        \opening{Dear Some Name,}
        \lipsum[1-10]
    \end{letter}%
\end{document}%

It turns out the firstpage page style is only used if \address has not been used. If address has been used, then the first page style is empty and you need to add

\fancypagestyle{empty}{\fancyhf{}\fancyhead[R]{\includegraphics[height=0.5in, keepaspectratio=true]{logo.pdf}}}
share|improve this answer
1  
Why is the logo in the first page missing when I add the command \address{}? –  hpesoj626 Aug 26 '12 at 10:29
1  
@hpesoj626 see the edit, \address{} causes the page style of the first page to be empty. –  StrongBad Aug 28 '12 at 9:06
    
Okay, that works. Thanks a lot. –  hpesoj626 Aug 28 '12 at 9:31

This is an extract from an in-house class we got for typesetting letters. Simply you just include the image.

\documentclass{letter}
\usepackage{graphicx}
\makeatletter
\newif\if@xl@logo
\@xl@logofalse
\def\setlogo#1{\@xl@logotrue\gdef\xl@companylogo{#1}}
 \setlogo{HSlogo}

\def\printlogo{%
 \if@xl@logo
  \includegraphics[width=.98\textwidth]{./\xl@companylogo}\par%
 \fi
}

\AtBeginDocument{\printlogo}
\begin{document}

\end{document}

enter image description here

Adjust your paper size with geometry to suit.

share|improve this answer
1  
I don't think that this works with the letter class if you are using the letter environment for two reasons. The first is the letter environment will create a new page. The second is the first page in the letter class/letter environment is vertically centered. –  StrongBad May 14 '13 at 14:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.