% Class file for Reports in Informatics.
% Author: Kenth Engø, Dept. of Informatics, UiB, Norway.
% 08. april 2008 - Added usepackage and remove line 8-14
% 10. october 2010 - Removed mailing address since we no longer offer hardcopies
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{IIreport}[2010/10/11 Reports in Informatics, UiB. Ver. 1.2]
\LoadClass{article} % IIreport.cls is based on article.cls.
\RequirePackage{ifpdf}

%\newif\ifpdf
%\ifx\pdfoutput\undefined
%   \pdffalse
%\else
%   \pdfoutput=1
%   \pdftrue
%\fi

\RequirePackage{a4}
\RequirePackage[english]{babel}

\ifpdf
  \RequirePackage{times}
  \RequirePackage[pdftex]{graphicx}
  \RequirePackage[pdftex=true,backref]{hyperref}
  \pdfcompresslevel=9
\else
  \RequirePackage{graphicx,url}
\fi

\newcommand{\iireport}[5]{%
  \setcounter{page}{-1}  % Forsiden er side -1.
  %% #1: title
  %% #2: authors
  %% #3: nr
  %% #4: month
  %% #5: year
  \thispagestyle{empty}%
  \setlength{\voffset}{-37pt}%
  \begin{center}%
    \begin{minipage}[t][4.1cm]{10.5cm}
      \begin{center}
        \textbf{\huge REPORTS} \\*[0.75em]%
        \textbf{\huge IN} \\*[0.75em]%
        \textbf{\huge INFORMATICS}
      \end{center}
    \end{minipage}
    \begin{minipage}[t][7.1cm]{10.5cm}
      \begin{center}
        \hfill\textbf{\Large ISSN 0333-3590} \\
        \vspace*{\fill}
        \textbf{\Large #1} \\
        \vspace*{\fill}
        \textbf{\Large #2} \\
        \vspace*{\fill}
        \textbf{\Large REPORT NO #3\hfill #4 #5}
      \end{center}
    \end{minipage}
  \end{center}
  \vspace*{2.25cm}
  \begin{center}
    \leavevmode
    \includegraphics[width=2.2cm]{UIBlogo}
  \end{center}
  \vspace*{\fill}
  \begin{center}
    \textit{\huge Department of Informatics} \\*[1.25em]
    \textbf{\huge UNIVERSITY OF BERGEN} \\*[1.25em]
    \textit{\huge Bergen, Norway} 
  \end{center}

  \newpage   % Baksiden av forsiden
  \thispagestyle{empty}%
  \mbox{}
  \vspace*{\fill}
  {\small
  \begin{center}
    This report has URL 
    \ifpdf 
      \url{http://www.ii.uib.no/publikasjoner/texrap/pdf/#5-#3.pdf}\\*[1em]
    \else
      \url{http://www.ii.uib.no/publikasjoner/texrap/ps/#5-#3.ps}\\*[1em]
    \fi
    Reports in Informatics from Department of Informatics, University
    of Bergen, Norway, is available at
    \url{http://www.ii.uib.no/publikasjoner/texrap/}.\\*[1em]
  \end{center}}

  \newpage    % Rapporten begynner på side '3'
  \setlength{\voffset}{0pt}
  \setcounter{page}{1} % Dvs. den starter på side 1.
}
