2

I am having a hard time to position and align with logo a footer for a letter. attached is the type of footer i d like possibly with a ruler before. 1 I am using a template with a class file.

%
% brownletter.cls -- a document class for writing letters with Brown letterhead 
%
% Copyright 2003, Nesime Tatbul ([email protected])
%
% Notes:
%
% 1. This class can be used for creating letters with Brown logo at the
%    header and CS department address at the footer (as in standard Brown
%    letterhead stationery).
% 2. It is based on the standard Latex document class, letter.cls.
% 3. Required packages are epsfig and ifthen.
% 4. If Brown logo is to be included in the head, then the file
%    brownlogo.eps must be provided. Otherwise, the logo is omitted.
% 5. For example usage, please see brownletter_example.tex
% 
% Please contact [email protected] to report any problems or bugs.
%

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{brownletter}
\RequirePackage{graphicx}
\RequirePackage{epstopdf}
\RequirePackage{epsfig}
\RequirePackage{ifthen}
\DeclareGraphicsExtensions{.png}

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{letter}}
\ProcessOptions
\LoadClass[letterpaper]{letter} % we always use letter paper

\newcommand{\subjectname}{Subject}
\newcommand{\@subject}{}
\newcommand{\subject}[1]{\renewcommand{\@subject}{\subjectname: #1}}

\newboolean{logofound}
\IfFileExists{logo.png}
    {\setboolean{logofound}{true}}
    {\setboolean{logofound}{false}}

\setlength{\textwidth}{6.875in}
\setlength{\textheight}{7.0in}
\setlength{\topskip}{0.0in}
\setlength{\footskip}{1.0in}
\setlength{\oddsidemargin}{-0.25in}
\setlength{\evensidemargin}{-0.25in}
\setlength{\topmargin}{-0.875in}

\DeclareFixedFont{\xcmrbn}{OT1}{cmr}{b}{n}{10}
\DeclareFixedFont{\xcmrmn}{OT1}{cmr}{m}{n}{10}
\DeclareFixedFont{\ixcmrmn}{OT1}{cmr}{m}{n}{10}

\newsavebox{\departmenthead}
\newsavebox{\departmentfoot}
\newsavebox{\emptyfoot}

\sbox{\departmenthead}{
    \begin{tabular*}{\textwidth}
                    {@{}l@{\extracolsep{0.0in}}|@{\extracolsep{0.125in}}l@{}}
    \parbox{4.625in}{\raggedright
        \ifthenelse{\boolean{logofound}}
           {\epsfig{file=logo.png, height=1.75in, width=2in}}
           {\parbox[t][1.2in][t]{2.0in}{\hfill} 
            \ClassWarning{brownletter}{logo.png COULD NOT BE FOUND!}}
    } &
    \parbox[t][1.0in]{2.125in}{{\xcmrbn Department of Engineering}\\
                               {\ixcmrmn http://www.xxx.fr}}\\
    \end{tabular*}
}


\savebox{\departmentfoot}[\textwidth][t]{\ixcmrmn 
    Dr xxxx xxxxxx
    Associate Professor in xx xx - University xx and xx xxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    Telxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    email: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    [email protected]
}


% header and footer should be placed only on the first page
\renewcommand{\ps@firstpage}{

    \setlength{\headheight}{1.375in}
    \setlength{\headsep}{1.0in}
    \renewcommand{\@oddhead}{\usebox{\departmenthead}}
    \renewcommand{\@oddfoot}{\usebox{\departmentfoot}}
    \renewcommand{\@evenhead}{}
    \renewcommand{\@evenfoot}{}
}

\renewcommand{\ps@empty}{
    \setlength{\headheight}{1.375in}
    \setlength{\headsep}{0.5in}
    \renewcommand{\@oddhead}{}
    \renewcommand{\@oddfoot}{\usebox{\emptyfoot}}
    \renewcommand{\@evenhead}{}
    \renewcommand{\@evenfoot}{\usebox{\emptyfoot}}
}

\providecommand{\@evenhead}{}
\providecommand{\@oddhead}{}
\providecommand{\@evenfoot}{}
\providecommand{\@oddfoot}{}

\pagestyle{empty}

% we add the subject command to the opening
\renewcommand{\opening}[1]{\thispagestyle{firstpage}%
    \ifx\@empty\fromaddress
        {\raggedleft\@date\par}%
    \else  % home address
        {\raggedleft
            \begin{tabular}{l@{}}\ignorespaces
            \fromaddress \\ *[1\parskip]%
            \@date 
            \end{tabular}\par
        }%
     \fi
     \vspace{1\parskip}%
     {\raggedright \toname \\ \toaddress \par}%
     \vspace{1\parskip}%
     \ifthenelse{\equal{\@subject}{}}{}{\@subject\par}
     \vspace{1\parskip}%
     #1\par\nobreak
}

% we push closing to the right
\renewcommand{\closing}[1]{\par\nobreak\vspace{\parskip}%
    \stopbreaks
    \noindent
    \hspace*{0.6\textwidth}\parbox{0.4\textwidth}{\raggedright
    \ignorespaces #1\\[4\medskipamount]%
    \ifx\@empty\fromsig
        \fromname
    \else \fromsig 
    \fi\strut}%
    \par
}` 

it is working but i d like to add the footer i show in the image. here is the main code using the class file above.

%
% brownletter_example.tex - an example latex file to illustrate brownletter.cls
%
% Copyright 2003, Nesime Tatbul ([email protected])
%

\documentclass[11pt]{brownletter}

% Paquets généraux
\usepackage[utf8]{inputenc}     % Codage du fichier TeX
\usepackage[T1]{fontenc}        % Codage du fichier PDF (les paquets cm-super ou lmodern doivent être installés pour obtenir un bon résultat)
\usepackage{graphicx}           % Logos et autres illustrations
\usepackage{fancyhdr}           % En-têtes et pieds de page
\usepackage{color}              % Couleur
\usepackage{ifthen}             % Condition
\usepackage{helvet}             % Police Helvetica
%\usepackage[french]{babel}      % Courrier en français
\usepackage[english]{babel}   % Courrier en anglais


\name{xxxxx xxxx} % used as signature, if no signature is specified

\signature{xxx xxx, PhD}

\date{June 30, 2016} % if no date specified, today's date is used 

\subject{xxx xxxx} % optional subject line




\begin{document}

\begin{letter}{Prof. Eli Upfal\\ 
               Brown University\\ 
               Box 1910\\ 
               Providence, RI 02912}

\opening{Dear Sir,}

We are most pleased to deliver this sample letter which uses
the Latex letter document class file with Brown letterhead.
We are most pleased to deliver this sample letter which uses
the Latex letter document class file with Brown letterhead.
We are most pleased to deliver this sample letter which uses
the Latex letter document class file with Brown letterhead.
We are most pleased to deliver this sample letter which uses
the Latex letter document class file with Brown letterhead.

We are most pleased to deliver this sample letter which uses
the Latex letter document class file with Brown letterhead.
We are most pleased to deliver this sample letter which uses
the Latex letter document class file with Brown letterhead.
We are most pleased to deliver this sample letter which uses
the Latex letter document class file with Brown letterhead.
We are most pleased to deliver this sample letter which uses
the Latex letter document class file with Brown letterhead.
We are most pleased to deliver this sample letter which uses
the Latex letter document class file with Brown letterhead.
We are most pleased to deliver this sample letter which uses
the Latex letter document class file with Brown letterhead.



\closing{Sincerely,}

%\encl{brownletter.cls}

%\ps{Please see the enclosed file.}

%\cc{J. Kirschenbaum}

\end{letter}

\end{document}

so the idea is to add at the bottom of the letter all my contact details and my logo properly aligned as in the image. to date i get a long line and cannot design a proper box. Thanks

0

1 Answer 1

8

You are trying to use the Brown University Computer Science letterhead. Let's first see what that looks like, by compiling the example .tex file (which uses the original brownletter class and logo):

enter image description here

Since the class is specific to Brown University and therefore have a number of the letter elements hard-coded in the class file (making it difficult to circumvent with your own content other than editing the .cls directly), let's recreate the rough layout using article and add your footer:

enter image description here

\documentclass[11pt]{article}

\usepackage{geometry,tabularx,fancyhdr}
\usepackage[export]{adjustbox}
\geometry{
  paper = letterpaper,
  margin = 0.7in,
  includefoot,
  footskip = 41pt
}

\setlength{\parindent}{0pt}% Remove paragraph indentation
\setlength{\parskip}{0.7\baselineskip plus .1\baselineskip minus .1\baselineskip}

\fancypagestyle{firstpage}{
  \fancyhf{}% Clear header/footer
  \renewcommand{\headrulewidth}{0pt}% Remove header rule
  \renewcommand{\footrulewidth}{.4pt}% Insert footer rule
  \fancyfoot[L]{%
    \resizebox{!}{3\baselineskip}{\begin{tabular}[b]{@{} l @{}}
      Dr xxxx \textbf{xxxxxx} \\
      Associate Professor in xx xx - University xx and xx xxxxx \\
      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \\
      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \\
      Tel: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \\
      email: [email protected]
    \end{tabular}}%
  }
  \fancyfoot[R]{%
  \includegraphics[height=3\baselineskip]{example-image-9x16}%
  }
}

\pagestyle{plain}

\begin{document}

\thispagestyle{firstpage}

% First page letterhead
\begin{tabularx}{\textwidth}{ @{} X | @{\hspace{0.125in}} p{2.5in} @{} }
  \smash{\includegraphics[height=1in, width=2in, valign=T]{brownlogo}} & \\[2\normalbaselineskip]
    & \small\bfseries Department of Computer Science \\
    & \footnotesize http://www.cs.brown.edu/
    \\[.7in]
\end{tabularx}%

\vspace{2\bigskipamount}

\hfill
December 15, 2003

\bigskip
\begin{tabular}{@{} l @{}}
  Prof.\ Eli Upfal \\
  Brown University \\
  Box 1910 \\
  Providence, RI 02912
\end{tabular}

\medskip

Subject: Brown letterhead

\medskip

Dear Sir,

We are most pleased to deliver this sample letter which uses
the LaTeX letter document class file with Brown letterhead.
We are most pleased to deliver this sample letter which uses
the LaTeX letter document class file with Brown letterhead.
We are most pleased to deliver this sample letter which uses
the LaTeX letter document class file with Brown letterhead.
We are most pleased to deliver this sample letter which uses
the LaTeX letter document class file with Brown letterhead.

We are most pleased to deliver this sample letter which uses
the LaTeX letter document class file with Brown letterhead.
We are most pleased to deliver this sample letter which uses
the LaTeX letter document class file with Brown letterhead.
We are most pleased to deliver this sample letter which uses
the LaTeX letter document class file with Brown letterhead.
We are most pleased to deliver this sample letter which uses
the LaTeX letter document class file with Brown letterhead.
We are most pleased to deliver this sample letter which uses
the LaTeX letter document class file with Brown letterhead.
We are most pleased to deliver this sample letter which uses
the LaTeX letter document class file with Brown letterhead.

\medskip

\hfill
\begin{tabular}{@{} p{.4\linewidth} @{}}
  Sincerely, \\[4\medskipamount]
  Random Randofsky \\
  Randomiser
\end{tabular}

\medskip

encl: \texttt{brownletter.cls}

\medskip

Please see the enclosed file.

\medskip

cc: R.\ Randofsky II

\end{document}

Currently the footer is set the first page only. However, the layout may be affected for the entire document as a result. My suggestion would be to set the same footer, almost like a letterhead, across the entire letter (if you have more than one page).

2
  • Dear Werner, thanks indeed if the text is longer it touches the bottom ruler and the footer signature in only in the first page as well as the header. any help on that? two more cosmetic remark if possible how can i change the fontsize of the footer text and the color. Regards
    – MKS
    Commented Jul 1, 2016 at 11:04
  • i solved the cosmetics, just need to reproduce as an option the header and footer for longer documents in all pages
    – MKS
    Commented Jul 1, 2016 at 11:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .