| 1 |
% From mitthesis package |
| 2 |
% Documentation: https://ctan.org/pkg/mitthesis |
| 3 |
|
| 4 |
\ProvidesFile{mitthesis-libertinus.tex}[2025/09/23 v1.02 Load Libertinus and related fonts] |
| 5 |
|
| 6 |
%% Libertinus (serif) text font with newtxmath[libertinus] (pdftex) or Libertinus (unicode) math 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 |
% https://ctan.org/tex-archive/fonts/libertine/opentype |
| 11 |
% https://github.com/alerque/libertinus |
| 12 |
% |
| 13 |
\ifpdftex |
| 14 |
\ClassNoteNoLine{\ClassName}{Loading Libertinus type1 text fonts and newtx-libertinus math fonts} |
| 15 |
\RequirePackage[T1]{fontenc} |
| 16 |
\RequirePackage[lf,t,semibold,ScaleTT=0.9]{libertinus} % tabular lining figures |
| 17 |
\RequirePackage[libertinus,vvarbb,subscriptcorrection]{newtxmath}% see package documentation for options |
| 18 |
\RequirePackage{bm}% load after all math to give access to bold math |
| 19 |
\else |
| 20 |
\ClassNoteNoLine{\ClassName}{Loading Libertinus OTF text and math fonts} |
| 21 |
% |
| 22 |
\RequirePackage[warnings-off={mathtools-colon,mathtools-overbracket},mathbf=sym]{unicode-math} |
| 23 |
% suppress warnings about lack of integration between mathtools and unicode-math |
| 24 |
% unicode math loads the fontspec package |
| 25 |
% |
| 26 |
\setmainfont{LibertinusSerif}[% |
| 27 |
Extension = .otf, |
| 28 |
UprightFont = *-Regular, |
| 29 |
ItalicFont = *-Italic, |
| 30 |
BoldFont = *-Semibold, |
| 31 |
BoldItalicFont = *-SemiboldItalic, |
| 32 |
RawFeature={+ss05,+dlig,+tnum,+liga}, |
| 33 |
% +ss02 would change J, K, R; +ss05 changes W; onum = oldstyle figures; hlig = historical ligatures |
| 34 |
] |
| 35 |
\setsansfont{LibertinusSans}[% |
| 36 |
Extension = .otf, |
| 37 |
UprightFont = *-Regular, |
| 38 |
ItalicFont = *-Italic, |
| 39 |
BoldFont = *-Bold, |
| 40 |
BoldItalicFont = *-Bold,% does not have bold italic |
| 41 |
Scale=MatchUppercase, |
| 42 |
RawFeature={+liga,}, |
| 43 |
] |
| 44 |
% |
| 45 |
\setmonofont{LibertinusMono}[% |
| 46 |
Scale=0.9,% 2024/10/13 |
| 47 |
Extension = .otf, |
| 48 |
UprightFont = *-Regular, |
| 49 |
ItalicFont = *-Regular,% does not have italic |
| 50 |
BoldFont = *-Regular,% does not have bold |
| 51 |
BoldItalicFont = *-Regular,% does not have bold italic |
| 52 |
] |
| 53 |
% |
| 54 |
\newfontfamily\LibertinusDisplay{LibertinusSerifDisplay-Regular.otf}% a display font, as for titles |
| 55 |
% |
| 56 |
\newfontfamily\LibertinusInitials{LibertinusSerifInitials-Regular.otf}% Large initial letters, as for first word in chapter |
| 57 |
% |
| 58 |
%% a Libertinus math font |
| 59 |
\setmathfont{libertinusmath-regular}[% |
| 60 |
Extension = .otf, |
| 61 |
Scale=MatchUppercase, |
| 62 |
% BoldFont = *,% This font lacks a bold version; you could use FakeBold as a stand in |
| 63 |
RawFeature={+ss08},% +ss08 gives slanted integrals (no other features) |
| 64 |
] |
| 65 |
\setmathfont{Latin Modern Math}[range=\nabla,Scale=0.91] % I hate the backward nabla in Libertinus Math... |
| 66 |
|
| 67 |
\newcommand*{\FRAC}[1]{{\addfontfeature{Fractions=On}#1}}% use OpenType feature for fractions, \FRAC{1/2} |
| 68 |
\fi |