| 1 |
|
| 2 |
\ProvidesPackage{minim-math}[2025/02/12 Unicode mathematics] |
| 3 |
|
| 4 |
\RequirePackage[no-math]{fontspec} |
| 5 |
|
| 6 |
% load the plain package |
| 7 |
\let\minimmathlatex=\relax |
| 8 |
\input minim-math |
| 9 |
|
| 10 |
% do not reset math fonts in everymath |
| 11 |
\let\check@mathfonts = \relax |
| 12 |
\let\mathgroup = \fam |
| 13 |
|
| 14 |
% unicode-math compatibility |
| 15 |
\let \symup = \mup |
| 16 |
\let \symbfup = \mbf |
| 17 |
\let \symbf = \mbf |
| 18 |
\let \symit = \mit |
| 19 |
\let \symbfit = \mbfit |
| 20 |
\let \symbb = \mbb |
| 21 |
\let \symscr = \scr |
| 22 |
\let \symcal = \scr |
| 23 |
\let \symbfscr = \bfscr |
| 24 |
\let \symfrak = \frak |
| 25 |
\let \symbffrak = \bffrak |
| 26 |
\def \symsfup #1{{\mathstyle{sf}}} |
| 27 |
\def \symbfsfup #1{{\mathstyle{sfbf}}} |
| 28 |
\def \symsfit #1{{\mathstyle{sfit}}} |
| 29 |
\def \symbfsfit #1{{\mathstyle{sfbfit}}} |
| 30 |
\def \symtt #1{{\mathstyle{tt}}} |
| 31 |
|
| 32 |
% more compatibility |
| 33 |
\let \mathup = \symup |
| 34 |
\let \mathbfup = \symbfup |
| 35 |
\let \mathbf = \symbf |
| 36 |
\let \mathit = \symit |
| 37 |
\let \mathbfit = \symbfit |
| 38 |
\let \mathbb = \symbb |
| 39 |
\let \mathscr = \symscr |
| 40 |
\let \mathcal = \symcal |
| 41 |
\let \mathbfscr = \symbfscr |
| 42 |
\let \mathfrak = \symfrak |
| 43 |
\let \mathbffrak = \symbffrak |
| 44 |
\let \mathsfup = \symsfup |
| 45 |
\let \mathbfsfup = \symbfsfup |
| 46 |
\let \mathsfit = \symsfit |
| 47 |
\let \mathbfsfit = \symbfsfit |
| 48 |
\let \mathtt = \symtt |
| 49 |
|
| 50 |
% \setmathfam 0 [features] {font name or file} |
| 51 |
\newcount\set@mathfamcount |
| 52 |
\protected\def\setmathfam{\afterassignment\set@mathfam\set@mathfamcount= } |
| 53 |
\newcommand\set@mathfam[2][]{% |
| 54 |
\calculate@math@sizes \csname S@\f@size\endcsname |
| 55 |
\expandafter\font\csname math main font \the\set@mathfamcount\endcsname |
| 56 |
{#2:mode=base;script=math;ssty=0;#1} at \tf@size pt |
| 57 |
\expandafter\font\csname math script font \the\set@mathfamcount\endcsname |
| 58 |
{#2:mode=base;script=math;ssty=1;#1} at \sf@size pt |
| 59 |
\expandafter\font\csname math sscript font \the\set@mathfamcount\endcsname |
| 60 |
{#2:mode=base;script=math;ssty=2;#1} at \ssf@size pt |
| 61 |
\textfont\the\set@mathfamcount |
| 62 |
\expandafter\csname math main font \the\set@mathfamcount\endcsname |
| 63 |
\scriptfont\the\set@mathfamcount |
| 64 |
\expandafter\csname math script font \the\set@mathfamcount\endcsname |
| 65 |
\scriptscriptfont\the\set@mathfamcount |
| 66 |
\expandafter\csname math sscript font \the\set@mathfamcount\endcsname} |
| 67 |
|
| 68 |
% load a default font |
| 69 |
\setmathfam 0 {Latin Modern Math} |
| 70 |
|