%
% LaTeX report style for ICSI tech reports
%
% A. Stolcke <stolcke@icsi.berkeley.edu>, 3/31/90
% - fixed footnoterule, icsihead with doubleside, 1/9/91
% - changed footnote numbering to symbolic for \thanks, 5/15/91
% - added comment about twoside, introduced \abstractname,
%   fixed page numbering for front matter,
%   ommits TR number if not defined (but still gives warning), 6/28/91
% - text dimensions adjusted for readability, 6/28/91
% - let long abstracts spill properly onto next page, 12/4/91
% - cosmetics on missing \tr warning message, 12/30/91
% - center Abstract header properly using \noindent, 4/13/92
% 
\typeout{Document Style `icsitr' <13 Apr 92>.}
%
% HOW TO USE THIS STYLE
%
% `icsitr' can be used with the standard LaTeX style `report' and `article'
% to produces a title page that fits the window in the cover of ICSI's
% tech reports.
% 
% Optionally, it also displays the ICSI letterhead and logo on the title page,
% to produce copies that can be distributed without a cover.
%
% `icsitr' SHOULD also be used with the `twoside' option since TRs are printed
% two-sided.
%
% The only change required to a standard LaTeX document is adding the style
% option `icsitr' and declaring the TR number with the \tr{...} command.
% The ICSI logo is printed by putting a \thispagestyle{icsihead} right after
% the \maketitle command.
%
% NOTE: It is recommended that you put icsitr first in the list of style
% options. In particular, the new LaTeX (nlatex) seems to give trouble if
% icsitr is preceeded by a point size option (e.g., 12pt).
%
% The current month and year are automatically included in the title.
% To override this use LaTeX's \date declaration.
%
% Titlepage footnotes can be generated using LaTeX's \thanks mechanism.
%
% \author should include only authors' names.  Additional affiliations can be
% given in a \thanks annotation.
%
% Your paper must include an abstract (using the standard LaTeX `abstract'
% environment).
%
% icsitr uses 1 inch margins all around, which fits more text on a page than
% the LaTeX default margins.  Of course you may redefine your own layout
% dimensions in the usual way.  This will possibly affect the layout of the
% abstract on the title page, but it shouldn't change the way things are
% typeset inside the cover window.
%
% One more thing: Short abstracts will appear on the titlepage, centered in
% the space underneath the title.  Long abstract will start there and spill
% over to the following page(s), which will be numbered with small roman
% numerals. To force the abstract to start on page ii, put a \pagebreak
% right before the \begin{abstract}.
%
% Enjoy!
%
%
% SAMPLE INPUT
%
%	\documentstyle[icsitr,twoside,11pt]{article}
%
%	\begin{document}
%
%	\title{How to write an ICSI technical report}
%	\author{Ai C. Ess-Ai\thanks{This work wouldn't have been possible
%		without the coffee and cookies generously served during ICSI's
%		Tuesday and Thursday tea time breaks!}
%
%	\tr{90-000}
%
%	\maketitle
%
%	\thispagestyle{icsihead}	% leave this out if no ICSI logo wanted
%
%	\begin{abstract}
%	The title says it all, doesn't it?
%	\end{abstract}
%
%	Body of report ...
%
%	\end{document}
%

% cover window
\newlength{\windowwid}
\windowwid 4.125truein		% window is 4 1/8in wide
\newlength{\windowht}
\windowht 2.625truein		% ... and 2 5/8in high
\newlength{\windowtop}
\windowtop 1.375truein		% window starts 2 3/8in from top
\newlength{\windowmargin}
\windowmargin 1.125truein	% ... and 2 1/8in from left paper edge

% horizontal dimensions
\textwidth 6.0truein
\oddsidemargin 0.25truein
\evensidemargin 0.25truein
\columnsep 0.3truein

% paragraphs
%\parindent 0truept
%\parskip 3pt plus .3pt

% vertical dimensions
\topmargin 0.0truein
\headheight 12truept
\headsep 0.25truein
\advance\headsep -\headheight
\textheight 8.5truein

% from icsiletter.sty
%
% NOTE: ICSI letterhead is intended primarily as an identification on
% reports distributed electronically and to be printed at other sites.
% Hence don't make use of PostScript fonts to ensure compatibility with local
% dvi printing software. Use standard TeX Sans-Serif fonts instead.
% A. Stolcke, 4/22/90
%% Helvetica Narrow and Palatino for letterhead
%\font\smallheadfont=Palatino-Roman at 9.5truept
%\font\largeheadfont=Helvetica-Narrow at 15.5truept
%% use these if your PostScript printer knows only the basic PS fonts
%\font\smallheadfont=Times-Roman at 9.5truept
%\font\largeheadfont=Helvetica at 15.5truept
%% use these if you don't have PostScript fonts
\font\smallheadfont=cmss9
\font\largeheadfont=cmss17
%% ICSI logo (METAFONT source due to Mark Fanty)
\font\logofont=icsi scaled 7500
\newdimen\logoindentation \logoindentation=5.625truein % 5 5/8in
\newdimen\letterheadwidth \letterheadwidth=6.5truein

\def\icsiphone{(510) 643-9153}
\def\icsifax{(510) 643-7684}

\def\icsiletterhead{%
\parbox[t]{\letterheadwidth}{%
  \baselineskip 0pt % control all \vskips by hand
  \vskip -\topmargin % taking \topmargin int account
  \vskip -13truept      % start 15/16in below top of sheet
  \hrule width \logoindentation \hfill
  \vskip 18truept
  \raisebox{0pt}[0pt][0pt]{\largeheadfont
      INTERNATIONAL COMPUTER SCIENCE INSTITUTE \hfill}
  \raisebox{-25pt}[0pt][0pt]{\hskip \logoindentation {\logofont I} \hfill}
  \vskip 5truept
  \hrule width \logoindentation \hfill
  \vskip 17truept
  \raisebox{0pt}[0pt][0pt]{\smallheadfont
        1947~Center St.\ $\bullet$ Suite~600 $\bullet$
        Berkeley,~California~94704-1198 $\bullet$
	\icsiphone\ $\bullet$ FAX \icsifax \hfill}}}

% IMPORTANT:
%
% use \thispagestyle{icsihead} after \maketitle to put ICSI logo on first page
%
\def\ps@icsihead{\typeout{Inserting ICSI letterhead.}%
\def\@oddfoot{}\def\@oddhead{\hskip -\oddsidemargin\hbox{\parindent 0pt\vbox to 0pt{\icsiletterhead\vss}}\hfil\hbox{}}
    \let\@evenhead\@oddhead \let\@evenfoot\@oddfoot}

% omit day from date
\def\today{\ifcase\month\or
   January\or February\or March\or April\or May\or June\or
   July\or August\or September\or October\or November\or December\fi
   \space\number\year}

% TR number declaration
\def\tr#1{\def\trnumber{#1}}

% change footnote counter to use symbols for titlepage
\def\thefootnote{\fnsymbol{footnote}}

% titlepage modified to fit cover window
\def\maketitle{\titlepage
      % fix titlepage fonts at sizes  corresponding to 10pt style
      \def\@normalsize{\@setsize\normalsize{12pt}\xpt\@xpt}
      \def\small{\@setsize\small{11pt}\ixpt\@ixpt}
      \def\scriptsize{\@setsize\scriptsize{8pt}\viipt\@viipt}
      \def\tiny{\@setsize\tiny{6pt}\vpt\@vpt}
      \def\LARGE{\@setsize\LARGE{22pt}\xviipt\@xviipt}
      \def\Large{\@setsize\Large{18pt}\xivpt\@xivpt}
      \def\large{\@setsize\large{14pt}\xiipt\@xiipt}
      % this code is mostly from titlepage.sty
      % leave footnote rule 'cause we can't reset it later
      %\let\footnotesize\small \let\footnoterule\relax
      \setcounter{page}{1}
      \pagenumbering{roman}
      \null
      \vskip \windowtop
      \vskip -\topmargin
      \vskip -\headheight
      \vskip -\headsep
      \noindent\hskip -\oddsidemargin \hskip \windowmargin
%       \fbox{\parbox{\windowwid}{\centering % for debugging
        \parbox{\windowwid}{\centering 
          \vbox to \windowht{\vfil
	    \vfil\vfil
            \LARGE\bf \@title \par
	    \vfil
	    \vfil {\large \lineskip .75em
            \begin{tabular}[t]{c}\@author
            \end{tabular}\par}
            \ifx\trnumber\undefined
		\typeout{ }
		\typeout{*** ICSITR Warning: You forgot to specify a TR number!}
		\typeout{*** Contact ICSI staff to obtain a TR number and }
		\typeout{*** specify as \protect\tr{number} before \protect\maketitle.}
	    \else
		\vfil {\large TR-\trnumber \par}
	    \fi
            \vfil {\large \@date \par}
            \vfil\vfil}}\\
%           \vfil\vfil}}}\\				       % for debugging
      \@thanks
   \vfil
   \setcounter{footnote}{0} \let\thanks\relax
   \gdef\@thanks{}\gdef\@author{}\gdef\@title{}\let\maketitle\relax
   \def\thefootnote{\arabic{footnote}}}

% define the `Abstract' string here in case it isn't already defined by some
% language style option.
\ifx\undefined\abstractname
   \def\abstractname{Abstract}\fi

\def\abstract{
   \vfil
   \large % set abstract in 12pt
   \par\noindent
   \hfil{\bf \abstractname}\hfil
   \par\noindent}

\def\endabstract{\par
   \vfil
   \null
   \endtitlepage
   \cleardoublepage
   \setcounter{page}{1}
   \pagenumbering{arabic}}

% compatibility with cogsci bibstyle
\let\shortcite\cite

