LaTeX / lectures / lecturefig.cls
\def\filedate{21 July 2020}
% Document class for lecture figures & examples.
% Version History
% v1.1   Switched to using geometry instead of a4wide.
% v1.2   Fixed loading order of geometry and fancyhdr so that margins are correct.
%        Removed nohead from geometry initialisation to avoid wonky interaction
%        with fancyhdr.
% v1.3   Dropped use of Trebuchet font. Now just uses \sffamily.
% v1.4   Removed reliance on pdftex output driver (specify in documentclass
%        options).
%        Changed paragraph formatting.
% v1.5   Switched to common infrastructure for all lecture documents.
%        Added "UNDEFINED" default for the paper, chapter & title macros.
% v1.5.1 Changed package loading order to ensure that hyperref is last.
% v1.6   Added nochapters option.
% v1.7   Added support for configurable class types.
% v1.8   Replaced deprecated fancyhdr macros.

         [2020/07/21 INFO lecture figures style, v.1.8]

% "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


% Load required packages.
% DO NOT REMOVE THE NEXT LINE! The lecturecommon package loads a bunch
% of other packages and sets up various counters, etc., several of which
% are used below.

% Miscellaneous initialisation.
\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}

% Figure numbers.

% Figure, table & example captions.
{	\begin{center}
		\Large\bfseries\sffamily #1


% Specialised sub-caption for citing the source of something.
\newcommand{\source}[1]{\sffamily\footnotesize SOURCE: #1}

% Figures.
{	\refstepcounter{lfigure}
	\@docaption{Figure \thelfigure: #1}
{	\hfill\emph{\small continues over\ldots}
	\@docaption{Figure \thelfigure, cont'd}

% Tables.
{	\refstepcounter{lfigure}
	\@docaption{Table \thelfigure: #1}
{	\hfill\emph{\small continues over\ldots}
	\@docaption{Table \thelfigure, cont'd}

% Example.
{	\refstepcounter{lfigure}
	\@docaption{Example \thelfigure: #1}
{	\hfill\emph{\small continues over\ldots}
	\@docaption{Example \thelfigure, cont'd}

% Package initialisation.

% geometry setup.

% fancyhdr setup.
\fancyfoot[L]{\sffamily \PaperCode\ \ClassType\ \thechapter: \ShortClassTitle}
\fancyfoot[R]{\sffamily F-\thepage}



% Ensure first page footer is correctly positioned.
% (see



% 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.
		pdftitle={\PaperCode\ \ClassType\ \thechapter\ Figures and Examples},%