At Thu, 17 Oct 2002 13:04:26 +1000, Terry Collins wrote:
> Can anyone share a clue stick on how to set up a letterhead under latex?

attached is the example i gave at the docfest earlier this year.

its all LaTeX, but it gets fairly complicated - i'd be happy to
explain any bits that want explaining.  the aim is to define the
"firstpage" pagestyle, which will get picked up by letter.cls
automatically.  i muck around with boxes, just so i can be tricky and
measure their height later on, setting the header and footer height
appropriately.

note that this example won't compile "out of the box", since the logo
image and fonts it uses most likely aren't available.

> My problem is that the logo and name are fine, but I can not get the
> addressee and company address boxes to line their text contents up on
> the top line.
> 
> I'm doing something like;

[...]

> \parbox {addressee}
> \hfill
> \parbox {company details} %but starts lower than addressee details.

\parboxes will align on their centres by default. to force them to
line their tops up, you want \parbox[t]{company details}.

-- 
 - Gus

%
% Switch Online letter head
%

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{switch}[2002/05/30 SwitchOnline Letter Head]


\RequirePackage{parskip}

\RequirePackage{url}
\urlstyle{sf}

% fonts
\newcommand*{\trebuchet}{\fontfamily{jtr}\selectfont}
\newcommand*{\arial}{\fontfamily{ma1}\selectfont}
\RequirePackage{arial}
\renewcommand*{\familydefault}{\sfdefault}

% colours
\RequirePackage{color}
%\definecolor{sworange}{cmyk}{0,.47,1,.09}
%\definecolor{swgreen}{cmyk}{1,0,.6,.51}
\definecolor{sworange}{rgb}{.8,.4,0}
\definecolor{swgreen}{rgb}{0,.2,0}

\RequirePackage{graphicx}

\newsavebox{\SW@lheadhead}
\sbox{\SW@lheadhead}{%
  % no, i don't understand most of this.
  % with \frame{} around the minipage, the \settoheight later on
  % worked. without it, it didn't. so i copied \frame{} and removed
  % the actual frame drawing parts and now it works..
  \leavevmode
  \hbox{%
    \hskip-\@wholewidth
    \vbox{%
      \vskip-\@wholewidth
      \hbox{%
        % this was the content i actually wanted
        \begin{minipage}{\paperwidth}%
          \centering\fontsize{9}{10pt}\color{sworange}\trebuchet%
          \includegraphics[width=1in]{switch_logo_vert_rgb}

          Superannuation \\
          made simple.
        \end{minipage}%
      }
      \vskip-\@wholewidth}%
    \hskip-\@wholewidth}}

\newsavebox{\SW@lheadfoot}
\sbox{\SW@lheadfoot}{\fontsize{8}{10pt}\arial
  \setlength{\arrayrulewidth}{3mm}%
  \setlength{\tabcolsep}{.5ex}%
  \begin{tabular}{ll}
    \textcolor{swgreen}{\vline} &
    \textcolor{swgreen}{\textbf{Switch Online} Pty Limited
      (ABN~89~092~286~327) is a Licensed Dealer in Securities
      (Licence Number~194~935)} \\
    \textcolor{swgreen}{\vline} &
    \textcolor{swgreen}{Level 2, 131 Clarence Street Sydney NSW
      2000} \\
    \textcolor{sworange}{\vline} &
    \textcolor{sworange}{\textbf{Telephone:~02~9299~1133}\quad
      Facsimile:~02~9299~1134\quad
      \url{www.switchonline.com.au}}
  \end{tabular}}

% letter.cls will use this definition if you don't provide \address
\def\ps@firstpage{%
  \renewcommand{\@oddhead}{%
    \newlength{\negoff}%
    \setlength{\negoff}{\oddsidemargin}%
    \addtolength{\negoff}{1in}%
    \hspace*{-\negoff}\usebox{\SW@lheadhead}}
  \renewcommand{\@evenhead}{%
    \newlength{\negoff}%
    \setlength{\negoff}{\evensidemargin}%
    \addtolength{\negoff}{1in}%
    \hspace*{-\negoff}\usebox{\SW@lheadhead}}
  \renewcommand*{\@oddfoot}{\usebox{\SW@lheadfoot}}
  \renewcommand*{\@evenfoot}{\@oddfoot}
}


\newlength{\SW@headheight}
\settoheight{\SW@headheight}{\usebox{\SW@lheadhead}}
\newlength{\SW@footheight}
\settoheight{\SW@footheight}{\usebox{\SW@lheadfoot}}
\addtolength{\SW@footheight}{.5in}

\RequirePackage{geometry}
\geometry{hmargin=1.25in,vmargin=8mm,head=\SW@headheight,foot=\SW@footheight}

Reply via email to