summaryrefslogtreecommitdiff
path: root/fonts/newtx/tex/newtx.sty
blob: 2734fed4cc28863d4e460103122c5c78ba21bb6b (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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
\NeedsTeXFormat{LaTeX2e}

%Package to simplify loading of newtxtext with newtxmath for all latex engines
\def\fileversion{1.702}
\def\filedate{2021/12/27}
\ProvidesPackage{newtx}[%
\filedate\space v\fileversion (Michael Sharpe) latex and unicode latex support for newtxtext with newtxmath]

\message{`newtx'v\fileversion,\filedate\space Integrated\space loading\space of\space newtxtext\space and\space newtxmath
\space for\space all\space latex\space engines\space (msharpe)}
\RequirePackage{ifthen,ifxetex,ifluatex}

\def\ntx@mathlst{vecsep,amsthm,nosubscriptcorrection,subscriptcorrection,subscriptcorrectionfile,timesmathacc,varbb,vvarbb,nosymbolsc,noamssymbols,amssymbols,uprightscript,uprightGreek,slantedGreek,frenchmath,nonewtxmathopt,upint,smallerops,useBImacros,varg,varvw,noOT1}
\def\ntx@textlst{type1,nofontspec,no-math,defaultfeatures,lining,lf,oldstyle,osf,tabular,t,proportional,p,defaultsups,largesc,nott,nohelv,helvratio,spcfactor,spacing,stretch,shrink,defaultfeatures,oldSS,slashedzero,theoremfont,thmlining,trueslanted,scosf,tighter,looser}

%\newif\ifntx@inmath\newif\ifntx@intext
%% #2
%\def\ntx@inmath#1{\ntx@inmathfalse%
%  \@for\ntx@opt:=\ntx@mathlst\do{%
%  \ifthenelse{\equal}{#1}{\ntx@opt}{\ntx@inmathtrue\typeout{#1 in mathlst}}{}}%
%  }
%\def\ntx@intext#1{\ntx@intextfalse%
%  \@for\ntx@opt:=\ntx@textlst\do{%
%  \ifthenelse{\equal}{#1}{\ntx@opt}{\ntx@intexttrue}{}}%
%  }

%Enginecheck
\newif\ifntxotf
\newif\ifntx@origotf
\ifxetex
  \ntxotftrue
\else
  \ifluatex
    \ntxotftrue
  \else %[pdf]LaTeX
    \ntxotffalse
  \fi
\fi
\ifntxotf\ntx@origotftrue\fi

%%%%%%%%%%%%%%%%%%
\IfFileExists{xkeyval.sty}{\RequirePackage{xkeyval}}%
{\let\DeclareOptionX\DeclareOption
\let\ExecuteOptionsX\ExecuteOptions
\let\ProcessOptionsX\ProcessOptions}
%%%%StartOptions
\newif\ifntxotfmath\ntxotfmathfalse %default is type1 math
%\newif\ifntxotftext\ntxotftexttrue %default is otftext using newtxtext
%\newcommand{\ntx@optlist}{}

%\DeclareOptionX{type1text}[true]{%
%\@nameuse{if#1}\ntxotftextfalse\fi
%}
%\DeclareOptionX{nofontspec}[true]{%
%\@nameuse{if#1}\ntxotffalse\fi
%}
%\DeclareOptionX{type1}[true]{%
%\@nameuse{if#1}\ntxotffalse\fi
%}
\DeclareOptionX{otfmath}[true]{%
\@nameuse{if#1}\ntxotfmathtrue\typeout{Got otfmath}\fi
}
  
\DeclareOptionX*{% what to do with unknown options
%\ntx@intext{\CurrentOption}\ifntx@intext%
\PassOptionsToPackage{\CurrentOption}{newtxtext}
%\ntx@inmath{\CurrentOption}\ifntx@inmath%
\PassOptionsToPackage{\CurrentOption}{newtxmath}
}

\ProcessOptionsX\relax 

\ifntxotf\typeout{otf^^J}\else\typeout{type1^^J}\fi
\ifntxotfmath\typeout{otfmath^^J}\else\typeout{type1math^^J}\fi
%\ifntxotftext\typeout{otftext^^J}\else\typeout{type1text^^J}\fi

\ifntxotf
% \ifntxotftext
  \ifntxotfmath %I
    \usepackage[]{newtxtext} %may not load fontspec
    \RequirePackage{fontspec} % just in case
    \usepackage{unicode-math} %loads amsmath
    %\setmathfont{}
  \else %II: type1 math, otftext
    \renewcommand{\rmdefault}{ntxtlf} % Roman and BoldTermes for math
    \usepackage[]{newtxmath} % options will be as passed from newtx
    \usepackage[no-math]{newtxtext}
    \RequirePackage[no-math]{fontspec} % just in case 
  \fi
% \else % type1 text
%  \ifntxotfmath %II: type1text, otfmath
%    \usepackage[]{newtxtext}
%    \usepackage{fontspec}
%    \usepackage{unicode-math} % loadsamsmath
%    %\setmathfont{}
%  \else %IV: type1math,type1text
%    \renewcommand{\rmdefault}{ntxtlf}% Roman and Bold Termes for math
%    \usepackage[]{newtxmath}% options will be as passed from newtx
%    \usepackage[nofontspec]{newtxtext}
%    \ifntx@origotf\usepackage[no-math]{fontspec}\fi % we are
%  \fi
% \fi
\else % pdflatex
  \renewcommand{\rmdefault}{ntxtlf}% Roman and Bold Termes for math
  \usepackage{newtxmath} % options will be as passed from newtx
  \usepackage{newtxtext} % should load tt and sans math before newtx
\fi
%\usepackage[\ntx@optlist]{newtxtext}%optionswillalsobeaspassedfromnewtx
%\ifntxotfmath
%\usepackage{unicode-math}
%\fi
\endinput