%%
%% Package: `cstechrep-covers.sty'
%%
%% Cover page for LFCS and CSG tech. reports
%%
%% Based upon code written by David Aspinall <da@dcs.ed.ac.uk> (Mar 1995)
%% Modified for cstechrep.cls, Martin Reddy <mxr@dcs.ed.ac.uk> (May 1996)
%%
%% EXPORTS:
%%
%%   \lfcscoverpage
%%   \csgcoverpage
%%
%% OPTIONS:
%%
%%   times, cm    -- Font families used for titles
%%
%% To do:
%%   -- set fixed page size, save body's page size (how?)
%%

%%
%% Identification
%%

\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{cstechrep-covers}[1996/05/20 LFCS and CSG report coverpages]

%%
%% Options
%%

\DeclareOption{times}{\def\cp@fontfamily{ptm}} %% font family used for 
\DeclareOption{cm}{\def\cp@fontfamily{cmr}}    %% titles

\ExecuteOptions{times}
\ProcessOptions

\RequirePackage{graphics}  % For the CSG coverpage.

%%
%% Set fonts
%%

\DeclareFixedFont{\cp@BigGroupNameFont}%
  {\encodingdefault}{\cp@fontfamily}{b}{n}{22pt}

\DeclareFixedFont{\cp@MidGroupNameFont}%
  {\encodingdefault}{\cp@fontfamily}{b}{n}{14pt}

\DeclareFixedFont{\cp@GroupNameFont}%
  {\encodingdefault}{\cp@fontfamily}{b}{n}{12pt}

\DeclareFixedFont{\cp@DeptAddressFont}%
  {\encodingdefault}{\cp@fontfamily}{m}{n}{11pt}

\DeclareFixedFont{\cp@NumberFont}%
  {\encodingdefault}{\cp@fontfamily}{b}{n}{12pt}

\DeclareFixedFont{\cp@DeptHeadingFont}%
  {\encodingdefault}{\cp@fontfamily}{m}{n}{10pt}

\DeclareFixedFont{\cp@TitleFont}%
  {\encodingdefault}{\cp@fontfamily}{b}{n}{14pt}

\DeclareFixedFont{\cp@AuthorFont}%
  {\encodingdefault}{\cp@fontfamily}{m}{n}{14pt}

\DeclareFixedFont{\cp@CopyrightFont}%
  {\encodingdefault}{\cp@fontfamily}{m}{n}{10pt}

%%
%% A couple of useful little commands that we are going to use
%%

\providecommand{\cprule}{\vspace*{-3pt}\\\rule{\linewidth}{1mm}\vspace*{-3pt}}

\providecommand{\cp@monthyear}{%
  \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}

%% Declare shortyear as the number of years from the start of this century.
%% I.e. for 1996, this will return 96. N.B. This will break at the turn
%% of the new millennium - so you want to change this bit in the year 2000.

\newcounter{shortyear}
\setcounter{shortyear}{\year}\addtocounter{shortyear}{-1900}

%%
%% \lfcscoverpage & \csgcoverpage make the generic coverpages. Uses
%% \@coverauthor, \@covertitle & \@reportnumber macros (set by cstechrep.cls)
%% (Really ought to temporarily set page size to ensure standard. - da)
%%

\newcommand{\lfcscoverpage}{%
 \begin{titlepage}%
   \baselineskip 12pt%
   \cp@BigGroupNameFont\noindent\cp@lfcsgroupacronym\hfill\cprule
   \begin{flushright}
     \cp@MidGroupNameFont\cp@lfcsgroupname\\
     \cp@DeptHeadingFont\cp@deptname
   \end{flushright}
   \vspace*{\stretch{1}}
   \begin{centering}
     \begin{minipage}{0.8\textwidth}
       \begin{centering}
       \cp@TitleFont\@covertitle\\[2ex]
       \cp@AuthorFont%
       by\\[2ex]
       \begin{tabular}[t]{c}%
         \ignorespaces\@coverauthor
       \end{tabular}\\
       \end{centering}
     \end{minipage}\\
   \end{centering}\vspace*{0.5in}
    \vspace*{\stretch{1}}
   \cp@GroupNameFont\cp@lfcsgroupacronym\ Report Series \hfill %
      \cp@NumberFont%
      \ifx\@reportnumber\relax
         ECS--\cp@lfcsgroupacronym--\arabic{shortyear}--??%
      \else
         \@reportnumber%
      \fi\vspace*{-0.6ex}%
   \cprule\vspace*{0.4ex}\\
   \cp@GroupNameFont\cp@lfcsgroupacronym\ \hfill 
      \cp@NumberFont\cp@monthyear\\
   \ignorespaces\cp@DeptAddressFont\cp@deptaddress\\
   \hspace*{1ex}\hfill\cp@CopyrightFont\cp@lfcscopyrightmessage
 \end{titlepage}}

%%
%% The bit which inserts a University crest - ripped from euletr.cls
%%
 
\def\@dvips{dvips.def}
\def\@oztex{oztex.def}
\ifx\Gin@driver\@dvips
        %%% Do the PS image stuff for the DVIPS driver
        \newcommand{\@eushield}{%
          \scalebox{0.2332}{\includegraphics{eushield.ps}}
        }%
\else
\ifx\Gin@driver\@oztex
        %%% Do the PS image stuff for OzTeX (seems to make things bigger!?)
        \newcommand{\@eushield}{%
           \includegraphics[30mm,30mm]{eushield.ps}
        }%
\fi
\fi

\newcommand{\csgcoverpage}{%
 \begin{titlepage}%
   \baselineskip 12pt%
   \vspace*{-50pt}
   \begin{minipage}[b]{4.31in}%
   \cp@BigGroupNameFont\noindent\cp@csggroupname\hfill%
   \vspace*{0.4ex}\cprule\vspace*{1.5ex}
   \end{minipage}
   \begin{minipage}[b]{1.78in}
   \@eushield
%   \epsfig{file=eushield.ps,width=1.5in}
   \end{minipage}
   \begin{flushright}\end{flushright}
   \vspace*{\stretch{1}}
   \begin{centering}
     \begin{minipage}{0.8\textwidth}
       \begin{centering}
       \cp@TitleFont\@covertitle\\[3ex]
       \cp@AuthorFont%
       by\\[3ex]
       \begin{tabular}[t]{c}%
         \ignorespaces\@coverauthor
       \end{tabular}\\
       \end{centering}
     \end{minipage}\\
   \end{centering}\vspace*{1.0in}
   \vspace*{\stretch{1}}
   \cp@GroupNameFont\cp@csggroupacronym\ Report Series \hfill %
      \cp@NumberFont%
      \ifx\@reportnumber\relax
         ECS--\cp@csggroupacronym--??--\arabic{shortyear}%
      \else
         \@reportnumber%
      \fi\vspace*{-0.6ex}%
   \cprule\vspace*{0.4ex}\\
   \cp@GroupNameFont\cp@csggroupname\ \hfill 
      \cp@NumberFont\cp@monthyear\vspace*{0.5ex}\\
   \ignorespaces\cp@DeptAddressFont\cp@deptaddress\\
   \hspace*{1ex}\hfill\cp@CopyrightFont\cp@csgcopyrightmessage
 \end{titlepage}}

%%
%% Department and LFCS/CSG specifics
%%

\providecommand{\cp@deptname}
  {Department of Computer Science --- The University of Edinburgh}

\providecommand{\cp@deptaddress}
  {Department of Computer Science\\%
   University of Edinburgh\\%
   The King's Buildings\\%
   Edinburgh\hspace{1em}%
   EH9 3JZ}

\newcommand{\cp@lfcsgroupname}
  {Laboratory for Foundations of Computer Science}

\newcommand{\cp@lfcsgroupacronym}
  {LFCS}

\newcommand{\cp@lfcscopyrightmessage}
  {Copyright \copyright\ \number\year, \cp@lfcsgroupacronym}

\newcommand{\cp@csggroupname}
  {Computer Systems Group}

\newcommand{\cp@csggroupacronym}
  {CSG}

\newcommand{\cp@csgcopyrightmessage}
  {}
% {Copyright \copyright\ \number\year, \cp@csggroupacronym}

%%
%% EOF: cstechrep-covers.sty
%%
