Newer
Older
LaTeX / lecturecombined.cls
\def\filedate{21 June 2012}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Document class for lecture combined document.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Version History
% v1.0   Initial version
% v1.0.1 Changed package loading order to ensure that hyperref is last.
% v1.1   Added nochapters option.
% v1.2   Added support for configurable class types.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\NeedsTeXFormat{LaTeX2e}[2001/06/01]
\ProvidesClass{lecturecombined}%
         [2014/07/06 INFO lecture combined document style, v.1.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,landscape,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.5in}

\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\ Lecture Material},%
		pdfsubject={\ShortClassTitle},%
		colorlinks=false%
	}%
}


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

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

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

\pagestyle{fancy}


\endinput