diff --git a/lectures/otagofonts.sty b/lectures/otagofonts.sty index c2a2c81..f10ebfa 100644 --- a/lectures/otagofonts.sty +++ b/lectures/otagofonts.sty @@ -1,6 +1,6 @@ -\def\packagedate{11 December 2024} -\def\packageversion{2.0} -\def\packageshortdate{2024/12/11} +\def\packagedate{13 December 2024} +\def\packageversion{2.0.1} +\def\packageshortdate{2024/12/13} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Set up official Otago fonts based on what’s available. Fall back to reasonable @@ -9,15 +9,17 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % 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. +% 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. +% v2.0.1 Ensured LuaTeX detection occurs first and moved join operator +% substitution to relalg.sty. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -25,25 +27,24 @@ \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 ) % 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. +% also been removed. +\RequirePackage{iftex} \RequireLuaTeX +\RequirePackage{amsmath} +\RequirePackage{etoolbox} +\RequirePackage[no-math]{fontspec} +\RequirePackage{xstring} +\RequirePackage{unicode-math} % needs to go last + + % 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), @@ -86,6 +87,7 @@ \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 @@ -121,16 +123,6 @@ }% } -% 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}