\NeedsTeXFormat{LaTeX2e}[2022/06/01]
\def\fileversion{0.62}
\def\filedate{2026-08-24}
\ProvidesPackage{lete-sans-math}[\filedate\space\fileversion]

% Ensure luatex or xetex engine
\RequirePackage{iftex}[2019/10/24]
\RequireTUTeX

\newtoks\LeteMtoks
\newtoks\LeteScale
\newcommand*{\Letestore@KV@Option}[2]{%
  \LeteMtoks=\expandafter{\the\LeteMtoks #1={#2},}
  \def\Lete@opt{#1}%
  \def\Lete@scale{Scale}%
  \ifx\Lete@opt\Lete@scale
    \LeteScale=\expandafter{Scale={#2}}%
  \fi
}

% Package options:
\DeclareKeys
  {
   lum.if                = Lete@lum                                   ,
   tight.if              = Lete@tight                                 ,
   loose.code            = \Lete@tightfalse                           ,
   fulloldstyle.code     = \Letestore@KV@Option{Numbers}{OldStyle}    ,
   math-style.code       = \Letestore@KV@Option{math-style}{#1}       ,
   bold-style.code       = \Letestore@KV@Option{bold-style}{#1}       ,
   nabla.code            = \Letestore@KV@Option{nabla}{#1}            ,
   partial.code          = \Letestore@KV@Option{partial}{#1}          ,
   CharacterVariant.code = \Letestore@KV@Option{CharacterVariant}{#1} ,
   StylisticSet.code     = \Letestore@KV@Option{StylisticSet}{#1}     ,
   Style.code            = \Letestore@KV@Option{Style}{#1}            ,
   Scale.code            = \Letestore@KV@Option{Scale}{#1}            ,
   textrm.if             = Lete@textrm                                ,
   textit.if             = Lete@textit                                ,
   textbf.if             = Lete@textbf                                ,
   textsf.if             = Lete@textsf
  }
%
\ProcessKeyOptions
%
\ifxetex  \RequirePackage{unicode-math} \Lete@lumfalse\fi
\ifluatex
  \ifLete@lum \RequirePackage{fontspec,lua-unicode-math}
  \else       \RequirePackage{unicode-math}
  \fi
\fi
%
\newopentypefeature{Style}{mathcal}{+ss01}
\newopentypefeature{Style}{leqslant}{+ss04}
\newopentypefeature{Style}{smaller}{+ss05}
\newopentypefeature{Style}{subsetneq}{+ss06}
\newopentypefeature{Style}{parallelslant}{+ss07}
\newopentypefeature{Style}{upint}{+ss08}
\newopentypefeature{Style}{vertneg}{+ss09}
%
% Math fonts: LeteSansMath.otf, LeteSansMath-Bold.otf.
% Following Joseph Wright in https://tex.stackexchange.com/questions/451
\Letestore@KV@Option{BoldFont}{LeteSansMath-Bold.otf}
\begingroup
  \edef\temp{%
    \endgroup
    \noexpand\setmathfont{LeteSansMath.otf}%
    [\unexpanded\expandafter{\the\LeteMtoks}]%
  }
  \temp
% For Maths operators in case Lato isn't the main text font.
\begingroup
  \edef\temp{%
    \endgroup
    \ifLete@textrm\else
      \noexpand\setmathrm{Lato-Regular.ttf}%
        [\unexpanded\expandafter{\the\LeteScale}]%
    \fi
    \ifLete@textbf\else
      \noexpand\setboldmathrm{Lato-Bold.ttf}%
        [\unexpanded\expandafter{\the\LeteScale}]%
    \fi
    \ifLete@textsf\else
      \noexpand\setmathsf{Lato-Regular.ttf}%
        [\unexpanded\expandafter{\the\LeteScale}]%
    \fi
  }
  \temp
%
\ifLete@tight
  \thinmuskip=2mu
  \medmuskip=2.5mu plus 1mu minus 2.5mu
  \thickmuskip=3.5mu plus 2.5mu
\fi
%
%  For AMS symbols with lua-unicode-math.
\ifLete@lum
  \RequirePackage{amssymb}
\fi
%
% Missing Math symbols definitions
\newcount\Lete@fam
\AtBeginDocument{%
  \ifluatex \Lete@fam=\Umathcharfam"30 \fi
  % For both unicode-math and lua-unicode-math:
  % \Umathchardef\<cmd> = <math type> <family> <slot>
  % <math type> : \mathord=0 \mathbin=2 \mathrel=3 ; <family>=0
  \protected\def\varpropto{\propto}%
  \protected\def\thicksim{\sim}%
  \protected\def\thickapprox{\approx}%
  \protected\def\smallfrown{\frown}%
  \protected\def\smallsmile{\smile}%
  \Umathchardef\circledR =             0 \the\Lete@fam "24C7 \relax
  \Umathchardef\circledS =             0 \the\Lete@fam "24C8 \relax
  % LeteSansMath specific
  \Umathchardef\smallsetminus =        2 \the\Lete@fam "E060 \relax
  \Umathchardef\shortmid =             3 \the\Lete@fam "E070 \relax
  \Umathchardef\shortparallel =        3 \the\Lete@fam "E071 \relax
  \Umathchardef\nshortmid =            3 \the\Lete@fam "E072 \relax
  \Umathchardef\nshortparallel =       3 \the\Lete@fam "E073 \relax
  \Umathchardef\lvertneqq =            3 \the\Lete@fam "E002 \relax
  \Umathchardef\gvertneqq =            3 \the\Lete@fam "E003 \relax
  \Umathchardef\lesssimslant =         3 \the\Lete@fam "E004 \relax
  \Umathchardef\gtrsimslant =          3 \the\Lete@fam "E005 \relax
  \Umathchardef\varsubsetneq =         3 \the\Lete@fam "E006 \relax
  \Umathchardef\varsupsetneq =         3 \the\Lete@fam "E007 \relax
  \Umathchardef\lesseqslantgtr =       3 \the\Lete@fam "E00D \relax
  \Umathchardef\gtreqslantless =       3 \the\Lete@fam "E00E \relax
  \Umathchardef\simslantless =         3 \the\Lete@fam "E011 \relax
  \Umathchardef\simslantgtr =          3 \the\Lete@fam "E012 \relax
  \Umathchardef\smteslant =            3 \the\Lete@fam "E013 \relax
  \Umathchardef\lateslant =            3 \the\Lete@fam "E014 \relax
  \Umathchardef\varsubsetneqq =        3 \the\Lete@fam "E015 \relax
  \Umathchardef\varsupsetneqq =        3 \the\Lete@fam "E016 \relax
  \Umathchardef\lesseqqslantgtr =      3 \the\Lete@fam "E017 \relax
  \Umathchardef\gtreqqslantless =      3 \the\Lete@fam "E018 \relax
  \Umathchardef\varemptyset =          0 \the\Lete@fam "E01D \relax
  \Umathchardef\mupvarzero =           0 \the\Lete@fam "E01E \relax
  \Umathchardef\vertnotin =            3 \the\Lete@fam "E020 \relax
  \Umathchardef\vertnni =              3 \the\Lete@fam "E021 \relax
  \Umathchardef\vertnsim =             3 \the\Lete@fam "E022 \relax
  \Umathchardef\vertnsimeq =           3 \the\Lete@fam "E023 \relax
  \Umathchardef\vertncong =            3 \the\Lete@fam "E024 \relax
  \Umathchardef\vertne =               3 \the\Lete@fam "E025 \relax
  \Umathchardef\vertnequiv =           3 \the\Lete@fam "E026 \relax
  \Umathchardef\vertnasymp =           3 \the\Lete@fam "E029 \relax
  \Umathchardef\vertnless =            3 \the\Lete@fam "E02A \relax
  \Umathchardef\vertngtr =             3 \the\Lete@fam "E02B \relax
  \Umathchardef\vertnleq =             3 \the\Lete@fam "E02C \relax
  \Umathchardef\vertngeq =             3 \the\Lete@fam "E02D \relax
  \Umathchardef\vertnlesssim =         3 \the\Lete@fam "E02E \relax
  \Umathchardef\vertngtrsim =          3 \the\Lete@fam "E02F \relax
  \Umathchardef\vertnlessgtr =         3 \the\Lete@fam "E030 \relax
  \Umathchardef\vertngtrless =         3 \the\Lete@fam "E031 \relax
  \Umathchardef\vertnprec  =           3 \the\Lete@fam "E032 \relax
  \Umathchardef\vertnsucc =            3 \the\Lete@fam "E033 \relax
  \Umathchardef\vertnsubset =          3 \the\Lete@fam "E034 \relax
  \Umathchardef\vertnsupset =          3 \the\Lete@fam "E035 \relax
  \Umathchardef\vertnsubseteq =        3 \the\Lete@fam "E036 \relax
  \Umathchardef\vertnsupseteq =        3 \the\Lete@fam "E037 \relax
  \Umathchardef\vertnpreccurlyeq =     3 \the\Lete@fam "E038 \relax
  \Umathchardef\vertnsucccurlyeq =     3 \the\Lete@fam "E039 \relax
  \Umathchardef\vertntrianglelefteq =  3 \the\Lete@fam "E03A \relax
  \Umathchardef\vertntrianglerighteq = 3 \the\Lete@fam "E03B \relax
  \Umathchardef\mbfimath =             0 \the\Lete@fam "E041 \relax
  \Umathchardef\mbfjmath =             0 \the\Lete@fam "E042 \relax
  \Umathchardef\mbfdotlessi =          0 \the\Lete@fam "E043 \relax
  \Umathchardef\mbfdotlessj =          0 \the\Lete@fam "E044 \relax
  \Umathchardef\mithbar =              0 \the\Lete@fam "E048 \relax
  \Umathchardef\mupvarg =              0 \the\Lete@fam "E04B \relax
  \Umathchardef\mbfvarg =              0 \the\Lete@fam "E04C \relax
  \Umathchardef\mitvarg =              0 \the\Lete@fam "E04D \relax
  \Umathchardef\mbfitvarg =            0 \the\Lete@fam "E04E \relax
  \Umathchardef\BbbDelta =             0 \the\Lete@fam "E050 \relax
  \Umathchardef\BbbTheta =             0 \the\Lete@fam "E051 \relax
  \Umathchardef\BbbLambda =            0 \the\Lete@fam "E052 \relax
  \Umathchardef\BbbXi =                0 \the\Lete@fam "E053 \relax
  \Umathchardef\BbbSigma =             0 \the\Lete@fam "E054 \relax
  \Umathchardef\BbbPhi =               0 \the\Lete@fam "E055 \relax
  \Umathchardef\BbbPsi =               0 \the\Lete@fam "E056 \relax
  \Umathchardef\BbbOmega =             0 \the\Lete@fam "E057 \relax
  \Umathchardef\mbfell =               0 \the\Lete@fam "E05A \relax
  \Umathchardef\mupvarl =              0 \the\Lete@fam "E05B \relax
  \Umathchardef\mbfvarl =              0 \the\Lete@fam "E05C \relax
  \Umathchardef\mitvarl =              0 \the\Lete@fam "E05D \relax
  \Umathchardef\mbfitvarl =            0 \the\Lete@fam "E05E \relax
  \Umathchardef\nleqqslant =           3 \the\Lete@fam "E066 \relax
  \Umathchardef\ngeqqslant =           3 \the\Lete@fam "E067 \relax
  \Umathchardef\parallelslant  =       3 \the\Lete@fam "E080 \relax
  \Umathchardef\nparallelslant =       3 \the\Lete@fam "E081 \relax
  \Umathchardef\shortparallelslant =   3 \the\Lete@fam "E082 \relax
  \Umathchardef\nshortparallelslant =  3 \the\Lete@fam "E083 \relax
  \Umathchardef\mapstochar =           3 \the\Lete@fam "E08D \relax
  \Umathchardef\lhook =                3 \the\Lete@fam "E08E \relax
  \Umathchardef\rhook =                3 \the\Lete@fam "E08F \relax
  % For unicode-math only:
  \ifLete@lum \else
  % amssymb
    \@ifpackageloaded{amssymb}%
      {\PackageWarning{lete-sans-math}{%
         LeteSansMath provides all AMS symbols.\MessageBreak
         Loading amssymb.sty is not advisable.\MessageBreak
         Reported}%
      }%
      {% AMS Symbols not referenced in unicode-math-table.tex
       % \Umathchardef\<cmd> = <math type> <family> <slot>
       % <math type> : \mathord=0 \mathbin=2 \mathrel=3 ; <family>=0
       \Umathchardef\nleqslant =      3 \the\Lete@fam "E076 \relax
       \Umathchardef\ngeqslant =      3 \the\Lete@fam "E077 \relax
       \Umathchardef\nleqq =          3 \the\Lete@fam "E078 \relax
       \Umathchardef\ngeqq =          3 \the\Lete@fam "E079 \relax
       \Umathchardef\npreceq =        3 \the\Lete@fam "E07C \relax
       \Umathchardef\nsucceq =        3 \the\Lete@fam "E07D \relax
       \Umathchardef\nsubseteqq =     3 \the\Lete@fam "E07E \relax
       \Umathchardef\nsupseteqq =     3 \the\Lete@fam "E07F \relax
       \protected\def\centerdot{\vysmblksquare}%
       \protected\def\restriction{\upharpoonright}%
       \protected\def\doteqdot{\Doteq}%
       \protected\def\doublecup{\Cup}%
       \protected\def\doublecap{\Cap}%
       \protected\def\llless{\lll}%
       \protected\def\gggtr{\ggg}%
       \protected\def\circlearrowleft{\acwopencirclearrow}%
       \protected\def\circlearrowright{\cwopencirclearrow}%
       \protected\def\lozenge{\mdlgwhtlozenge}%
       \protected\def\blacklozenge{\mdlgblklozenge}%
       \protected\def\square{\mdlgwhtsquare}%
       \protected\def\blacksquare{\mdlgblksquare}%
       \protected\def\dashleftarrow{\leftdasharrow}%
       \protected\def\dashrightarrow{\rightdasharrow}%
       \protected\def\ntriangleleft{\nvartriangleleft}%
       \protected\def\ntriangleright{\nvartriangleright}%
      }%
  % latexsym
    \@ifpackageloaded{latexsym}%
      {\PackageWarning{lete-sans-math}{%
         LeteSansMath provides all LaTeX symbols.\MessageBreak
         Loading latexsym.sty is not advisable.\MessageBreak
         Reported}%
      }%
      {\protected\def\lhd{\vartriangleleft}%
       \protected\def\rhd{\vartriangleright}%
       \protected\def\unlhd{\trianglelefteq}%
       \protected\def\unrhd{\trianglerighteq}%
       \protected\def\leadsto{\rightcurvedarrow}%
       \protected\def\Box{\lgwhtsquare}%
       \protected\def\Diamond{\mdlgwhtdiamond}%
      }%
\fi
}

\endinput
