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

\ProvidesFile{mitthesis-termes-stix2.tex}[2026/11/20 v1.09 Load TeX Gyre Termes text font with STIX2 math font, Heros sans serif font, and Inconsolata monospaced font]

%% TeX Gyre Termes text font and Heros sans serif font with STIX2 math font and Inconsolata monospaced font
%
%	These fonts are in TeX Live and on CTAN. They are included in a complete LaTeX installation. 
%	They are also available at: 
%				https://www.gust.org.pl/projects/e-foundry/tex-gyre 
%				https://github.com/stipub/stixfonts 
%				https://ctan.org/tex-archive/fonts/inconsolata
%
\ifpdftex
	\ClassError{\ClassName}{The termes-stix2 fontset requires LuaLaTeX. Falling back to the default Computer Modern fonts.}{To use the class option [fontset=termes-stix2], use LuaLaTeX.}
    \LoadDefaultFonts % defined by class, loads latex defaults
\else
	\ClassNoteNoLine{\ClassName}{Loading TeX Gyre Termes text font with STIX2 math font, Heros sans serif font, and Inconsolata monospaced font}
	%
    \RequirePackage[warnings-off={mathtools-colon,mathtools-overbracket},mathbf=sym]{unicode-math}
    % suppress warnings about lack of integration between mathtools and unicode-math
    % unicode-math loads the fontspec package
	%
    \setmainfont{TeXGyreTermesX}[ % from the newtx package, not TeX Gyre (they are very similar fonts)
        WordSpace = {1,1.4,1},%% This stretch matches newtxtext a little better.
        Extension = .otf,
        UprightFont = *-Regular,
        ItalicFont = *-Italic,
        BoldFont = *-Bold,
        BoldItalicFont = *-BoldItalic,
        SlantedFont = *-Slanted,
        BoldSlantedFont = *-BoldSlanted,
        Numbers = Lining,
	]
	\setsansfont{texgyreheros}[
        WordSpace = {1,1.4,1},
        Extension = .otf,
        UprightFont = *-regular,
        ItalicFont = *-italic,
        BoldFont = *-bold,
        BoldItalicFont = *-bolditalic,
        Numbers = Lining,% default
        Scale=0.91,% same as for newtx; former value 0.9 too small 2022/01/15
	]        
	\setmonofont{Inconsolatazi4}[
        Scale=1,% reset to 1, 2024/10/12 %1.03,% rescaled from 1, 2022/03/10
        Extension = .otf,
        UprightFont = *-Regular,
        ItalicFont = *-Regular,% has no italic face
        BoldFont = *-Bold, 
        BoldItalicFont = *-Bold,% has no bold italic face
        StylisticSet={1,2}, % like RawFeature = {+ss01,+ss02}; dropped +ss03 (upright quotes), 2025/04/18
    ]             
    %%	This math font lacks a separate bold version (\symbf, \symbfit, etc. ordinarily cover most needs)
	\setmathfont{STIXTwoMath-Regular}[% nice glyphs, but \mkern sometimes helpful
    	Scale=MatchUppercase,
    	Extension = .otf,
%       Color=NavyBlue, % example of coloring a font, color name from xcolor package
    ]
    % +ss01 -- switch calligraphic to script; +ss02 -- variants of g, u, v, w, z; +ss08 -- upright integrals
    \setmathfont{STIXTwoMath-Regular}[Extension=.otf, Scale=MatchUppercase,
	    range={scr,bfscr}, StylisticSet=1] % make script and calligraphic differ
   %
%   \setmathfontface\mathbf{STIXTwoText-Bold.otf}[Scale=MatchUppercase]% to not get Termes bold -> already done by mathbf=sym
   \setmathfontface\mathit{STIXTwoText-Italic.otf}[Scale=MatchUppercase]
   \setmathfontface\mathrm{STIXTwoText-Regular.otf}[Scale=MatchUppercase]% to get roman letters from STIX, not Termes
    %      
   \newcommand*{\FRAC}[1]{{\addfontfeature{Fractions=On}#1}}% use OpenType feature for fractions, \FRAC{1/2} 
\fi
