\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{imfnumpreprint}[2005/11/01 Preprint in numerics, IMF, NTNU]


\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
\DeclareOption{twoclumn}{\OptionNotUsed}
\newif\ifgeometry\geometrytrue
\DeclareOption{nogeometry}{\geometryfalse}

\ProcessOptions
\LoadClass{scrartcl}

\RequirePackage{graphicx}
\RequirePackage[T1]{fontenc}
\RequirePackage{amssymb}
\RequirePackage{amsmath}
\RequirePackage{amsfonts}
\RequirePackage{fancyhdr}
\ifgeometry
  \RequirePackage[margin=3cm]{geometry}
\fi

% Variabler:
\def\thepreprintyear{XXXX}
\def\thepreprintnumber{X}

\newcommand{\preprintyear}[1]{\def\thepreprintyear{#1}}
\newcommand{\preprintnumber}[1]{\def\thepreprintnumber{#1}}

\AtBeginDocument{%
\thispagestyle{empty}
\begin{center}
    \LARGE\textsc{norges teknisk-naturvitenskapelige universitet}
\end{center}
\vfill 
\begin{center}
    {\LARGE\textbf{\textsf{\@title}}}
\end{center}
\begin{center}
    {\Large by}
\end{center}
\begin{center}
    {\Large\textrm{\@author}}
\end{center}
\vfill
\begin{center}
    \LARGE
        \textsc{preprint} \\
        \textsc{numerics no.~\thepreprintnumber/\thepreprintyear}
\end{center}
\vfill
\begin{center}
    \leavevmode
    \includegraphics[width=3cm]{ntnulogograa}
\end{center}
\vfill
\begin{center}
    \LARGE
    \textsc{norwegian university of} \\
    \textsc{science and technology} \\
    \textsc{trondheim, norway}
\end{center}
\vfill
\begin{center}
    \normalsize
    This report has URL \texttt{http://www.math.ntnu.no/preprint/numerics/\thepreprintyear/N\thepreprintnumber-\thepreprintyear.pdf}\\
    Address: Department of Mathematical Sciences, Norwegian University
    of Science and Technology, N-7491 Trondheim, Norway.
\end{center}
%%
\cleardoublepage
\pagenumbering{arabic} % Start å telle sider på nytt.
\maketitle

%\pagestyle{fancy}
%
%\fancyhead{}
%\fancyfoot{} % Clear all first
%\renewcommand{\headrulewidth}{0pt}
%\renewcommand{\footrulewidth}{0.4pt}
%\fancyfoot[RO]{\footnotesize \slshape \thepage}
%\fancyfoot[RE]{}
%\fancyfoot[LE]{\footnotesize \slshape \thepage}
%\fancyfoot[LO]{\footnotesize \slshape Preprint Numerics, NTNU, Norway}

}% end of \AtBeginDocument.


\AtEndDocument{\label{Slutt}}
