% From mitthesis package
% Documentation: https://ctan.org/pkg/mitthesis

% NB: This fonset *requires* a recent version of the lua-unicode-math package, preferably Sept. 2026 or later.

\ProvidesFile{mitthesis-lato-lete-sans.tex}[2026/11/23 v1.00 Load Lato text and Lete Sans math fonts with Inconsolata monospaced font and small caps from Fira Sans font]
%
%	These fonts are in TeX Live and on CTAN. They are included in a complete LaTeX installation. 
%
%   See: https://ctan.org/pkg/lato
%        https://ctan.org/pkg/lete-sans-math, many class options
%        https://ctan.org/tex-archive/fonts/inconsolata  
%
\ifpdftex
	\ClassError{\ClassName}{The lato-lete-sans fontset requires LuaLaTeX. Falling back to the default Computer Modern fonts.}{To use the class option [fontset=lato-lete-sans], use LuaLaTeX.}
    \LoadDefaultFonts % this command is defined by the class, loads latex defaults
\else
	\ClassNoteNoLine{\ClassName}{Lato text and Lete Sans math fonts with Inconsolata monospaced font and small caps from Fira Sans font}
	%
	\RequirePackage{fontspec}
    \RequirePackage[]{lum-lete-sans}                  % access Lete Sans math with the lua-unicode-math package, which was new in TL 2026, still changing.
    \setmathfont{LeteSansMath.otf}
        [
        StylisticSet={8},  % +ss01, older calligraphic letters; +ss04, leq (and similar) slanted; +ss08, upright integrals
        ]
    \@ifundefined{setmathfontversion}{}{              % not def'd in TL 2026
        \setmathfontversion{bold}{LeteSansMath-Bold}  % bold math font, \mathversion{bold}; limited glyph coverage (lua-unicode-math command)
    }
	%
	\setmainfont{Lato}[
	    WordSpace = {1,1.4,1}, % increase word spacing for readability
	    Extension = .ttf,
        UprightFont = *-Regular,
        ItalicFont = *-Italic,
        BoldFont = *-Bold,
        BoldItalicFont = *-BoldItalic,
        Numbers = Lining,
        SmallCapsFont = FiraSans-Regular.otf, % Lato does not have small caps
        SmallCapsFeatures = {Letters=SmallCaps},
        BoldFeatures = {
            SmallCapsFont = FiraSans-Bold.otf,
            SmallCapsFeatures = {Letters=SmallCaps},
            },
        ItalicFeatures = {
            SmallCapsFont = FiraSans-Italic.otf,
            SmallCapsFeatures = {Letters=SmallCaps},
            },
        BoldItalicFeatures = {
            SmallCapsFont = FiraSans-BoldItalic.otf,
            SmallCapsFeatures = {Letters=SmallCaps},
            },
        StylisticSet={}, % 4 (+ss04) - single storey g.
    ]
    
    \renewcommand*\sfdefault{\rmdefault}
    
	\setmonofont{Inconsolatazi4}[
        Scale=1,
        Extension = .otf,
        UprightFont = *-Regular,
        ItalicFont = *-Regular, % has no italic face
        BoldFont = *-Bold, 
        BoldItalicFont = *-Bold,% has no bold italic face
        StylisticSet={1,2},     % add +ss01,+ss02. Not using +ss03 (upright quotes)
    ]             
\fi
