\def\filedate{21 June 2012}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Document class for lecture slide notes.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Version History
% v1.0   Initial version
% v1.0.1 Changed package loading order to ensure that hyperref is last.
% v1.0.2 Changed punctuation of header.
% v1.0.3 Corrected the provided class!
% v1.1   Added nochapters option.
% v1.2   Added support for configurable class types.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\NeedsTeXFormat{LaTeX2e}[2001/06/01]
\ProvidesClass{lecturenotes}%
         [2014/07/06 INFO lecture notes style, v1.2]


% "Stream of conciousness" chapters vs. explicit individual classes. NOTE:
% you can't have both chapters and classes! This is because we use the same
% chapter macros for both cases, but they're applied differently (e.g., if
% nochapters is set, then \insertchapternumber represent the class number).
\newif\if@chapters \@chapterstrue
\DeclareOption{nochapters}{\@chaptersfalse}


\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions
\LoadClass{article}


% The article class doesn't have a chapter counter.
\newcounter{chapter}


% Load required packages.
\RequirePackage{pdfpages}
\RequirePackage[a4paper,pdftex]{geometry}
\RequirePackage{fancyhdr}
% DO NOT REMOVE THE NEXT LINE! The lecturesetup package loads a bunch
% of other packages, some of which are referenced below.
\RequirePackage{lecturecommon}


% Fix margins.
\geometry{vmargin=0.9in,hmargin=0.25in}

\raggedright


\if@chapters
    \SetClassType{Chapter}
\fi


% hyperref setup. We have to use a slightly convoluted method, because the
% macros referenced here haven't been set yet. Define the hyperref setup
% as a new macro, and call this AFTER initialising the paper and chapter
% variables.
\newcommand{\inithyperref}{%
	\hypersetup{%
		pdftitle={\PaperCode\ \ClassType\ \thechapter\ Speaker Notes},%
		pdfsubject={\ShortClassTitle},%
		colorlinks=false%
	}%
}


% Set up fancy headings.
\lhead{}
\chead{\Huge\sffamily\bfseries \PaperCode, \TeachingPeriod, \YearOffered}
\rhead{}

\lfoot{\large\sffamily\bfseries \ClassType\ \thechapter: \ShortClassTitle\ --- Notes}
\cfoot{}
\rfoot{\large\sffamily\bfseries\thepage}

\renewcommand{\footrulewidth}{0mm}
\renewcommand{\headrulewidth}{0mm}

\pagestyle{fancy}


\endinput
