%
% Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
%
% SPDX-License-Identifier: BSD-2-Clause
%

% disy.sty
%
% Document style for reports by the UNSW Distributed Systems and
% Operating Systems (DiSy) group.
%
% Uses Andrew O'Brien's fancy title page...
%
% Written 2000-08-12 by Gernot Heiser <gernot@unsw.edu.au>
%
% $Id: disy.sty,v 1.2 2009-02-04 03:13:15 ikuz Exp $

% OPTIONS:
%   color:      use colour logos
%   cmyk:       will generate cmyk colours rather than rgb colours
%               this may prove more reliable on some printers
%               but is inclined to look odd on monitors
%
% COMMANDS:
%   \AuthorEmail	Author's email address (default: disy@cse)

\ProvidesPackage{disy}
\RequirePackage{graphicx}
\RequirePackage{url}
\RequirePackage{color}

\DeclareOption{color}{\Colortrue}
\DeclareOption{colour}{\Colortrue}
\DeclareOption{cmyk}{\CMYKtrue}

\newif\ifColor	\Colorfalse

\ProcessOptions

\ifColor
  \ifCMYK
    %\definecolor{special_green}{cmyk}{1.0,0.0,0.69,0.43}
  \else
    %\definecolor{special_green}{rgb}{.020,.426,.328}
  \fi
\else
  %\definecolor{special_green}{cmyk}{0,0,0,1} % black
\fi
\newif\ifHave@HyperRef\Have@HyperReffalse

\AtBeginDocument{\@ifpackageloaded{hyperref}{\Have@HyperReftrue}{}}

\newcommand{\AuthorEmail}[1]{\def\AuthorEmailString{#1}}

\newcommand{\CrestFileName}{\ifColor unicrest-colour\else unicrest-screen\fi}
\AuthorEmail{disy@cse.unsw.edu.au}

\newlength{\centeroffset}
\setlength{\centeroffset}{-0.5\oddsidemargin}
\addtolength{\centeroffset}{0.5\evensidemargin}

\def\maketitle{
  % to suppress overfull bars in ``draft'' mode:
  \newlength{\saveOverfullRule}
  \setlength{\saveOverfullRule}{\overfullrule}
  \setlength\overfullrule{0pt}

  \thispagestyle{empty}
  \vspace*{\stretch{1}}
  \noindent\hspace*{\centeroffset}

  \begin{minipage}{\textwidth}\flushright%
    \urlstyle{sf}%
    \raisebox{34mm}[0pt][0pt]{%
      \newcommand{\LogoW}{21mm}%
      \newlength{\ERTOSw}%
      \settowidth{\ERTOSw}{{\sf\large https://sel4.systems}}%
      \noindent\sf%
      \begin{minipage}[b]{\textwidth}\sf\large%
      \hspace*{-10mm}%
      \end{minipage}%
      \hspace*{-4mm}%
    }%
    %
    \flushright
	{\Huge\bfseries
	  \@title\\}
	\vspace*{\stretch{2}}
	\noindent\rule[-1ex]{\textwidth}{5pt}\\[2.5ex]
		      {\Large \bfseries \@author}\\
              \urlstyle{sf}
              \ifHave@HyperRef
                \url{\AuthorEmailString}\\[2ex]
              \else
                \AuthorEmailString\\[2ex]
              \fi
		      {\sf \hfill{\Large \@date}}\\[2ex]
  \end{minipage}

  \vspace{\stretch{1}}
  \noindent\hspace*{\centeroffset}\begin{minipage}{\textwidth}
    \flushright

  \end{minipage}
  \vspace{\stretch{2}}

  \vfill

  \begin{minipage}{\textwidth}
    \flushright
	{\noindent\sf%
	}
  \end{minipage}

  \clearpage
  % reset overfull rule
  \setlength{\overfullrule}{\saveOverfullRule}
}%\maketitle
