\NeedsTeXFormat{LaTeX2e} 
\ProvidesClass{math215}[2012/01/19]
\newif\ifusingminion \usingminionfalse
\DeclareOption{minion}{\usingminiontrue}

% Option noname controls whether the student name should appear in
% the header or not.  By default it does.
\newif\ifhandout \handoutfalse
\DeclareOption{handout}{\handouttrue}

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions\relax
\LoadClass[12pt]{article} 

\RequirePackage{amssymb,amsmath,amsthm}
\RequirePackage[top=1in, bottom=1in, left=1.25in, right=1.25in]{geometry}
\RequirePackage{fancyhdr}
% \geometry{letterpaper}                   % ... or a4paper or a5paper or ... 

\ifusingminion
\RequirePackage[lf]{MinionPro}
%% Error message wierdness from the MinionPro package.  The following line fixes it. I don't know why.
\let\mathdollar\undefined 
\fi

\ifhandout
%% General formatting parameters
\parindent 0pt
\parskip 6pt plus 1pt
\else
\parskip 6pt plus 1pt
\fi

\newtheoremstyle{ex215}% name of the style to be used
  {18pt}% measure of space to leave above the theorem. E.g.: 3pt
  {12pt}% measure of space to leave below the theorem. E.g.: 3pt
  {}% name of font to use in the body of the theorem
  {}% measure of space to indent
  {\bfseries}% name of head font
  {:}% punctuation between head and body
  {2ex}% space after theorem head; " " = normal interword space
  {}% Manually specify head
\theoremstyle{ex215} 

\newtheorem*{exercisecore}{Exercise \@currentlabel}
\newenvironment{exercise}[1]
{\def\@currentlabel{#1}\exercisecore}
{\endexercisecore}


\newtheorem*{theoremcore}{Theorem \@currentlabel}
\newenvironment{theorem}[1]
{\def\@currentlabel{#1}\theoremcore}
{\endtheoremcore}

\newtheorem*{propcore}{Proposition \@currentlabel}
\newenvironment{proposition}[1]
{\def\@currentlabel{#1}\propcore}
{\endpropcore}

\newtheorem*{lemmacore}{Lemma \@currentlabel}
\newenvironment{lemma}[1]
{\def\@currentlabel{#1}\lemmacore}
{\endlemmacore}

\newtheorem*{corollarycore}{Corollary \@currentlabel}
\newenvironment{corollary}[1]
{\def\@currentlabel{#1}\corollarycore}
{\endcorollarycore}

\newtheorem*{projectcore}{Project \@currentlabel}
\newenvironment{project}[1]
{\def\@currentlabel{#1}\projectcore}
{\endprojectcore}

\newtheorem*{axiomcore}{Axiom \@currentlabel}
\newenvironment{axiom}[1]
{\def\@currentlabel{#1}\axiomcore}
{\endaxiomcore}

\newenvironment{pf}[1][\proofname]{%
\proof[\itshape  #1 ]%
\leftskip=2em%
}{\endproof}

\RequirePackage{fancyhdr}
\pagestyle{fancy}
\fancyfoot[C]{\ifnum \value{page} > 1\relax\thepage\fi}
\fancyhead[L]{\ifx\@doclabel\@empty\else\@doclabel\fi}
\ifhandout
\fancyhead[R]{\ifx\@docdate\@empty\else\@docdate\fi}
\else
\fancyhead[C]{\ifx\@docdate\@empty\else\@docdate\fi}
\fancyhead[R]{\ifx\@docauthor\@empty\else\@docauthor\fi}
\fi
\headheight 15pt

\def\doclabel#1{\gdef\@doclabel{#1}}
\doclabel{Use {\tt\textbackslash doclabel\{MY LABEL\}}.}
\def\docdate#1{\gdef\@docdate{#1}}
\docdate{Use {\tt\textbackslash docdate\{MY DATE\}}.}
\def\docauthor#1{\gdef\@docauthor{#1}}
\docauthor{Use {\tt\textbackslash docauthor\{MY NAME\}}.}

