GitBucket
4.21.2
Toggle navigation
Snippets
Sign in
Files
Branches
1
Releases
Issues
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
nigel.stanger
/
LaTeX
Browse code
Merge commit '
0ca35f8
'
master
commit
50da92a219c7cd3aeabce21e0836bbadbbb844b1
2 parents
2e0d911
+
0ca35f8
Nigel Stanger
authored
on 12 Dec
Patch
Showing
7 changed files
lectures/courseoutline.cls
lectures/lecturefig.cls
lectures/lectureworksheet.cls
lectures/otagofonts.sty
lectures/otagohandout.cls
lectures/otagonotes.cls
lectures/otagoslides.cls
Ignore Space
Show notes
View
lectures/courseoutline.cls
\def\classdate{12 December 2024} \def\classversion{1.1.1} \def\classshortdate{2024/12/12} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Document class for Otago Business School course outlines. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Version History % v1.0 Initial version. % v1.0.1 Switched to PDF version of Otago Business School logo. % v1.1 Switched to new Otago branding. % v1.1.1 Normalised package info messages. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e}[2001/06/01] \ProvidesClass{courseoutline}% [\classdate\space v\classversion\space Otago course outline] \LoadClassWithOptions{article} % Load required packages. \RequirePackage{geometry} \RequirePackage{pifont} \RequirePackage{parskip} % Space-separated rather than indented paragraphs. \RequirePackage{etoolbox} % Mainly for \AfterEndPreamble. % 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. \RequirePackage{lecturecommon} % Package initialisation. % geometry setup. \geometry{a4paper,margin={1in,1in}} % hyperref setup. We can't execute this immediately, because the % macros referenced here haven't been set yet. All paper and chapter % variables (where applicable) must therefore be initialised in the % document preamble. \AtBeginDocument{% \hypersetup{% pdftitle={\PaperCode\ course outline, \YearOffered},% pdfsubject={\PaperTitle},% pdfauthor={Information Science, University of Otago},% }% } % Automatically insert standard Otago Business School title page, % and table of contents. Use \AfterEndPreamble from etoolbox because % doing it \AtBeginDocument somehow clashes with menukeys. \AfterEndPreamble{% \thispagestyle{empty}% \begin{center}% \sffamily% \vspace*{1cm}% \includegraphics[width=9cm,keepaspectratio]{UoO_English_Print_Colour.pdf}% \vfill% \Huge% \textbf{\PaperCode}\par% \textbf{\PaperTitle}\par% \Large% \TeachingPeriod, \YearOffered% \vfill% \Huge% \textbf{COURSE OUTLINE}% \vfill\mbox{}% \end{center}% \newpage% \thispagestyle{empty}% \tableofcontents% \setcounter{page}{0}% \newpage% } \endinput
\def\filedate{7 June 2024} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Document class for Otago Business School course outlines. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Version History % v1.0 Initial version. % v1.0.1 Switched to PDF version of Otago Business School logo. % v1.1 Switched to new Otago branding. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e}[2001/06/01] \ProvidesClass{courseoutline}% [2024/06/07 OBS course outline style, v.1.1] \LoadClassWithOptions{article} % Load required packages. \RequirePackage{geometry} \RequirePackage{pifont} \RequirePackage{parskip} % Space-separated rather than indented paragraphs. \RequirePackage{etoolbox} % Mainly for \AfterEndPreamble. % 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. \RequirePackage{lecturecommon} % Package initialisation. % geometry setup. \geometry{a4paper,margin={1in,1in}} % hyperref setup. We can't execute this immediately, because the % macros referenced here haven't been set yet. All paper and chapter % variables (where applicable) must therefore be initialised in the % document preamble. \AtBeginDocument{% \hypersetup{% pdftitle={\PaperCode\ course outline, \YearOffered},% pdfsubject={\PaperTitle},% pdfauthor={Information Science, University of Otago},% }% } % Automatically insert standard Otago Business School title page, % and table of contents. Use \AfterEndPreamble from etoolbox because % doing it \AtBeginDocument somehow clashes with menukeys. \AfterEndPreamble{% \thispagestyle{empty}% \begin{center}% \sffamily% \vspace*{1cm}% \includegraphics[width=9cm,keepaspectratio]{UoO_English_Print_Colour.pdf}% \vfill% \Huge% \textbf{\PaperCode}\par% \textbf{\PaperTitle}\par% \Large% \TeachingPeriod, \YearOffered% \vfill% \Huge% \textbf{COURSE OUTLINE}% \vfill\mbox{}% \end{center}% \newpage% \thispagestyle{empty}% \tableofcontents% \setcounter{page}{0}% \newpage% } \endinput
Ignore Space
Show notes
View
lectures/lecturefig.cls
\def\classdate{12 December 2024} \def\classversion{1.8.1} \def\classshortdate{2024/12/12} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % 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. % v1.8.1 Normalised package info messages. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e}[2001/06/01] \ProvidesClass{lecturefig}% [\classdate\space v\classversion\space Otago lecture figures] % "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}{report}} \ProcessOptions \LoadClass{report} % Load required packages. \RequirePackage{geometry} \RequirePackage{fancyhdr} \RequirePackage[normalem]{ulem} % 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. \RequirePackage{lecturecommon} % Miscellaneous initialisation. \setlength{\parindent}{0pt} \setlength{\parskip}{1ex plus 0.5ex minus 0.2ex} % Figure numbers. \newcounter{lfigure}[chapter] \renewcommand{\thelfigure}{\arabic{chapter}--\arabic{lfigure}} % Figure, table & example captions. \newcommand{\@docaption}[1]% { \begin{center} \Large\bfseries\sffamily #1 \end{center} } \newcommand{\newheading}[1]{\@docaption{#1}} % Specialised sub-caption for citing the source of something. \newcommand{\source}[1]{\sffamily\footnotesize SOURCE: #1} % Figures. \newcommand{\newfigure}[1]% { \refstepcounter{lfigure} \@docaption{Figure \thelfigure: #1} } \newcommand{\continuefigure}% { \hfill\emph{\small continues over\ldots} \newpage \@docaption{Figure \thelfigure, cont'd} } % Tables. \newcommand{\newtable}[1]% { \refstepcounter{lfigure} \@docaption{Table \thelfigure: #1} } \newcommand{\continuetable}% { \hfill\emph{\small continues over\ldots} \newpage \@docaption{Table \thelfigure, cont'd} } % Example. \newcommand{\newexample}[1]% { \refstepcounter{lfigure} \@docaption{Example \thelfigure: #1} } \newcommand{\continueexample}% { \hfill\emph{\small continues over\ldots} \newpage \@docaption{Example \thelfigure, cont'd} } % Package initialisation. % geometry setup. \geometry{a4paper,margin={1in,1in}} % fancyhdr setup. \fancyhf{} \fancyfoot[L]{\sffamily \PaperCode\ \ClassType\ \thechapter: \ShortClassTitle} \fancyfoot[R]{\sffamily F-\thepage} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} \setlength{\parskip}{0.5\baselineskip} % Ensure first page footer is correctly positioned. % (see https://tex.stackexchange.com/a/442558) \setlength{\headheight}{15pt} \pagestyle{fancy} \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\ Figures and Examples},% pdfsubject={\ShortClassTitle},% colorlinks,% urlcolor=blue,% linkcolor=blue,% }% } \endinput
\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. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e}[2001/06/01] \ProvidesClass{lecturefig}% [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 \DeclareOption{nochapters}{\@chaptersfalse} \DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}} \ProcessOptions \LoadClass{report} % Load required packages. \RequirePackage{geometry} \RequirePackage{fancyhdr} \RequirePackage[normalem]{ulem} % 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. \RequirePackage{lecturecommon} % Miscellaneous initialisation. \setlength{\parindent}{0pt} \setlength{\parskip}{1ex plus 0.5ex minus 0.2ex} % Figure numbers. \newcounter{lfigure}[chapter] \renewcommand{\thelfigure}{\arabic{chapter}--\arabic{lfigure}} % Figure, table & example captions. \newcommand{\@docaption}[1]% { \begin{center} \Large\bfseries\sffamily #1 \end{center} } \newcommand{\newheading}[1]{\@docaption{#1}} % Specialised sub-caption for citing the source of something. \newcommand{\source}[1]{\sffamily\footnotesize SOURCE: #1} % Figures. \newcommand{\newfigure}[1]% { \refstepcounter{lfigure} \@docaption{Figure \thelfigure: #1} } \newcommand{\continuefigure}% { \hfill\emph{\small continues over\ldots} \newpage \@docaption{Figure \thelfigure, cont'd} } % Tables. \newcommand{\newtable}[1]% { \refstepcounter{lfigure} \@docaption{Table \thelfigure: #1} } \newcommand{\continuetable}% { \hfill\emph{\small continues over\ldots} \newpage \@docaption{Table \thelfigure, cont'd} } % Example. \newcommand{\newexample}[1]% { \refstepcounter{lfigure} \@docaption{Example \thelfigure: #1} } \newcommand{\continueexample}% { \hfill\emph{\small continues over\ldots} \newpage \@docaption{Example \thelfigure, cont'd} } % Package initialisation. % geometry setup. \geometry{a4paper,margin={1in,1in}} % fancyhdr setup. \fancyhf{} \fancyfoot[L]{\sffamily \PaperCode\ \ClassType\ \thechapter: \ShortClassTitle} \fancyfoot[R]{\sffamily F-\thepage} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} \setlength{\parskip}{0.5\baselineskip} % Ensure first page footer is correctly positioned. % (see https://tex.stackexchange.com/a/442558) \setlength{\headheight}{15pt} \pagestyle{fancy} \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\ Figures and Examples},% pdfsubject={\ShortClassTitle},% colorlinks,% urlcolor=blue,% linkcolor=blue,% }% } \endinput
Ignore Space
Show notes
View
lectures/lectureworksheet.cls
\def\classdate{12 December 2024} \def\classversion{1.2.1} \def\classshortdate{2024/12/12} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Document class for lecture/lab worksheets (particularly for fourth year). % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Version History % v1.0 Initial version. % v1.1 Added experimental Xe(La)TeX support. % Added boxedminipage and siunitx packages. % v1.1.1 Switched to LoadClassWithOptions instead of the more convoluted method. % v1.1.2 Pulled global hyperref configuration into the class file. % v1.1.3 Changed hyperref initialisation order. % v1.2 Moved Xe(La)TeX support into lecturecommon.sty. % v1.2.1 Normalised package info messages. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e}[2001/06/01] \ProvidesClass{lectureworksheet}% [\classdate\space v\classversion\space Otago lecture worksheet] \LoadClassWithOptions{article} % Load required packages. \RequirePackage{geometry} \RequirePackage{pifont} \RequirePackage{parskip} % Space-separated rather than indented paragraphs. % 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. \RequirePackage{lecturecommon} % Some additional variables. \newcommand{\WeekNumber}{UNDEFINED} \newcommand{\SetWeekNumber}[1]{\renewcommand{\WeekNumber}{#1}} % Package initialisation. % geometry setup. \geometry{a4paper,margin={1in,1in}} % hyperref setup. We can't execute this immediately, because the % macros referenced here haven't been set yet. All paper and chapter % variables (where applicable) must therefore be initialised in the % document preamble. \AtBeginDocument{% \hypersetup{% pdftitle={\PaperCode\ class worksheet, week \WeekNumber},% pdfsubject={\PaperTitle},% pdfauthor={Information Science, University of Otago},% }% } \endinput
\def\filedate{28 January 2014} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Document class for lecture/lab worksheets (particularly for fourth year). % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Version History % v1.0 Initial version. % v1.1 Added experimental Xe(La)TeX support. % Added boxedminipage and siunitx packages. % v1.1.1 Switched to LoadClassWithOptions instead of the more convoluted method. % v1.1.2 Pulled global hyperref configuration into the class file. % v1.1.3 Changed hyperref initialisation order. % v1.2 Moved Xe(La)TeX support into lecturecommon.sty. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e}[2001/06/01] \ProvidesClass{lectureworksheet}% [2014/01/28 INFO lecture worksheet style, v.1.2] \LoadClassWithOptions{article} % Load required packages. \RequirePackage{geometry} \RequirePackage{pifont} \RequirePackage{parskip} % Space-separated rather than indented paragraphs. % 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. \RequirePackage{lecturecommon} % Some additional variables. \newcommand{\WeekNumber}{UNDEFINED} \newcommand{\SetWeekNumber}[1]{\renewcommand{\WeekNumber}{#1}} % Package initialisation. % geometry setup. \geometry{a4paper,margin={1in,1in}} % hyperref setup. We can't execute this immediately, because the % macros referenced here haven't been set yet. All paper and chapter % variables (where applicable) must therefore be initialised in the % document preamble. \AtBeginDocument{% \hypersetup{% pdftitle={\PaperCode\ class worksheet, week \WeekNumber},% pdfsubject={\PaperTitle},% pdfauthor={Information Science, University of Otago},% }% } \endinput
Ignore Space
Show notes
View
lectures/otagofonts.sty
\def\packagedate{11 December 2024} \def\packageversion{2.0} \def\packageshortdate{2024/12/11} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Set up official Otago fonts based on what’s available. Fall back to reasonable % alternatives where possible. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Version History % v1.0 Initial version, rebuilt from deprecated lecturecommon package. % v1.1 Refactored font checking mechanism. % v1.2 Fixed sans-serif scaling, added Noto Sans. % v1.3 Added new Wickliffe fonts and fallbacks. % v1.3.1 Switched serif font to Wickliffe Light. % v1.3.2 Switched bold fonts to Wickliffe (Sans) Medium. % v1.4 Switched from mathspec to unicode-math, further font tweaks. % v1.4.1 Replaced deprecated ifxetex with iftex. % v2.0 Rewritten for LuaTeX exclusively. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e}[2001/06/01] \ProvidesPackage{otagofonts}[\packageshortdate\space v\packageversion\space Otago standard fonts] \RequirePackage{amsmath} \RequirePackage{etoolbox} \RequirePackage[no-math]{fontspec} \RequirePackage{iftex} \RequirePackage{xstring} \RequirePackage{unicode-math} % should come last % This package requires LuaTeX, because XeTeX (a) doesn't really support % OpenType variable fonts and (b) is no longer recommended by the LaTeX % core team due to issues with PDF tagging. % (see <https://www.latex-project.org/news/latex2e-news/ltnews40.pdf>) % There were never really any good solutions for doing this in anything % other than XeTeX/LuaTeX anyway, so the fallback for other engines has % been removed. \RequireLuaTeX % Try a few different fonts that are either the official Otago font or a % reasonable alternative, using etoolbox's list looping macros. The tricky % part is making it generic for all three font categories (main, sans, mono), % and I can only successfully make it work for the first one encountered. % The set of fonts is limited, so this is OK. % % Note: Explicitly specify Ligatures=TeX only for the main and sans fonts, % otherwise curly quotes will automatically appear in the mono font. Since % the mono font is pretty much exclusively used for code listings, TeX % ligatures are a bad thing. % Main font (body text). \newbool{foundmainfont} \def\mainfontname{none} \PackageInfo{otagofonts}{Looking for suitable main font} % font-specific defaults \defaultfontfeatures[Wickliffe Light]{ BoldFont={Wickliffe Medium}, ItalicFont={Wickliffe Light Italic}, BoldItalicFont={Wickliffe Medium Italic} } \defaultfontfeatures[Crimson Pro Light]{ BoldFont={Crimson Pro Medium}, ItalicFont={Crimson Pro Light Italic}, BoldItalicFont={Crimson Pro Medium Italic} } \renewcommand*{\do}[1]{% \PackageInfo{otagofonts}{Trying #1...} \IfFontExistsTF{#1}{% \setmainfont{#1}[Ligatures=TeX]% \def\mainfontname{#1}% \PackageInfo{otagofonts}{Using \mainfontname\space for main font}% \booltrue{foundmainfont}% \listbreak% }{}% } \docsvlist{Wickliffe Light,Crimson Pro Light,Crimson Text,Georgia,TeX Gyre Pagella,Times New Roman} % Maths font. % In principle we can do the same thing for the maths font, but we’re % only going to use fonts built into TeXlive anyway, and we ideally % want to choose a maths font that complements the main font. If we % can't find a suitable maths font, default to Latin Modern Math, % which looks reasonably OK alongside many fonts (especially for % light weights). The maths font can always be manually overidden % using \setmathfont in the document if a better alternative is available. \setmathfont{latinmodern-math.otf} \ifbool{foundmainfont}{% % The following conditions are naturally mutually exclusive, so no need % for complex if/then/else nesting. \IfSubStr{\mainfontname}{Light}{% % KpMath comes in several weights. \setmathfont{KpMath-Light.otf}[Scale=MatchLowercase]% \setmathfont{KpMath-Semibold.otf}[version=bold]% \setmathrm{KpRoman-Light.otf}% \setmathfontface\mathit{KpRoman-LightItalic.otf}% \setmathfontface\mathbf{KpRoman-Semibold.otf}% }{}% \IfEq{\mainfontname}{TeX Gyre Pagella}{% \setmathfont{TeX Gyre Pagella Math}% }{}% }{% \PackageWarning{otagofonts}{% Could not find any suitable main font.\MessageBreak% Falling back to LaTeX default.\MessageBreak% Recommended fonts:\MessageBreak% \space\space Wickliffe (official, proprietary)\MessageBreak% \space\space Crimson Pro (https://fonts.google.com/specimen/Crimson+Pro)% \space\space Crimson Text (https://fonts.google.com/specimen/Crimson+Text)% }% } % The various join symbols aren't covered very well by many maths fonts % (including Latin Modern Math, annoyingly), so let's Frankenstein them % in from fonts that do have them. We need to hack the scale to get roughly % proportional looking sizes. % Outer joins (left, right, full): \setmathfont{STIXTwoMath-Regular.otf}[range={"027D5-"027D7}, Scale=0.875] % Inner join: (1.143 = 1 / 0.875) \setmathfont{KpMath-Light.otf}[range={"02A1D}, Scale=1.143] % Sans-serif font. \newbool{foundsansfont} \def\sansfontname{none} \PackageInfo{otagofonts}{Looking for suitable sans-serif font} % font-specific defaults \defaultfontfeatures[Wickliffe Sans Light]{ BoldFont={Wickliffe Sans Medium}, ItalicFont={Wickliffe Sans Light Italic}, BoldItalicFont={Wickliffe Sans Medium Italic} } \defaultfontfeatures[Open Sans Light]{ BoldFont={Open Sans Semibold}, ItalicFont={Open Sans Light Italic}, BoldItalicFont={Open Sans Semibold Italic} } \defaultfontfeatures[Noto Sans Light]{ BoldFont={Noto Sans Medium}, ItalicFont={Noto Sans Light Italic}, BoldItalicFont={Noto Sans Medium Italic} } \defaultfontfeatures[Roboto Light]{ BoldFont={Roboto Medium}, ItalicFont={Roboto Light Italic}, BoldItalicFont={Roboto Medium Italic} } \renewcommand*{\do}[1]{% \PackageInfo{otagofonts}{Trying #1...} \IfFontExistsTF{#1}{% \setsansfont{#1}[Scale=MatchLowercase, Ligatures=TeX]% \def\sansfontname{#1}% \PackageInfo{otagofonts}{Using \sansfontname\space for sans-serif font}% \booltrue{foundsansfont}% \listbreak% }{}% } \docsvlist{Wickliffe Sans Light,Open Sans Light,Noto Sans Light,Roboto Light,Arial} \ifbool{foundsansfont}{}{% \PackageWarning{otagofonts}{Could not find any suitable sans-serif font.\MessageBreak% Falling back to LaTeX default.\MessageBreak% Recommended fonts:\MessageBreak% \space\space Wickliffe Sans (official, proprietary)\MessageBreak% \space\space Open Sans (https://fonts.google.com/specimen/Open+Sans)\MessageBreak% \space\space Roboto (https://fonts.google.com/specimen/Roboto)% }% } % Monospaced font, mainly for code listings. \newbool{foundmonofont} \def\monofontname{none} \PackageInfo{otagofonts}{Looking for suitable monospaced font} % font-specific defaults \defaultfontfeatures[Iosevka Light]{ RawFeature={+ss03;-calt}, BoldFont={Iosevka Medium}, ItalicFont={Iosevka Light Italic}, BoldItalicFont={Iosevka Medium Italic} } \defaultfontfeatures[Inconsolata Light]{ BoldFont={Inconsolata Medium}, ItalicFont={Inconsolata Light Italic}, BoldItalicFont={Inconsolata Medium Italic} } \renewcommand*{\do}[1]{% \PackageInfo{otagofonts}{Trying #1...} \IfFontExistsTF{#1}{% \setmonofont{#1}[Scale=MatchLowercase]% \def\monofontname{#1}% \PackageInfo{otagofonts}{Using \monofontname\space for monospaced font}% \booltrue{foundmonofont}% \listbreak% }{}% } \docsvlist{Iosevka Light,Letter Gothic 12 Pitch,Inconsolata} \ifbool{foundmonofont}{}{% \PackageWarning{otagofonts}{Could not find any suitable monospaced font.\MessageBreak% Falling back to LaTeX default.\MessageBreak% Recommended fonts:\MessageBreak% \space\space Iosevka (https://github.com/be5invis/Iosevka/releases, but complex!)\MessageBreak% \space\space Inconsolata (https://fonts.google.com/specimen/Inconsolata)% }% } \endinput
\def\filedate{6 December 2024} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Set up official Otago fonts based on what’s available. Fall back to reasonable % alternatives where possible. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Version History % v1.0 Initial version, rebuilt from deprecated lecturecommon package. % v1.1 Refactored font checking mechanism. % v1.2 Fixed sans-serif scaling, added Noto Sans. % v1.3 Added new Wickliffe fonts and fallbacks. % v1.3.1 Switched serif font to Wickliffe Light. % v1.3.2 Switched bold fonts to Wickliffe (Sans) Medium. % v1.4 Switched from mathspec to unicode-math, further font tweaks. % v1.4.1 Replaced deprecated ifxetex with iftex. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e}[2001/06/01] \ProvidesPackage{otagofonts}[2024/12/06 Otago standard fonts v1.4.1] \RequirePackage{etoolbox} \RequirePackage{iftex} \RequirePackage{amsmath} \ifxetex \RequirePackage[no-math]{fontspec} \RequirePackage{unicode-math} \RequirePackage{xunicode} \RequirePackage{xltxtra} % Try a few different fonts that are either the official Otago font or a % reasonable alternative, using etoolbox's list looping macros. The tricky % part is making it generic for all three font categories (main, sans, mono), % and I can only successfully make it work for the first one encountered. % The set of fonts is limited, so this is OK. % % Note: Explicitly specify Mapping=tex-text only for the main and sans fonts, % otherwise curly quotes will automatically appear in the mono font. Since % this is pretty much exclusively used for code listings, this is a bad thing. % Main font (body text). \newbool{foundmainfont} \PackageInfo{otagofonts}{Looking for suitable main font} % font-specific defaults \defaultfontfeatures[Wickliffe Light]{BoldFont={Wickliffe Medium}} \renewcommand*{\do}[1]{% \PackageInfo{otagofonts}{Trying #1...} \IfFontExistsTF{#1}{% \setmainfont{#1}[Mapping=tex-text]% \PackageInfo{otagofonts}{Using #1 for main font}% \booltrue{foundmainfont}% \listbreak% }{}% } \docsvlist{Wickliffe Light,Crimson Pro,Crimson Text,Georgia,TeX Gyre Pagella,Times New Roman} \ifbool{foundmainfont}{}{% \PackageWarning{otagofonts}{% Could not find any suitable main font.\MessageBreak% Falling back to LaTeX default.\MessageBreak% Recommended fonts:\MessageBreak% \space\space Wickliffe (official, proprietary)\MessageBreak% \space\space Crimson Pro (https://fonts.google.com/specimen/Crimson+Pro)% \space\space Crimson Text (https://fonts.google.com/specimen/Crimson+Text)% }% } % Maths font. % Use Latin Modern, the unicode-math default. It looks reasonably OK alongside % many fonts including Wickliffe Light. It can always be manually overidden % using \setmathfont if a better alternative is available. \setmathfont{latinmodern-math.otf} \setmathrm{latinmodern-math.otf} % Sans-serif font. \newbool{foundsansfont} \PackageInfo{otagofonts}{Looking for suitable sans-serif font} % font-specific defaults \defaultfontfeatures[Wickliffe Sans Light]{BoldFont={Wickliffe Sans Medium}} \defaultfontfeatures[Open Sans Light]{BoldFont={Open Sans}} \defaultfontfeatures[Noto Sans Light]{BoldFont={Noto Sans}} \defaultfontfeatures[Roboto Light]{BoldFont={Roboto}} \renewcommand*{\do}[1]{% \PackageInfo{otagofonts}{Trying #1...} \IfFontExistsTF{#1}{% \setsansfont{#1}[Scale=MatchLowercase,Mapping=tex-text]% \PackageInfo{otagofonts}{Using #1 for sans-serif font}% \booltrue{foundsansfont}% \listbreak% }{}% } \docsvlist{Wickliffe Sans Light,Open Sans Light,Noto Sans Light,Roboto Light,Arial} \ifbool{foundsansfont}{}{% \PackageWarning{otagofonts}{Could not find any suitable sans-serif font.\MessageBreak% Falling back to LaTeX default.\MessageBreak% Recommended fonts:\MessageBreak% \space\space Wickliffe Sans (official, proprietary)\MessageBreak% \space\space Open Sans (https://fonts.google.com/specimen/Open+Sans)\MessageBreak% \space\space Roboto (https://fonts.google.com/specimen/Roboto)% }% } % Monospaced font, mainly for code listings. \newbool{foundmonofont} \PackageInfo{otagofonts}{Looking for suitable monospaced font} % font-specific defaults \defaultfontfeatures[Iosevka Light]{RawFeature={+ss03;-calt}} \renewcommand*{\do}[1]{% \PackageInfo{otagofonts}{Trying #1...} \IfFontExistsTF{#1}{% \setmonofont{#1}[Scale=MatchLowercase,Mapping=]% \PackageInfo{otagofonts}{Using #1 for monospaced font}% \booltrue{foundmonofont}% \listbreak% }{}% } \docsvlist{Iosevka Light,Letter Gothic 12 Pitch,Inconsolata} \ifbool{foundmonofont}{}{% \PackageWarning{otagofonts}{Could not find any suitable monospaced font.\MessageBreak% Falling back to LaTeX default.\MessageBreak% Recommended fonts:\MessageBreak% \space\space Iosevka (https://github.com/be5invis/Iosevka/releases, but complex!)\MessageBreak% \space\space Inconsolata (https://fonts.google.com/specimen/Inconsolata)% }% } \else % assume PDFLaTeX otherwise \RequirePackage[T1]{fontenc} \RequirePackage{textcomp} \RequirePackage{lmodern} \RequirePackage{mathpazo} \PackageWarning{otagofonts}{% Otago-compatible fonts are not yet supported for LaTeX\MessageBreak% or PDFLaTeX. XeLaTeX is preferred% } % Gill Sans to come... % \renewcommand{\sfdefault}{} % \renewcommand{\ttdefault}{blg} \fi \endinput
Ignore Space
Show notes
View
lectures/otagohandout.cls
\def\classdate{12 December 2024} \def\classversion{1.0.3} \def\classshortdate{2024/12/12} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Document class for lecture handout document. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Version History % v1.0 Initial version, rebuilt from deprecated lecturehandout class. % v1.0.1 Tweaked header so it always fits. % v1.0.2 Corrected page number generation. % v1.0.3 Normalised package info messages. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e}[2001/06/01] \ProvidesClass{otagohandout}% [\classdate\space v\classversion\space Otago lecture handout] \DeclareOption*{\PassOptionsToClass{\CurrentOption}{otagoslides}} \ProcessOptions \LoadClass{otagoslides} % Load required packages. \RequirePackage{array} \RequirePackage{background} \RequirePackage{pgfpages} \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. \renewcommand{\inithyperref}{% \hypersetup{% pdftitle={\PaperCode\ \ClassType\ \thechapter\ Lecture Material},% pdfsubject={\ShortClassTitle},% colorlinks=false% }% } % Set up notes 6-up page layout using pgfpages. % This only looks good in landscape, but then it's not intended for % any other layout anyway... % % If there aren't enough frames to fill the final page, any missing ones % will appear as empty boxes. Meh. \pgfpagesdeclarelayout{handout 6up}{% \def\pgfpageoptionborder{0pt}% }{% \pgfpagesphysicalpageoptions{% logical pages=6,% physical height=\pgfpageoptionheight,% physical width=\pgfpageoptionwidth,% }% \pgfpageslogicalpageoptions{1} {% border code=\pgfsetlinewidth{0.6pt}\pgfstroke,% border shrink=\pgfpageoptionborder,% resized width=.3\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% center=\pgfpoint{.183\pgfphysicalwidth}{.67\pgfphysicalheight}% }% \pgfpageslogicalpageoptions{2} {% border code=\pgfsetlinewidth{0.6pt}\pgfstroke,% border shrink=\pgfpageoptionborder,% resized width=.3\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% center=\pgfpoint{.5\pgfphysicalwidth}{.67\pgfphysicalheight}% }% \pgfpageslogicalpageoptions{3} {% border code=\pgfsetlinewidth{0.6pt}\pgfstroke,% border shrink=\pgfpageoptionborder,% resized width=.3\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% center=\pgfpoint{.817\pgfphysicalwidth}{.67\pgfphysicalheight}% }% \pgfpageslogicalpageoptions{4} {% border code=\pgfsetlinewidth{0.6pt}\pgfstroke,% border shrink=\pgfpageoptionborder,% resized width=.3\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% center=\pgfpoint{.183\pgfphysicalwidth}{.33\pgfphysicalheight}% }% \pgfpageslogicalpageoptions{5} {% border code=\pgfsetlinewidth{0.6pt}\pgfstroke,% border shrink=\pgfpageoptionborder,% resized width=.3\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% center=\pgfpoint{.5\pgfphysicalwidth}{.33\pgfphysicalheight}% }% \pgfpageslogicalpageoptions{6} {% border code=\pgfsetlinewidth{0.6pt}\pgfstroke,% border shrink=\pgfpageoptionborder,% resized width=.3\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% center=\pgfpoint{.817\pgfphysicalwidth}{.33\pgfphysicalheight}% }% } \pgfpagesuselayout{handout 6up}[a4paper, landscape] % Set transparent slide background colour. \setbeamercolor{background canvas}{bg=} % Set up "headers" and "footers". Because pgfpages converts the original % pages to logical pages, we can't use normal techniques like fancyhdr, % because that will get applied to the logical pages, not the physical % ones. We therefore use a slightly bizarre hack with the background % package and a tabular to dangle the "header" and "footer" off the % first logical page. % (Adapted from <https://tex.stackexchange.com/a/83270>.) \newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} \newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} \newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} \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{% % 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% } \makeatother \endinput
\def\filedate{24 March 2021} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Document class for lecture handout document. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Version History % v1.0 Initial version, rebuilt from deprecated lecturehandout class. % v1.0.1 Tweaked header so it always fits. % v1.0.2 Corrected page number generation. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e}[2001/06/01] \ProvidesClass{otagohandout}% [2021/03/24 INFO lecture handout document style, v.1.0.2] \DeclareOption*{\PassOptionsToClass{\CurrentOption}{otagoslides}} \ProcessOptions \LoadClass{otagoslides} % Load required packages. \RequirePackage{array} \RequirePackage{background} \RequirePackage{pgfpages} \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. \renewcommand{\inithyperref}{% \hypersetup{% pdftitle={\PaperCode\ \ClassType\ \thechapter\ Lecture Material},% pdfsubject={\ShortClassTitle},% colorlinks=false% }% } % Set up notes 6-up page layout using pgfpages. % This only looks good in landscape, but then it's not intended for % any other layout anyway... % % If there aren't enough frames to fill the final page, any missing ones % will appear as empty boxes. Meh. \pgfpagesdeclarelayout{handout 6up}{% \def\pgfpageoptionborder{0pt}% }{% \pgfpagesphysicalpageoptions{% logical pages=6,% physical height=\pgfpageoptionheight,% physical width=\pgfpageoptionwidth,% }% \pgfpageslogicalpageoptions{1} {% border code=\pgfsetlinewidth{0.6pt}\pgfstroke,% border shrink=\pgfpageoptionborder,% resized width=.3\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% center=\pgfpoint{.183\pgfphysicalwidth}{.67\pgfphysicalheight}% }% \pgfpageslogicalpageoptions{2} {% border code=\pgfsetlinewidth{0.6pt}\pgfstroke,% border shrink=\pgfpageoptionborder,% resized width=.3\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% center=\pgfpoint{.5\pgfphysicalwidth}{.67\pgfphysicalheight}% }% \pgfpageslogicalpageoptions{3} {% border code=\pgfsetlinewidth{0.6pt}\pgfstroke,% border shrink=\pgfpageoptionborder,% resized width=.3\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% center=\pgfpoint{.817\pgfphysicalwidth}{.67\pgfphysicalheight}% }% \pgfpageslogicalpageoptions{4} {% border code=\pgfsetlinewidth{0.6pt}\pgfstroke,% border shrink=\pgfpageoptionborder,% resized width=.3\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% center=\pgfpoint{.183\pgfphysicalwidth}{.33\pgfphysicalheight}% }% \pgfpageslogicalpageoptions{5} {% border code=\pgfsetlinewidth{0.6pt}\pgfstroke,% border shrink=\pgfpageoptionborder,% resized width=.3\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% center=\pgfpoint{.5\pgfphysicalwidth}{.33\pgfphysicalheight}% }% \pgfpageslogicalpageoptions{6} {% border code=\pgfsetlinewidth{0.6pt}\pgfstroke,% border shrink=\pgfpageoptionborder,% resized width=.3\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% center=\pgfpoint{.817\pgfphysicalwidth}{.33\pgfphysicalheight}% }% } \pgfpagesuselayout{handout 6up}[a4paper, landscape] % Set transparent slide background colour. \setbeamercolor{background canvas}{bg=} % Set up "headers" and "footers". Because pgfpages converts the original % pages to logical pages, we can't use normal techniques like fancyhdr, % because that will get applied to the logical pages, not the physical % ones. We therefore use a slightly bizarre hack with the background % package and a tabular to dangle the "header" and "footer" off the % first logical page. % (Adapted from <https://tex.stackexchange.com/a/83270>.) \newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} \newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} \newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} \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{% % 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% } \makeatother \endinput
Ignore Space
Show notes
View
lectures/otagonotes.cls
\def\classdate{12 December 2024} \def\classversion{1.0.2} \def\classshortdate{2024/12/12} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Document class for lecture slide notes. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Version History % v1.0 Initial version, rebuilt from deprecated lecturenotes class. % v1.0.1 Corrected page number generation. % v1.0.2 Normalised package info messages. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e}[2001/06/01] \ProvidesClass{otagonotes}% [\classdate\space v\classversion\space Otago lecture speaker notes] \DeclareOption*{\PassOptionsToClass{\CurrentOption}{otagoslides}} \ProcessOptions \LoadClass{otagoslides} % Load required packages. \RequirePackage{array} \RequirePackage{background} \RequirePackage{pgfpages} \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. \renewcommand{\inithyperref}{% \hypersetup{% pdftitle={\PaperCode\ \ClassType\ \thechapter\ Speaker Notes},% pdfsubject={\ShortClassTitle},% colorlinks=false% }% } % Set up notes 6-up page layout using pgfpages. % This only looks good in portrait, but then it's not intended for % any other layout anyway... \pgfpagesdeclarelayout{notes 6up}{% \edef\pgfpageoptionheight{\the\paperwidth} % landscaped by default \edef\pgfpageoptionwidth{\the\paperheight}% \def\pgfpageoptionborder{0pt}% }{% \pgfpagesphysicalpageoptions{% logical pages=6,% physical height=\pgfpageoptionheight,% physical width=\pgfpageoptionwidth,% }% \pgfpageslogicalpageoptions{1} {% border shrink=\pgfpageoptionborder,% resized width=.5\pgfphysicalwidth,% resized height=.25\pgfphysicalheight,% center=\pgfpoint{.26\pgfphysicalwidth}{.76\pgfphysicalheight}% }% \pgfpageslogicalpageoptions{2} {% border shrink=\pgfpageoptionborder,% resized width=.5\pgfphysicalwidth,% resized height=.25\pgfphysicalheight,% center=\pgfpoint{.74\pgfphysicalwidth}{.76\pgfphysicalheight}% }% \pgfpageslogicalpageoptions{3} {% border shrink=\pgfpageoptionborder,% resized width=.5\pgfphysicalwidth,% resized height=.25\pgfphysicalheight,% center=\pgfpoint{.26\pgfphysicalwidth}{.5\pgfphysicalheight}% }% \pgfpageslogicalpageoptions{4} {% border shrink=\pgfpageoptionborder,% resized width=.5\pgfphysicalwidth,% resized height=.25\pgfphysicalheight,% center=\pgfpoint{.74\pgfphysicalwidth}{.5\pgfphysicalheight}% }% \pgfpageslogicalpageoptions{5} {% border shrink=\pgfpageoptionborder,% resized width=.5\pgfphysicalwidth,% resized height=.25\pgfphysicalheight,% center=\pgfpoint{.26\pgfphysicalwidth}{.24\pgfphysicalheight}% }% \pgfpageslogicalpageoptions{6} {% border shrink=\pgfpageoptionborder,% resized width=.5\pgfphysicalwidth,% resized height=.25\pgfphysicalheight,% center=\pgfpoint{.74\pgfphysicalwidth}{.24\pgfphysicalheight}% }% } \pgfpagesuselayout{notes 6up}[a4paper] % Set transparent slide background colour. \setbeamercolor{background canvas}{bg=} % Set up "headers" and "footers". Because pgfpages converts the original % pages to logical pages, we can't use normal techniques like fancyhdr, % because that will get applied to the logical pages, not the physical % ones. We therefore use a slightly bizarre hack with the background % package and a tabular to dangle the "header" and "footer" off the % first logical page. % (Adapted from <https://tex.stackexchange.com/a/83270>.) \newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} \newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} \newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} \newlength{\headerwidth} % Determined empirically for A4 paper. \setlength{\headerwidth}{0.85\pgfphysicalwidth+1mm} \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.53\pgfphysicalheight} \SetBgHshift{0.134\pgfphysicalwidth} \SetBgContents{} \makeatletter \AddEverypageHook{% % 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{2\headerwidth/3}@{}R{\headerwidth/3}@{}}% \multicolumn{2}{@{}C{\headerwidth}@{}}{\Huge\PaperCode, \TeachingPeriod\ \YearOffered} \\[0.8\pgfphysicalheight]% % A skip of 0.8\pgfphysicalheight looks about right. \ClassType\ \thechapter: \ShortClassTitle\ --- Notes & \the\numexpr(\thepage-1)/6+1 \\% \end{tabular*}% }% \fi% \bg@material% } \makeatother \endinput
\def\filedate{24 March 2021} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Document class for lecture slide notes. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Version History % v1.0 Initial version, rebuilt from deprecated lecturenotes class. % v1.0.1 Corrected page number generation. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e}[2001/06/01] \ProvidesClass{otagonotes}% [2021/03/24 INFO lecture notes style, v1.0.1] \DeclareOption*{\PassOptionsToClass{\CurrentOption}{otagoslides}} \ProcessOptions \LoadClass{otagoslides} % Load required packages. \RequirePackage{array} \RequirePackage{background} \RequirePackage{pgfpages} \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. \renewcommand{\inithyperref}{% \hypersetup{% pdftitle={\PaperCode\ \ClassType\ \thechapter\ Speaker Notes},% pdfsubject={\ShortClassTitle},% colorlinks=false% }% } % Set up notes 6-up page layout using pgfpages. % This only looks good in portrait, but then it's not intended for % any other layout anyway... \pgfpagesdeclarelayout{notes 6up}{% \edef\pgfpageoptionheight{\the\paperwidth} % landscaped by default \edef\pgfpageoptionwidth{\the\paperheight}% \def\pgfpageoptionborder{0pt}% }{% \pgfpagesphysicalpageoptions{% logical pages=6,% physical height=\pgfpageoptionheight,% physical width=\pgfpageoptionwidth,% }% \pgfpageslogicalpageoptions{1} {% border shrink=\pgfpageoptionborder,% resized width=.5\pgfphysicalwidth,% resized height=.25\pgfphysicalheight,% center=\pgfpoint{.26\pgfphysicalwidth}{.76\pgfphysicalheight}% }% \pgfpageslogicalpageoptions{2} {% border shrink=\pgfpageoptionborder,% resized width=.5\pgfphysicalwidth,% resized height=.25\pgfphysicalheight,% center=\pgfpoint{.74\pgfphysicalwidth}{.76\pgfphysicalheight}% }% \pgfpageslogicalpageoptions{3} {% border shrink=\pgfpageoptionborder,% resized width=.5\pgfphysicalwidth,% resized height=.25\pgfphysicalheight,% center=\pgfpoint{.26\pgfphysicalwidth}{.5\pgfphysicalheight}% }% \pgfpageslogicalpageoptions{4} {% border shrink=\pgfpageoptionborder,% resized width=.5\pgfphysicalwidth,% resized height=.25\pgfphysicalheight,% center=\pgfpoint{.74\pgfphysicalwidth}{.5\pgfphysicalheight}% }% \pgfpageslogicalpageoptions{5} {% border shrink=\pgfpageoptionborder,% resized width=.5\pgfphysicalwidth,% resized height=.25\pgfphysicalheight,% center=\pgfpoint{.26\pgfphysicalwidth}{.24\pgfphysicalheight}% }% \pgfpageslogicalpageoptions{6} {% border shrink=\pgfpageoptionborder,% resized width=.5\pgfphysicalwidth,% resized height=.25\pgfphysicalheight,% center=\pgfpoint{.74\pgfphysicalwidth}{.24\pgfphysicalheight}% }% } \pgfpagesuselayout{notes 6up}[a4paper] % Set transparent slide background colour. \setbeamercolor{background canvas}{bg=} % Set up "headers" and "footers". Because pgfpages converts the original % pages to logical pages, we can't use normal techniques like fancyhdr, % because that will get applied to the logical pages, not the physical % ones. We therefore use a slightly bizarre hack with the background % package and a tabular to dangle the "header" and "footer" off the % first logical page. % (Adapted from <https://tex.stackexchange.com/a/83270>.) \newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} \newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} \newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} \newlength{\headerwidth} % Determined empirically for A4 paper. \setlength{\headerwidth}{0.85\pgfphysicalwidth+1mm} \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.53\pgfphysicalheight} \SetBgHshift{0.134\pgfphysicalwidth} \SetBgContents{} \makeatletter \AddEverypageHook{% % 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{2\headerwidth/3}@{}R{\headerwidth/3}@{}}% \multicolumn{2}{@{}C{\headerwidth}@{}}{\Huge\PaperCode, \TeachingPeriod\ \YearOffered} \\[0.8\pgfphysicalheight]% % A skip of 0.8\pgfphysicalheight looks about right. \ClassType\ \thechapter: \ShortClassTitle\ --- Notes & \the\numexpr(\thepage-1)/6+1 \\% \end{tabular*}% }% \fi% \bg@material% } \makeatother \endinput
Ignore Space
Show notes
View
lectures/otagoslides.cls
\def\classdate{12 December 2024} \def\classversion{1.4.1} \def\classshortdate{2024/12/12} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Document class for lecture slides. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Version History % v1.0 Initial version, rebuilt from deprecated lectureslides class. % v1.0.1 Stopped hyperref complaining about invalid tokens in PDF metadata. % v1.1 Added bibliography customisations. % v1.2 Switched to fontawesome5. % v1.3 Revamped colour control. % v1.3.1 fontawesome5 no longer defaults to regular style. % v1.4 Generalised department type. % v1.4.1 Normalised package info messages. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e}[2001/06/01] \ProvidesClass{otagoslides}% [\classdate\space v\classversion\space Otago lecture slides] % "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 represents the class number). \newif\if@chapters \@chapterstrue \DeclareOption{nochapters}{\@chaptersfalse} \DeclareOption*{\PassOptionsToClass{\CurrentOption}{beamer}} \ProcessOptions \LoadClass{beamer} % Load required packages. \RequirePackage{tikz} % \RequirePackage{pgf} % DEPRECATED: only included for backwards compatibility \RequirePackage[normalem]{ulem} \RequirePackage{pifont} \RequirePackage{xr} \RequirePackage{multido} \RequirePackage{boxedminipage} \RequirePackage{graphicx} \RequirePackage{hyperref} \RequirePackage{otagofonts} % \RequirePackage{otagologo} % fontawesome5 must load after otagofonts to avoid fontspec option clash \RequirePackage{fontawesome5} % Check that the UO logo files are installed somewhere in the TeX path. \IfFileExists{OU-Logo-Colour.pdf}{}{% \PackageError{otagoslides}{The University of Otago logo images are not installed}{% You should be able to download a bundle of the UO logo images from\MessageBreak% the same place you got this document class. The files should be\MessageBreak% put in a folder somewhere inside your local LaTeX tree.% } } \hypersetup{% pdfpagemode=UseNone,% colorlinks=true,% linkcolor=,% anchorcolor=,% citecolor=,% filecolor=,% menucolor=,% runcolor=,% urlcolor=blue% } % graphicx setup. \graphicspath{{images/}} % Simple code listing setup. \newcommand{\keyword}[1]{\texttt{\uppercase{#1}}} \newcommand{\nonterminal}[1]{\textit{\texttt{#1}}} % Note: maximum 13 tab stops in a tabbing environment. (Bah.) \newenvironment{codesyntaxblock}[1][\normalsize]% {\begingroup\ttfamily#1\begin{tabbing}mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=\kill}% {\end{tabbing}\endgroup} % Environment for boxed exercises. \newcounter{exercise} \setcounter{exercise}{0} % Arguments: #1 width of box to set the exercise text in (defaults to \columnwidth). \newenvironment{exercise}[1][\columnwidth]% {\noindent\refstepcounter{exercise}\begin{boxedminipage}{#1}\textbf{Exercise \theexercise: }}% {\end{boxedminipage}} % Starred form produces an unnumbered exercise. \newenvironment{exercise*}[1][\columnwidth]% {\noindent\begin{boxedminipage}{#1}\textbf{Exercise: }}% {\end{boxedminipage}} % Standard variables for various things, and macros for initialising them. % These can be used (or not) as necessary. % Paper variables: subject code. \newcommand{\SubjectCode}{UNDEFINED} \newcommand{\SetSubjectCode}[1]{\renewcommand{\SubjectCode}{#1}} % Paper number. \newcommand{\PaperNumber}{UNDEFINED} \newcommand{\SetPaperNumber}[1]{\renewcommand{\PaperNumber}{#1}} % Convenience macro for printing out the full paper code. \newcommand{\PaperCode}{\SubjectCode~\PaperNumber} % Paper title. \newcommand{\PaperTitle}{UNDEFINED} \newcommand{\SetPaperTitle}[1]{\renewcommand{\PaperTitle}{#1}} % Department name. \newcommand{\DepartmentType}{Department of} \newcommand{\SetDepartmentType}[1]{\renewcommand{\DepartmentType}{#1}} % Department name. \newcommand{\DepartmentName}{UNDEFINED} \newcommand{\SetDepartmentName}[1]{\renewcommand{\DepartmentName}{#1}} % Teaching period. \newcommand{\TeachingPeriod}{UNDEFINED} \newcommand{\SetTeachingPeriod}[1]{\renewcommand{\TeachingPeriod}{#1}} % Year offered. \newcommand{\YearOffered}{UNDEFINED} \newcommand{\SetYearOffered}[1]{\renewcommand{\YearOffered}{#1}} % Oracle version. \newcommand{\Oracle}{UNDEFINED} \newcommand{\SetOracleVersion}[1]{\renewcommand{\Oracle}{#1}} % Class number. \newcounter{chapterplusone} \newcommand{\ClassNumber}{\thechapter} \newcommand{\ClassNumberPlusOne}{\thechapterplusone} \newcommand{\SetClassNumber}[1]{% \setcounter{chapter}{#1}% \setcounter{chapterplusone}{#1}% \stepcounter{chapterplusone}% } % Backwards compatibility with the old syntax % \newcommand{\ChapterNumber}{\ClassNumber} % \newcommand{\ChapterNumberPlusOne}{\ClassNumberPlusOne} % \newcommand{\SetChapterNumber}[1]{\SetClassNumber{#1}} % Class title. \newcommand{\ClassTitle}{UNDEFINED} \newcommand{\SetClassTitle}[1]{\renewcommand{\ClassTitle}{#1}} \newcommand{\ShortClassTitle}{UNDEFINED} \newcommand{\SetShortClassTitle}[1]{\renewcommand{\ShortClassTitle}{#1}} % Backwards compatibility with the old syntax % \newcommand{\ChapterTitle}{\ClassTitle} % \newcommand{\SetChapterTitle}[1]{\SetClassTitle{#1}} % \newcommand{\ShortChapterTitle}{\ShortClassTitle} % \newcommand{\SetShortChapterTitle}[1]{\SetShortClassTitle{#1}} % Class type. \newcommand{\ClassType}{Lecture} \newcommand{\SetClassType}[1]{\renewcommand{\ClassType}{#1}} % Beamer setup. \mode<presentation> { \usetheme{OtagoPlain} \setbeamertemplate{navigation symbols}{} } \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\ Slides},% pdfsubject={\ShortClassTitle}% }% } % Disable certain commands in PDF metadata to stop hyperref complaining % about invalid tokens. This is caused by \insertchapternumber in the % Otago Beamer theme, which calls \usebeamerfont and \usebeamercolor. \pdfstringdefDisableCommands{% \def\usebeamercolor#1{}% \def\usebeamerfont#1{}% } % Document setup. \author{} \if@chapters \title{\PaperCode} \else \title{\PaperCode \\ \PaperTitle} \fi \subtitle{\ClassType\ \insertchapternumber: \ClassTitle} \institute{\DepartmentType\ \DepartmentName} \date{\TeachingPeriod, \YearOffered} % Some useful miscellaneous macros. % B-I-G braces {} with a text label % % Arguments: [#1] height of brace; if missing, defaults to the height of the label box % {#2} width of box for label % {#3} the text of the label % % TODO: This could possibly be refactored into a single macro with a l/r argument? \newcommand{\BIGL}[3][]{% \( \left\}% \ifx&\else\parbox[c][#1]{0cm}{}\right.\fi% \begin{minipage}{#2}\flushleft\mbox{}#3\end{minipage}% \ifx&\right.\fi% \)% } \newcommand{\BIGR}[3][]{% \( \ifx&\left.\fi% \begin{minipage}{#2}\flushright\mbox{}#3\end{minipage}% \ifx&\else\left.\parbox[c][#1]{0cm}{}\fi% \right\{% \)% } % Bold-face text using the structure or alert colour. \newcommand<>{\structurebf}[1]{\structure#2{\textbf{#1}}} \newcommand<>{\alertbf}[1]{\alert#2{\textbf{#1}}} % Define the standard beamer colours as actual colours, as we use them % in \color and \textcolor rather a lot. \usebeamercolor*[fg]{structure}\colorlet{beamerstructure}{fg} \usebeamercolor*[fg]{alerted text}\colorlet{beameralert}{fg} % Beamer-aware strikeout. \newcommand<>{\strikeout}[1]{\alt#2{\sout{#1}}{#1}} % Coloured highlighting of text (via Mark George). % \vphantom gives correct ascender and descender height for box. \newcommand{\highlight}[2][yellow!75]{\setlength{\fboxsep}{1pt}\hskip-1pt\colorbox{#1}{\vphantom{dy}#2}\hskip-1pt} % Uses the same spacing as \highlight, but does no highlighting. Use on the % original code when using incremental highlighting. \newcommand{\nohighlight}[1]{\highlight[white!0]{#1}} \newcommand{\error}[1]{\highlight[red!75]{#1}} % Create an "invisible" cell in a table for consistent spacing purposes. % It does so by taking the width of the supplied text and generating an % empty box 1pt wider. \newcommand{\InvisibleCell}[2]{% \multicolumn{1}{#1}{\makebox[\widthof{#2} + 1pt]{}}% } % Draw a grid to aid PGF picture drawing/debugging. % DEPRECATED: Use \DrawGridTikZ instead. \newcommand{\DrawGrid}[2]{% \begin{pgfscope}% \color{lightgray}% \pgfsetlinewidth{0.5pt}% \pgfpathgrid[step={\pgfxy(0.2,0.2)}]{\pgfxy(0,0)}{\pgfxy(#1,#2)}% \pgfusepath{stroke}% \pgfsetlinewidth{1pt}% \pgfpathgrid[step={\pgfxy(1,1)}]{\pgfxy(-0.1,-0.1)}{\pgfxy(#1+0.1,#2+0.1)}% \pgfusepath{stroke}% \pgfputat{\pgfxy(0,-0.2)}{\pgfbox[center,top]{\tiny 0}}% \pgfputat{\pgfxy(-0.2,0)}{\pgfbox[right,center]{\tiny 0}}% \multido{\nx=1+1}{#1}{\pgfputat{\pgfxy(\nx,-0.2)}{\pgfbox[center,top]{\tiny\nx}}}% \multido{\ny=1+1}{#2}{\pgfputat{\pgfxy(-0.2,\ny)}{\pgfbox[right,center]{\tiny\ny}}}% \end{pgfscope}% } % Draw a grid to aid TikZ picture drawing/debugging. \newcommand{\DrawGridTikZ}[2]{% \begin{scope}[color=lightgray] \draw[thin,step=1mm] (0.0,0.0) grid (#1,#2);% \draw[thick,step=1cm] (-0.1,-0.1) grid (#1+0.1,#2+0.1);% \pgftext[top,at={\pgfxy(0.0,-0.2)}]{\tiny 0}% \pgftext[right,at={\pgfxy(-0.2,0.0)}]{\tiny 0}% \foreach \x in {1,...,#1} {\pgftext[top,at={\pgfxy(\x,-0.2)}]{\tiny\x}}% \foreach \y in {1,...,#2} {\pgftext[right,at={\pgfxy(-0.2,\y)}]{\tiny\y}}% \end{scope} } % For numbered notes, add note number references to the slides when generating notes. \ifbeamer@notes \newcounter{noteitem}[page] \newcommand<>{\noteitem}[1]{\only#2{\refstepcounter{noteitem}\unskip\ \fbox{\textbf{\scriptsize\thenoteitem}}\note[item]{#1}}} \else \newcommand<>{\noteitem}[1]{\only#2{\note[item]{#1}}} \fi % Sometimes we want to put a comment in tiny text on the next line, but the default line skip % will insert too much vertical space. Put a \tinyskip at the end of the line instead. \def\tinyskip{\\[-0.33\baselineskip]} % Increase item separation of level 1 list items. Can't use enumitem because it breaks beamer lists :(. % See: <https://tex.stackexchange.com/a/31524> \makeatletter \patchcmd{\@listI}{\itemsep3\p@}{\itemsep6\p@}{}{} \makeatother % Bibliography customisations for beamer. Uses FontAwesome icons. % Use: \setbeamertemplate{bibliography item}[faArticle] \setbeamercolor{bibliography item}{use=normal text,fg=normal text.fg} \setbeamercolor{bibliography entry author}{use=normal text,fg=normal text.fg} \setbeamercolor{bibliography entry location}{use=normal text,fg=normal text.fg} \setbeamercolor{bibliography entry note}{use=normal text,fg=normal text.fg} \setbeamertemplate{bibliography entry title}{} \setbeamertemplate{bibliography entry location}{} \setbeamertemplate{bibliography entry note}{} \defbeamertemplate{bibliography item}{faArticle}{\hfill\faNewspaper} \defbeamertemplate{bibliography item}{faBook}{\hfill\faBook} \defbeamertemplate{bibliography item}{faDocument}{\hfill\faFile*} \defbeamertemplate{bibliography item}{faImage}{\hfill\faImage} \defbeamertemplate{bibliography item}{faLink}{\hfill\faLink} \defbeamertemplate{bibliography item}{faMovie}{\hfill\faFilm} \defbeamertemplate{bibliography item}{faWeb}{\hfill\faCloud} \defbeamertemplate{bibliography item}{faWikipedia}{\hfill\faWikipediaW} \endinput
\def\filedate{2 May 2024} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Document class for lecture slides. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Version History % v1.0 Initial version, rebuilt from deprecated lectureslides class. % v1.0.1 Stopped hyperref complaining about invalid tokens in PDF metadata. % v1.1 Added bibliography customisations. % v1.2 Switched to fontawesome5 % v1.3 Revamped colour control % v1.3.1 fontawesome5 no longer defaults to regular style % v1.4 Generalised department type % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e}[2001/06/01] \ProvidesClass{otagoslides}% [2024/05/02 Otago lecture slides style, v.1.4] % "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 represents the class number). \newif\if@chapters \@chapterstrue \DeclareOption{nochapters}{\@chaptersfalse} \DeclareOption*{\PassOptionsToClass{\CurrentOption}{beamer}} \ProcessOptions \LoadClass{beamer} % Load required packages. \RequirePackage{tikz} % \RequirePackage{pgf} % DEPRECATED: only included for backwards compatibility \RequirePackage[normalem]{ulem} \RequirePackage{pifont} \RequirePackage{xr} \RequirePackage{multido} \RequirePackage{boxedminipage} \RequirePackage{graphicx} \RequirePackage{hyperref} \RequirePackage{otagofonts} % \RequirePackage{otagologo} % fontawesome5 must load after otagofonts to avoid fontspec option clash \RequirePackage{fontawesome5} % Check that the UO logo files are installed somewhere in the TeX path. \IfFileExists{OU-Logo-Colour.pdf}{}{% \PackageError{otagoslides}{The University of Otago logo images are not installed}{% You should be able to download a bundle of the UO logo images from\MessageBreak% the same place you got this document class. The files should be\MessageBreak% put in a folder somewhere inside your local LaTeX tree.% } } \hypersetup{% pdfpagemode=UseNone,% colorlinks=true,% linkcolor=,% anchorcolor=,% citecolor=,% filecolor=,% menucolor=,% runcolor=,% urlcolor=blue% } % graphicx setup. \graphicspath{{images/}} % Simple code listing setup. \newcommand{\keyword}[1]{\texttt{\uppercase{#1}}} \newcommand{\nonterminal}[1]{\textit{\texttt{#1}}} % Note: maximum 13 tab stops in a tabbing environment. (Bah.) \newenvironment{codesyntaxblock}[1][\normalsize]% {\begingroup\ttfamily#1\begin{tabbing}mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=\kill}% {\end{tabbing}\endgroup} % Environment for boxed exercises. \newcounter{exercise} \setcounter{exercise}{0} % Arguments: #1 width of box to set the exercise text in (defaults to \columnwidth). \newenvironment{exercise}[1][\columnwidth]% {\noindent\refstepcounter{exercise}\begin{boxedminipage}{#1}\textbf{Exercise \theexercise: }}% {\end{boxedminipage}} % Starred form produces an unnumbered exercise. \newenvironment{exercise*}[1][\columnwidth]% {\noindent\begin{boxedminipage}{#1}\textbf{Exercise: }}% {\end{boxedminipage}} % Standard variables for various things, and macros for initialising them. % These can be used (or not) as necessary. % Paper variables: subject code. \newcommand{\SubjectCode}{UNDEFINED} \newcommand{\SetSubjectCode}[1]{\renewcommand{\SubjectCode}{#1}} % Paper number. \newcommand{\PaperNumber}{UNDEFINED} \newcommand{\SetPaperNumber}[1]{\renewcommand{\PaperNumber}{#1}} % Convenience macro for printing out the full paper code. \newcommand{\PaperCode}{\SubjectCode~\PaperNumber} % Paper title. \newcommand{\PaperTitle}{UNDEFINED} \newcommand{\SetPaperTitle}[1]{\renewcommand{\PaperTitle}{#1}} % Department name. \newcommand{\DepartmentType}{Department of} \newcommand{\SetDepartmentType}[1]{\renewcommand{\DepartmentType}{#1}} % Department name. \newcommand{\DepartmentName}{UNDEFINED} \newcommand{\SetDepartmentName}[1]{\renewcommand{\DepartmentName}{#1}} % Teaching period. \newcommand{\TeachingPeriod}{UNDEFINED} \newcommand{\SetTeachingPeriod}[1]{\renewcommand{\TeachingPeriod}{#1}} % Year offered. \newcommand{\YearOffered}{UNDEFINED} \newcommand{\SetYearOffered}[1]{\renewcommand{\YearOffered}{#1}} % Oracle version. \newcommand{\Oracle}{UNDEFINED} \newcommand{\SetOracleVersion}[1]{\renewcommand{\Oracle}{#1}} % Class number. \newcounter{chapterplusone} \newcommand{\ClassNumber}{\thechapter} \newcommand{\ClassNumberPlusOne}{\thechapterplusone} \newcommand{\SetClassNumber}[1]{% \setcounter{chapter}{#1}% \setcounter{chapterplusone}{#1}% \stepcounter{chapterplusone}% } % Backwards compatibility with the old syntax % \newcommand{\ChapterNumber}{\ClassNumber} % \newcommand{\ChapterNumberPlusOne}{\ClassNumberPlusOne} % \newcommand{\SetChapterNumber}[1]{\SetClassNumber{#1}} % Class title. \newcommand{\ClassTitle}{UNDEFINED} \newcommand{\SetClassTitle}[1]{\renewcommand{\ClassTitle}{#1}} \newcommand{\ShortClassTitle}{UNDEFINED} \newcommand{\SetShortClassTitle}[1]{\renewcommand{\ShortClassTitle}{#1}} % Backwards compatibility with the old syntax % \newcommand{\ChapterTitle}{\ClassTitle} % \newcommand{\SetChapterTitle}[1]{\SetClassTitle{#1}} % \newcommand{\ShortChapterTitle}{\ShortClassTitle} % \newcommand{\SetShortChapterTitle}[1]{\SetShortClassTitle{#1}} % Class type. \newcommand{\ClassType}{Lecture} \newcommand{\SetClassType}[1]{\renewcommand{\ClassType}{#1}} % Beamer setup. \mode<presentation> { \usetheme{OtagoPlain} \setbeamertemplate{navigation symbols}{} } \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\ Slides},% pdfsubject={\ShortClassTitle}% }% } % Disable certain commands in PDF metadata to stop hyperref complaining % about invalid tokens. This is caused by \insertchapternumber in the % Otago Beamer theme, which calls \usebeamerfont and \usebeamercolor. \pdfstringdefDisableCommands{% \def\usebeamercolor#1{}% \def\usebeamerfont#1{}% } % Document setup. \author{} \if@chapters \title{\PaperCode} \else \title{\PaperCode \\ \PaperTitle} \fi \subtitle{\ClassType\ \insertchapternumber: \ClassTitle} \institute{\DepartmentType\ \DepartmentName} \date{\TeachingPeriod, \YearOffered} % Some useful miscellaneous macros. % B-I-G braces {} with a text label % % Arguments: [#1] height of brace; if missing, defaults to the height of the label box % {#2} width of box for label % {#3} the text of the label % % TODO: This could possibly be refactored into a single macro with a l/r argument? \newcommand{\BIGL}[3][]{% \( \left\}% \ifx&\else\parbox[c][#1]{0cm}{}\right.\fi% \begin{minipage}{#2}\flushleft\mbox{}#3\end{minipage}% \ifx&\right.\fi% \)% } \newcommand{\BIGR}[3][]{% \( \ifx&\left.\fi% \begin{minipage}{#2}\flushright\mbox{}#3\end{minipage}% \ifx&\else\left.\parbox[c][#1]{0cm}{}\fi% \right\{% \)% } % Bold-face text using the structure or alert colour. \newcommand<>{\structurebf}[1]{\structure#2{\textbf{#1}}} \newcommand<>{\alertbf}[1]{\alert#2{\textbf{#1}}} % Define the standard beamer colours as actual colours, as we use them % in \color and \textcolor rather a lot. \usebeamercolor*[fg]{structure}\colorlet{beamerstructure}{fg} \usebeamercolor*[fg]{alerted text}\colorlet{beameralert}{fg} % Beamer-aware strikeout. \newcommand<>{\strikeout}[1]{\alt#2{\sout{#1}}{#1}} % Coloured highlighting of text (via Mark George). % \vphantom gives correct ascender and descender height for box. \newcommand{\highlight}[2][yellow!75]{\setlength{\fboxsep}{1pt}\hskip-1pt\colorbox{#1}{\vphantom{dy}#2}\hskip-1pt} % Uses the same spacing as \highlight, but does no highlighting. Use on the % original code when using incremental highlighting. \newcommand{\nohighlight}[1]{\highlight[white!0]{#1}} \newcommand{\error}[1]{\highlight[red!75]{#1}} % Create an "invisible" cell in a table for consistent spacing purposes. % It does so by taking the width of the supplied text and generating an % empty box 1pt wider. \newcommand{\InvisibleCell}[2]{% \multicolumn{1}{#1}{\makebox[\widthof{#2} + 1pt]{}}% } % Draw a grid to aid PGF picture drawing/debugging. % DEPRECATED: Use \DrawGridTikZ instead. \newcommand{\DrawGrid}[2]{% \begin{pgfscope}% \color{lightgray}% \pgfsetlinewidth{0.5pt}% \pgfpathgrid[step={\pgfxy(0.2,0.2)}]{\pgfxy(0,0)}{\pgfxy(#1,#2)}% \pgfusepath{stroke}% \pgfsetlinewidth{1pt}% \pgfpathgrid[step={\pgfxy(1,1)}]{\pgfxy(-0.1,-0.1)}{\pgfxy(#1+0.1,#2+0.1)}% \pgfusepath{stroke}% \pgfputat{\pgfxy(0,-0.2)}{\pgfbox[center,top]{\tiny 0}}% \pgfputat{\pgfxy(-0.2,0)}{\pgfbox[right,center]{\tiny 0}}% \multido{\nx=1+1}{#1}{\pgfputat{\pgfxy(\nx,-0.2)}{\pgfbox[center,top]{\tiny\nx}}}% \multido{\ny=1+1}{#2}{\pgfputat{\pgfxy(-0.2,\ny)}{\pgfbox[right,center]{\tiny\ny}}}% \end{pgfscope}% } % Draw a grid to aid TikZ picture drawing/debugging. \newcommand{\DrawGridTikZ}[2]{% \begin{scope}[color=lightgray] \draw[thin,step=1mm] (0.0,0.0) grid (#1,#2);% \draw[thick,step=1cm] (-0.1,-0.1) grid (#1+0.1,#2+0.1);% \pgftext[top,at={\pgfxy(0.0,-0.2)}]{\tiny 0}% \pgftext[right,at={\pgfxy(-0.2,0.0)}]{\tiny 0}% \foreach \x in {1,...,#1} {\pgftext[top,at={\pgfxy(\x,-0.2)}]{\tiny\x}}% \foreach \y in {1,...,#2} {\pgftext[right,at={\pgfxy(-0.2,\y)}]{\tiny\y}}% \end{scope} } % For numbered notes, add note number references to the slides when generating notes. \ifbeamer@notes \newcounter{noteitem}[page] \newcommand<>{\noteitem}[1]{\only#2{\refstepcounter{noteitem}\unskip\ \fbox{\textbf{\scriptsize\thenoteitem}}\note[item]{#1}}} \else \newcommand<>{\noteitem}[1]{\only#2{\note[item]{#1}}} \fi % Sometimes we want to put a comment in tiny text on the next line, but the default line skip % will insert too much vertical space. Put a \tinyskip at the end of the line instead. \def\tinyskip{\\[-0.33\baselineskip]} % Increase item separation of level 1 list items. Can't use enumitem because it breaks beamer lists :(. % See: <https://tex.stackexchange.com/a/31524> \makeatletter \patchcmd{\@listI}{\itemsep3\p@}{\itemsep6\p@}{}{} \makeatother % Bibliography customisations for beamer. Uses FontAwesome icons. % Use: \setbeamertemplate{bibliography item}[faArticle] \setbeamercolor{bibliography item}{use=normal text,fg=normal text.fg} \setbeamercolor{bibliography entry author}{use=normal text,fg=normal text.fg} \setbeamercolor{bibliography entry location}{use=normal text,fg=normal text.fg} \setbeamercolor{bibliography entry note}{use=normal text,fg=normal text.fg} \setbeamertemplate{bibliography entry title}{} \setbeamertemplate{bibliography entry location}{} \setbeamertemplate{bibliography entry note}{} \defbeamertemplate{bibliography item}{faArticle}{\hfill\faNewspaper} \defbeamertemplate{bibliography item}{faBook}{\hfill\faBook} \defbeamertemplate{bibliography item}{faDocument}{\hfill\faFile*} \defbeamertemplate{bibliography item}{faImage}{\hfill\faImage} \defbeamertemplate{bibliography item}{faLink}{\hfill\faLink} \defbeamertemplate{bibliography item}{faMovie}{\hfill\faFilm} \defbeamertemplate{bibliography item}{faWeb}{\hfill\faCloud} \defbeamertemplate{bibliography item}{faWikipedia}{\hfill\faWikipediaW} \endinput
Show line notes below