| 1 |
% From mitthesis package |
| 2 |
% Documentation: https://ctan.org/pkg/mitthesis |
| 3 |
|
| 4 |
\ProvidesFile{mitthesis-termes-stix2.tex}[2025/09/23 v1.08 Load TeX Gyre Termes text font with STIX2 math font, Heros sans serif font, and Inconsolata monospaced font] |
| 5 |
|
| 6 |
%% TeX Gyre Termes text font and Heros sans serif font with STIX2 math font and Inconsolata monospaced font |
| 7 |
% |
| 8 |
% These fonts are in TeX Live and on CTAN. They are included in a complete LaTeX installation. |
| 9 |
% They are also available at: |
| 10 |
% http://www.gust.org.pl/projects/e-foundry/tex-gyre |
| 11 |
% https://github.com/stipub/stixfonts |
| 12 |
% https://ctan.org/tex-archive/fonts/inconsolata |
| 13 |
% |
| 14 |
\ifpdftex |
| 15 |
\ClassError{\ClassName}{The termes-stix2 fontset requires a unicode engine. Defaulting to CMR fonts}{To use the class option [fontset=termes-stix2], use a unicode engine such as LuaLaTeX.} |
| 16 |
\RequirePackage[T1]{fontenc} |
| 17 |
\RequirePackage{bm} |
| 18 |
\else |
| 19 |
\ClassNoteNoLine{\ClassName}{Loading TeX Gyre Termes text font with STIX2 math font, Heros sans serif font, and Inconsolata monospaced font} |
| 20 |
% |
| 21 |
\RequirePackage[warnings-off={mathtools-colon,mathtools-overbracket},mathbf=sym]{unicode-math} |
| 22 |
% suppress warnings about lack of integration between mathtools and unicode-math |
| 23 |
% unicode-math loads the fontspec package |
| 24 |
% |
| 25 |
\setmainfont{TeXGyreTermesX}[ |
| 26 |
WordSpace = {1,1.4,1},%% This stretch matches newtxtext a little better. 1.4 |
| 27 |
Extension = .otf, |
| 28 |
UprightFont = *-Regular, |
| 29 |
ItalicFont = *-Italic, |
| 30 |
BoldFont = *-Bold, |
| 31 |
BoldItalicFont = *-BoldItalic, |
| 32 |
SlantedFont = *-Italic, |
| 33 |
Numbers = Lining, |
| 34 |
] |
| 35 |
\setsansfont{texgyreheros}[ |
| 36 |
WordSpace = {1,1.4,1}, |
| 37 |
Extension = .otf, |
| 38 |
UprightFont = *-regular, |
| 39 |
ItalicFont = *-italic, |
| 40 |
BoldFont = *-bold, |
| 41 |
BoldItalicFont = *-bolditalic, |
| 42 |
Numbers = Lining, |
| 43 |
Scale=0.91,% same as for newtx; former value 0.9 too small 2022/01/15 |
| 44 |
] |
| 45 |
\setmonofont{Inconsolatazi4}[ |
| 46 |
Scale=1,% reset to 1, 2024/10/12 %1.03,% rescaled from 1, 22/03/10 |
| 47 |
Extension = .otf, |
| 48 |
UprightFont = *-Regular, |
| 49 |
ItalicFont = *-Regular,% has no italic face |
| 50 |
BoldFont = *-Bold, |
| 51 |
BoldItalicFont = *-Bold,% has no bold italic face |
| 52 |
RawFeature = {+ss01,+ss02}, % drop +ss03 (upright quotes), 2025/04/18 |
| 53 |
] |
| 54 |
\setmathfont{STIXTwoMath-Regular}[% nice glyphs, but \mkern sometimes helpful |
| 55 |
Scale=MatchUppercase, |
| 56 |
Extension = .otf, |
| 57 |
% BoldFont = *,% STIX Two Math has no bold face |
| 58 |
% Color=NavyBlue, |
| 59 |
RawFeature = {+ss01, -ss02, -ss08}, |
| 60 |
] |
| 61 |
% ss01 -- switch calligraphic to script; +ss02 -- variants of g, u, v, w, z; +ss08 -- upright integrals |
| 62 |
% |
| 63 |
\setmathfontface\mathbf{STIXTwoText-Bold.otf}[]% to not get Termes bold |
| 64 |
\setmathfontface\mathit{STIXTwoText-Italic.otf}[] |
| 65 |
\setmathfontface\mathrm{STIXTwoText-Regular.otf}[]% to get roman letters from STIX, not Termes |
| 66 |
% |
| 67 |
\newcommand*{\FRAC}[1]{{\addfontfeature{Fractions=On}#1}}% use OpenType feature for fractions, \FRAC{1/2} |
| 68 |
\fi |