% Style file for UTEP Research Reports
% Department of Mathematical Sciences
% The University of Texas at El Paso
% Created by Pavel Solin and Maria Barraza
% April 18, 2006
% Updated by Pavel Solin in October 2007

\topmargin=0mm
\textheight=200mm
\addtolength\footskip{5mm}
\oddsidemargin=0mm
\evensidemargin=0mm
\marginparwidth=20mm
\textwidth=165mm

\def\squareforqed{\hbox{\rlap{$\sqcap$}$\sqcup$}}
\def\qed{\ifmmode\else\unskip\quad\fi\squareforqed}
\def\smartqed{\def\qed{\ifmmode\squareforqed\else{\unskip\nobreak\hfil
\penalty50\hskip1em\null\nobreak\hfil\squareforqed
\parfillskip=0pt\finalhyphendemerits=0\endgraf}\fi}}

% Identification
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{mathrep}[2006/4/18 UTEP Research Reports]

% Options

\def\@innercovers{0}
\DeclareOption{innercovers}{\def\@innercovers{0}}
\DeclareOption{noinnercovers}{\def\@innercovers{1}}

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions

% Package loading

\LoadClass[twoside,12pt]{article}
\RequirePackage[T1]{fontenc}
\RequirePackage{psfig}
\RequirePackage{ae}
\RequirePackage{aecompl}

% foo stuff

\renewcommand\@pnumwidth{3em}
\renewcommand\@tocrmarg{4em}

\newcommand{\l@grp}{\@dottedtocline{0}{2em}{0em}}
\newcommand*\l@ggrp[2]{
    \addpenalty\@secpenalty
    \addvspace{1.0em \@plus\p@}%
    \setlength\@tempdima{1.5em}%
    \begingroup
      \parindent \z@ \rightskip \@pnumwidth
      \parfillskip -\@pnumwidth
      \leavevmode \bfseries
      \advance\leftskip\@tempdima
      \hskip -\leftskip
      #1\nobreak\hfil  \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
    \endgroup
}

% The new stuff

\newcommand\address[1]{\gdef\@address{#1}}
\newcommand\email[1]{\gdef\@email{#1}}
\renewcommand\thanks[1]{\gdef\@thanks{#1}}
\newcommand\subjclass[1]{\gdef\@subjclass{#1}}
\newcommand\keywords[1]{\gdef\@keywords{#1}}
\newcommand\department[1]{\gdef\@department{#1}}
\newcommand\repno[1]{\gdef\@repno{#1}}
\newcommand\printdata[1]{\gdef\@printdata{#1}}
\newcommand\seriesname[2]{\gdef\@seriesname{#1}\gdef\@seriesbname{#2}}
\newcommand\university[1]{\gdef\@university{#1}}
\newcommand\labaddress[1]{\gdef\@labaddress{#1}}
\newcommand\subtitle[1]{\gdef\@subtitle{#1}}
\newcommand\coverfigure[1]{\gdef\@coverfigure{#1}}
\newcommand\dissernote[1]{\gdef\@dissernote{#1}}
\newbox\@abstractbox
\renewenvironment{abstract}{\global\setbox\@abstractbox\vtop\bgroup
  \parindent=0pt\textbf{Abstract:} \textit\bgroup}{\egroup\hfill\egroup}

\newcommand\maketit[3]{{
  \renewcommand\and{\qquad}
  \newpage
  \topmargin=10mm
  \oddsidemargin=0mm
  \evensidemargin=0mm
  \textwidth=165mm
  \parindent=0pt\thispagestyle{empty}
%  \raisebox{16mm}[0mm][0mm]{\parbox[t][106mm]{165mm}{ % upperblock + title
  \raisebox{16mm}[0mm][0mm]{\parbox[t][90mm]{165mm}{ % upperblock + title
      \fontsize{12}{18pt}\usefont{OT1}{pbe}{l}{n}
      \@seriesname\\
      \fontsize{10}{18pt}\usefont{OT1}{pbe}{l}{n}
%
      \@seriesbname\\
      \fontsize{10}{18pt}\usefont{OT1}{pbe}{l}{n}
        El Paso, Texas \hfill Research Report No. {\@repno}
      \vfill
      \fontsize{20}{23pt}\usefont{OT1}{pbe}{b}{n}\selectfont{\@title}\\
      \fontsize{14}{23pt}\usefont{OT1}{pbe}{l}{n}\@subtitle 
  }}\\
  \raisebox{-103mm}[0mm][0mm]{%\parbox[t][70mm]{165mm}
      { % authors
      {\fontsize{12}{23pt}\usefont{OT1}{pbe}{b}{n}
        \@author}\\[0mm]
      {\fontsize{10}{15pt}\usefont{OT1}{pbe}{b}{n}{#3}}
 }}\\
 \raisebox{-120mm}[0mm][0mm]{\parbox[b][43mm]{165mm}{
        #2
 }}\\
 \raisebox{-185mm}[0mm][0mm]{\parbox[b][30mm]{165mm}{ 
      {\fontsize{10}{15pt}\usefont{OT1}{pbe}{l}{n}
       \parindent=0pt{#1}}
  }}\newpage
}}


\newcommand\makefrontcover{{
    \ifodd\@innercovers {
      \setcounter{page}{-1}\newpage
      \maketit{\hspace{-3mm}
        \IfFileExists{uteplogo}{\psfig{file=uteplogo,height=30mm}}{[UTEP logo missing - it will be placed here.]}
        }{\@coverfigure}{}
      \setcounter{page}{1}\newpage
    } 
    \else {
      \setcounter{page}{-1}\newpage
      \maketit{\hspace{-3mm}
        \IfFileExists{uteplogo.eps}{\psfig{file=uteplogo,height=30mm}}{[UTEP logo missing - it will be placed here.]}
        }{\@coverfigure}{}
      \thispagestyle{empty}
      \mbox{{}}%\vfill{\Large (inside of the front cover, not to be printed)}\\\vfill\vfill
      \maketit{\@university\\\@department}{}{\@dissernote}
      \setcounter{page}{2}\newpage
      } \fi
    {
      \renewcommand\and{\hbox{,}\ }
      \small\parindent=0pt\thispagestyle{empty}
      \textbf{\@author}:\\
      \textit{\@title}\\
      \par
      \box\@abstractbox
      \vspace{5mm}
      \textbf{AMS subject classification:} \@subjclass
      \par\vspace{5mm}
      \textbf{Keywords:} \@keywords
      \par\vfill
      \textbf{Correspondence}\\
        \@address \par \@email \par\vfill
      \par\vfill
      \textbf{Acknowledgment}\\
      \par
      \@thanks \par
      \par\vfill
      %\@printdata
      %\par\vspace{7mm}
      \@university\\\@department\\\@labaddress
      }
    \newpage\setcounter{page}{3}
%    \newpage
%    \ifodd\@innercovers {\thispagestyle{empty}\mbox{{ }}\newpage} \fi
     \setcounter{page}{1}
    }}
                                %
\newcommand\backcover{{
  \oddsidemargin=0mm
  \evensidemargin=0mm
    \InputIfFileExists{listofmathreports.tex}{
      \clearpage\thispagestyle{empty}
      \ifodd\@innercovers{
        \ifodd\c@page {} \else {\addtocounter{page}{1}}\fi 
        }
      \else{ % if innercovers, then set emptypages here. 
        \if@twoside{\ifodd\c@page {} \else
          \hbox{}\clearpage\thispagestyle{empty}\fi}\fi}
      \fi
      }{
      \def\mathreportsb{[list of recent reports should emerge here
        in the final  version]}
      \def\mathreportsa{[list of recent reports should emerge here
        in the final version.]}
      }
    \mathreportsa % defined in listofmathreports.tex
%    \cleardoublepage\thispagestyle{empty}      
%    \mbox{}\vfill{\Large (inside of the back cover, not to be printed)}\\\vfill\vfill
    \clearpage\thispagestyle{empty}\parindent=0pt
    \raisebox{-80mm}[0mm][0mm]{\parbox[t][90mm]{165mm}{ 
        \mathreportsb  % variab. defined in listofmathreports.tex
        }}
    \raisebox{-240mm}[0mm][0mm]{\parbox[b][30mm]{165mm}{ 
        \fontsize{10}{15pt}\usefont{OT1}{pbe}{l}{n}}}
    }}
%

\topmargin=0mm
\textheight=200mm
\addtolength\footskip{5mm}
\oddsidemargin=0mm
\evensidemargin=0mm
\marginparwidth=20mm
\textwidth=165mm
%
\repno{\phantom{A888}}
\university{The University of Texas at El Paso}
\department{Department of Mathematical Sciences}
\labaddress{500 West University, El Paso, TX 79968\\
            {Email: mathdept@math.utep.edu}\\
            {URL: http://www.math.utep.edu}\\
            {Phone:  1.915.747.5761}\\
            {Fax: 1.915.747.6502}}
\seriesname{The University of Texas at El Paso\\ Department of Mathematical Sciences\\ Research Reports Series}{}
\subtitle{{}}
\coverfigure{{}}
\dissernote{{}}
\address{{}}
\gdef\@thanks{{}}
\gdef\@email{{}}



