diff --git a/lectures/otagohandout.cls b/lectures/otagohandout.cls index eb4106b..2a7b737 100644 --- a/lectures/otagohandout.cls +++ b/lectures/otagohandout.cls @@ -1,6 +1,6 @@ -\def\classdate{12 December 2024} -\def\classversion{1.0.3} -\def\classshortdate{2024/12/12} +\def\classdate{16 July 2025} +\def\classversion{1.1} +\def\classshortdate{2025/07/16} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Document class for lecture handout document. @@ -12,6 +12,7 @@ % v1.0.1 Tweaked header so it always fits. % v1.0.2 Corrected page number generation. % v1.0.3 Normalised package info messages. +% v1.1 Switched to built-in LaTeX page hooks. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -27,7 +28,7 @@ % Load required packages. \RequirePackage{array} -\RequirePackage{background} +% \RequirePackage{background} \RequirePackage{pgfpages} @@ -134,31 +135,27 @@ \newlength{\headerwidth} % Three slides @ 0.3\pgfphysicalwidth plus two 5mm gaps. \setlength{\headerwidth}{0.9\pgfphysicalwidth+1cm} -\SetBgAngle{0} -% Scale factor looks about right, and seems logical. -\SetBgScale{1.414} -\SetBgColor{black} -\SetBgOpacity{1} -\SetBgPosition{current page.north} -% Offsets from current page.north determined empirically. -\SetBgVshift{-0.35\pgfphysicalheight} -\SetBgHshift{0.317\pgfphysicalwidth+1.5mm} -\SetBgContents{} + \makeatletter -\AddEverypageHook{% +\AddToHook{shipout/background}{ % Index off the first logical page, because it's the only one % we can guarantee to exist on any given page. - \ifnum\pgf@currentshipout=1% - \SetBgContents{% - \sffamily\bfseries\large% - \begin{tabular*}{\headerwidth}{@{}L{\headerwidth/3}@{}C{\headerwidth/3}@{}R{\headerwidth/3}@{}}% - \multicolumn{3}{@{}C{\headerwidth}@{}}{\resizebox*{\headerwidth}{!}{\Huge\PaperCode, \PaperTitle, \TeachingPeriod\ \YearOffered}} \\[0.85\pgfphysicalheight]% - % A skip of 0.85\pgfphysicalheight looks about right. - \ClassType\ \thechapter: \ShortClassTitle & Lecture Slides & \the\numexpr(\thepage-1)/6+1 \\% - \end{tabular*}% - }% - \fi% - \bg@material% + \begin{tikzpicture}[remember picture, overlay] + \ifnum\pgf@currentshipout=1% + % Scale factor of 1.414 looks about right, and seems logical. + \node[scale=1.414, font=\sffamily\bfseries\Huge] + % Offsets from current page.north determined empirically. + at ($(current page.north) + (\paperwidth+7.2mm,0.2175\paperheight)$) { + \resizebox*{\headerwidth}{!}{\PaperCode, \PaperTitle, \TeachingPeriod\ \YearOffered} + }; + \node[scale=1.414, font=\sffamily\bfseries\large] + at ($(current page.north) + (\paperwidth+7.2mm,-2.459\paperheight)$) { + \begin{tabular*}{\headerwidth}{@{}L{\headerwidth/3}@{}C{\headerwidth/3}@{}R{\headerwidth/3}@{}}% + \ClassType\ \thechapter: \ShortClassTitle & Lecture Slides & \the\numexpr(\thepage-1)/6+1 \\% + \end{tabular*}% + }; + \fi% + \end{tikzpicture} } \makeatother