summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/notomath/notomath.sty
blob: 715d9d341ba2f6ba183b63ea7a54bfbd3e0a4deb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
\NeedsTeXFormat{LaTeX2e}
\def\fileversion{1.00}
\def\filedate{2020/08/04}
\ProvidesPackage{notomath}
    [\filedate\space v\fileversion.\space (Michael Sharpe)  Supports Noto text and math fonts for LaTeX usage.]

\RequirePackage{fontenc,fontaxes,mweights}
\RequirePackage{xkeyval,textcomp}
%\PassOptionsToPackage{proportional,pf,oldstyle,osf,type1}{noto-serif}
%\PassOptionsToPackage{proportional,pf,oldstyle,osf,type1,sfdefault}{noto-sans}
%\PassOptionsToPackage{}{newtxmath}
%\PassOptionsToPackage{varbb,vvarbb,upint,noamssymbols,slantedGreek,frenchmath,nosymbolsc,subscriptcorrection,timesmathacc,uprightscript,smallerops,useBImacros,noOT1}{newtxmath}
% This seems to pass options that were not specified
% Have to handle less efficiently by parsing args 

\newcommand*{\NotoMath@scale}{1}
\newcommand*{\NotoText@scale}{1}
\newif\ifnoto@sfdefault \noto@sfdefaultfalse
\newif\ifnoto@pf \noto@pffalse
\newif\ifnoto@osf \noto@osffalse
%\newcommand*{\NotoSerifMono@scale}{1}
\DeclareOptionX{scaled}{\renewcommand*{\NotoMath@scale}{#1}}
\DeclareOptionX{scale}{\renewcommand*{\NotoMath@scale}{#1}}

\edef\noto@mopt{noto}

\newif\ifnotomath@mono \notomath@monofalse

\DeclareOptionX{sfdefault}{\edef\noto@mopt{notosans}\noto@sfdefaulttrue}
\DeclareOptionX{proportional}{\noto@pftrue}
\DeclareOptionX{pf}{\noto@pftrue}
\DeclareOptionX{oldstyle}{\noto@osftrue}
\DeclareOptionX{osf}{\noto@osftrue}
\DeclareOptionX{mono}{\notomath@monotrue}
\DeclareOptionX{varbb}{\edef\noto@mopt{\noto@mopt,varbb}}
\DeclareOptionX{vvarbb}{\edef\noto@mopt{\noto@mopt,vvarbb}}
\DeclareOptionX{upint}{\edef\noto@mopt{\noto@mopt,upint}}
\DeclareOptionX{noamssymbols}{\edef\noto@mopt{\noto@mopt,noamssymbols}}
\DeclareOptionX{slantedGreek}{\edef\noto@mopt{\noto@mopt,slantedGreek}}
\DeclareOptionX{frenchmath}{\edef\noto@mopt{\noto@mopt,frenchmath}}
\DeclareOptionX{nosymbolsc}{\edef\noto@mopt{\noto@mopt,nosymbolsc}}
\DeclareOptionX{subscriptcorrection}{\edef\noto@mopt{\noto@mopt,subscriptcorrection}}
\DeclareOptionX{timesmathacc}{\edef\noto@mopt{\noto@mopt,timesmathacc}}
\DeclareOptionX{uprightscript}{\edef\noto@mopt{\noto@mopt,uprightscript}}
\DeclareOptionX{smallerops}{\edef\noto@mopt{\noto@mopt,smallerops}}
\DeclareOptionX{useBImacros}{\edef\noto@mopt{\noto@mopt,useBImacros}}
\DeclareOptionX{noOT1}{\edef\noto@mopt{\noto@mopt,noOT1}}

\ProcessOptionsX\relax
\edef\noto@mopt{scale=\NotoMath@scale,\noto@mopt}
%\show\noto@mopt
\newdimen\notomath@dima
% use the scale for math to set noto text scale factors
\notomath@dima=\NotoMath@scale\p@
\notomath@dima=.9\notomath@dima
\edef\NotoText@scale{\strip@pt\notomath@dima}
%\let\NotoSans@scale\NotoText@scale
%\let\NotoSansMono@scale\NotoSerif@scale
\edef\nototext@opt{scale=\NotoText@scale}
\ifnoto@pf\edef\nototext@opt{\nototext@opt,pf}\fi
\ifnoto@osf\edef\nototext@opt{\nototext@opt,osf}\fi
\usepackage[\nototext@opt]{noto-serif}
\ifnoto@sfdefault\edef\nototext@opt{\nototext@opt,sfdefault}\fi
\usepackage[\nototext@opt]{noto-sans}
\ifnotomath@mono\usepackage[type1,scale=\NotoText@scale]{noto-mono}\fi
%\show\noto@mopt
\usepackage[\noto@mopt]{newtxmath}
\def\seriesdefault{\mdseries@rm}
\def\mdseries@rm{m}
\def\bfseries@rm{b}

\endinput