diff options
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/newtx/newtx.sty | 150 |
1 files changed, 96 insertions, 54 deletions
diff --git a/Master/texmf-dist/tex/latex/newtx/newtx.sty b/Master/texmf-dist/tex/latex/newtx/newtx.sty index cb48d0c94d3..3c31a91788b 100644 --- a/Master/texmf-dist/tex/latex/newtx/newtx.sty +++ b/Master/texmf-dist/tex/latex/newtx/newtx.sty @@ -2,8 +2,8 @@ %Package to simplify loading of newtxmath with a text font family such as newtxtext for all latex engines, or for newtxtext and an otf math package. -\def\fileversion{1.75} -\def\filedate{2024/06/18} +\def\fileversion{1.751} +\def\filedate{2024/06/22} \ProvidesPackage{newtx}[% \filedate\space v\fileversion (Michael Sharpe) latex and unicode latex support for newtxmath and a supported text font family, or for newtxtext and an otf math package] @@ -54,7 +54,10 @@ % options for newtxmath as etoolbox internal list allowing \ifinlist %\def\ntx@mathlstr{vecsep,amsthm,nosubscriptcorrection,subscriptcorrection,timesmathacc,varbb,vvarbb,nosymbolsc,noamssymbols,amssymbols,uprightscript,uprightGreek,slantedGreek,frenchmath,nonewtxmathopt,upint,smallerops,useBImacros,varg,varvw,noOT1} -\forcsvlist{\listadd\ntx@mathlst}{vecsep,amsthm,nosubscriptcorrection,subscriptcorrection,timesmathacc,varbb,vvarbb,nosymbolsc,noamssymbols,amssymbols,uprightscript,uprightGreek,slantedGreek,frenchmath,nonewtxmathopt,upint,smallerops,useBImacros,varg,varvw,noOT1,propmathfigs,curlybraces,cochrho,cochf,alty,alth,liby,nochvw} +\forcsvlist{\listadd\ntx@mathlst}{vecsep,amsthm,nosubscriptcorrection,subscriptcorrection, +timesmathacc,varbb,vvarbb,nosymbolsc,noamssymbols,amssymbols,uprightscript,uprightGreek, +slantedGreek,frenchmath,nonewtxmathopt,upint,smallerops,useBImacros,varg,varvw,noOT1, +propmathfigs,curlybraces,cochrho,cochf,alty,alth,liby,nochvw} %\show\ntx@mathlst % Note that subscriptcorrectionfile is not on the list---we process it in this sty file @@ -279,6 +282,22 @@ % \ntx@Topt contains all unknown options that are not math options. It contains no scale options. \ntx@Mopt lists all the math options. \ProcessOptionsX\relax +\def\tx@mathtotextfactor{1} +\ifcase\ntx@id % 0, newtxtext + \or\or % 1,2 + \or \def\tx@mathtotextfactor{1.05} % 3, ebg + \or\or % 4,5 + \or \def\tx@mathtotextfactor{.94} % 6, garx + \or\or % 7,8 + \or \def\tx@mathtotextfactor{.94} % 9, heur + \or\or % 10, 11 + \or \def\tx@mathtotextfactor{.935} % 12, xch + \or % 13 + \or \def\tx@mathtotextfactor{.93} % 14, schx + \or \def\tx@mathtotextfactor{.93} % 15, schx/four + \or \def\tx@mathtotextfactor{.92} % 16, gel +\fi + %\show\ntx@Mopt %\show\ntx@Topt %\traceon @@ -289,34 +308,48 @@ % \ntx@otftextfalse % \fi %\fi +\newif\ifntx@iszero +\@tempdima=\@ne\p@\@tempdima=\ntxtext@scale\@tempdima +\expandafter\ifnum\number\@tempdima=0\relax\ntx@iszerotrue\fi + +\ifntx@iszero% + \@tempdima=\tx@mathtotextfactor\p@% + \@tempdima=\ntxmath@scale\@tempdima% + \edef\ntxtext@scale{\strip@pt\@tempdima} + %\show\ntxtext@scale +\fi +\def\ntxtext@scaled{s*[\ntxtext@scale]} + \ifntx@otfmath \ifnum\ntx@id>0 \PackageWarning{newtx.sty}{Reverting to newtxtext: newtx with option {\tt otfmath} can not handle other text packages.} \ntx@id=0 \ntx@text % revert to newtxtext \fi -\else % t1 math - \ifnum\ntx@id=0 +\fi + +\ifnum\ntx@id=0 \ifthenelse{\not\equal{\sfdefault}{cmss}}% {\tx@helvfalse}{} \ifthenelse{\not\equal{\ttdefault}{cmtt}}% {\tx@ttfalse}{} - \iftx@helv +\fi +\iftx@helv \renewcommand*{\sfdefault}{qhv} \@tempdima=\ntxtext@scale\p@ \@tempdima=\tx@helvratio\@tempdima% \edef\qhv@scale{\strip@pt\@tempdima} - \else +\else \PassOptionsToPackage{nohelv=true}{newtxtext} - \fi - \iftx@tt\renewcommand*{\ttdefault}{ntxtt}\fi - \ifthenelse{\not\equal{\tx@helvratio}{.94}}% +\fi + +\ifthenelse{\not\equal{\tx@helvratio}{.94}}% {\PassOptionsToPackage{helvratio=\tx@helvratio}% {newtxtext}}{} - \iftx@tt\else% - \PassOptionsToPackage{nott=true}{newtxtext}\fi - - \fi + +\iftx@tt\renewcommand*{\ttdefault}{ntxtt}\fi +\iftx@tt\else% + \PassOptionsToPackage{nott=true}{newtxtext} \fi %\ifntx@badnof\PackageError{newtx.sty}{Incompatible options, nofontspec and otfmath}{Incompatible options, nofontspec and otfmath}\fi % Set the text scale macros appropriately @@ -325,14 +358,12 @@ %\PassOptionsToPackage{scaled=\ntxtext@scale}{\ntx@TF} \edef\ntxmath@scaled{s*[\ntxmath@scale]} % For the min text fd files, need to use actual scale macro passed to fd? -%\@namedef{\ntx@sc}{\ntxtext@scale} +%\@namedef{\ntx@sc}{\ntxtext@scale}% -\newif\ifntx@iszero -\@tempdima\@ne\p@\@tempdima\ntxtext@scale\@tempdima -\expandafter\ifnum\number\@tempdima=0\relax\ntx@iszerotrue\fi -% +%\newcommand{\PassMathScale}{%\ifntx@iszero\gdef\ntxtext@scale{\ntxmath@scale} +%\gdef\ntxtext@scaled{s*[\ntxtext@scale]}\fi -\newcommand{\PassMathScale}{\ifntx@iszero\gdef\ntxtext@scale{\ntxmath@scale}\gdef\ntxtext@scaled{s*[\ntxtext@scale]}\fi +% The following block sents scale instructions to text package \ifnum\ntx@id=4 % MinionPro \PassOptionsToPackage{scale=\ntxtext@scale}{\ntx@TF} \else @@ -354,28 +385,32 @@ \@tempdimb=\ntxtext@TT\@tempdima \PassOptionsToPackage{ttscale=\strip@pt\@tempdimb}{\ntx@TF} - \else % - \PassOptionsToPackage{scaled=\ntxtext@scale}{\ntx@TF} + \else % + \ifnum\ntx@id=16 % gelasio + \PassOptionsToPackage{scale=\ntxtext@scale}{\ntx@TF}% + \else + \PassOptionsToPackage{scaled=\ntxtext@scale}{\ntx@TF} + \fi \fi \fi \fi -} +%} % -\newcommand{\PassMatchingScale}[1]{% - \ifntx@iszero% - \@tempdima #1\p@ \@tempdima\ntxmath@scale\@tempdima \xdef\ntxtext@scale{\strip@pt\@tempdima} - \fi - \xdef\ntxtext@scaled{s*[\ntxtext@scale]} - \ifnum\ntx@id=16 % gelasio - \PassOptionsToPackage{scale=\ntxtext@scale}{\ntx@TF}% - \else - \PassOptionsToPackage{scaled=\ntxtext@scale}{\ntx@TF}% - \fi -} +%\newcommand{\PassMatchingScale}[1]{% +% \ifntx@iszero% +% \@tempdima #1\p@ \@tempdima\ntxmath@scale\@tempdima \xdef\ntxtext@scale{\strip@pt\@tempdima} +% \fi +% \xdef\ntxtext@scaled{s*[\ntxtext@scale]} +%} %\fi +%\PassMathScale +%\traceon +% Send parameters for stacked fractions +\def\tx@sfrac{} % X for cases where parameters are given \ifcase\ntx@id % 0, newtxtext -\PassMathScale +\def\tx@sfrac{X} +%\PassMathScale % info for sfrac (stacked fractions) involving newtxtext \@ifundefined{tx@xht}{\def\tx@xht{450}}{} % lowercase letters \@ifundefined{tx@deht}{\def\tx@deht{406}}{} % denominator figures ht @@ -386,7 +421,7 @@ \@ifundefined{tx@sfrTH}{\def\tx@sfrTH{54}}{} % bar thickness \@ifundefined{tx@sfrSC}{\def\tx@sfrSC{.9}}{} % scale defigures by this \or %1, libertine -\PassMathScale +\def\tx@sfrac{X} % \PassOptionsToPackage{ttscaled=\ntxtext@scale, % llscaled=\ntxtext@scale}{\ntx@TF} % for tt and serifed in Libertine \@ifundefined{tx@xht}{\def\tx@xht{431}}{} % lowercase letters @@ -406,7 +441,7 @@ %{\addfontfeature{RawFeature=+frac}#2/#3}}% %}} \or % 2, etbb -\PassMathScale +\def\tx@sfrac{X} \@ifundefined{tx@xht}{\def\tx@xht{431}}{} % lowercase letters \@ifundefined{tx@deht}{\def\tx@deht{357}}{} % denominator figures ht \@ifundefined{tx@nubase}{\def\tx@nubase{295}}{} % baseline of numerators @@ -416,7 +451,7 @@ \@ifundefined{tx@sfrTH}{\def\tx@sfrTH{64}}{} % bar thickness \@ifundefined{tx@sfrSC}{\def\tx@sfrSC{.8}}{} % scale defigures by this \or % 3, ebgaramond -\PassMatchingScale{1.05} +\def\tx@sfrac{X} \@ifundefined{tx@xht}{\def\tx@xht{431}}{} % lowercase letters \@ifundefined{tx@deht}{\def\tx@deht{341}}{} % denominator figures ht \@ifundefined{tx@nubase}{\def\tx@nubase{443}}{} % baseline of numerators @@ -435,7 +470,7 @@ %{\addfontfeature{RawFeature=+frac}#2/#3}}% %}}}} \or % 4, MinionPro -\PassMathScale +%\PassMathScale %\@ifundefined{tx@xht}{\def\tx@xht{437}}{} % lowercase letters %\@ifundefined{tx@deht}{\def\tx@deht{359}}{} % denominator figures ht %\@ifundefined{tx@nubase}{\def\tx@nubase{277}}{} % baseline of numerators @@ -445,7 +480,7 @@ %\@ifundefined{tx@sfrTH}{\def\tx@sfrTH{54}}{} % bar thickness %\@ifundefined{tx@sfrSC}{\def\tx@sfrSC{.9}}{} % scale defigures by this \or % 5, cochineal -\PassMathScale +\def\tx@sfrac{X} \@ifundefined{tx@xht}{\def\tx@xht{430}}{} % lowercase letters \@ifundefined{tx@deht}{\def\tx@deht{378}}{} % denominator figures ht \@ifundefined{tx@nubase}{\def\tx@nubase{248}}{} % baseline of numerators @@ -455,15 +490,15 @@ \@ifundefined{tx@sfrTH}{\def\tx@sfrTH{54}}{} % bar thickness \@ifundefined{tx@sfrSC}{\def\tx@sfrSC{.9}}{} % scale defigures by this amount \or % 6, garamondx -\PassMatchingScale{.94} +%\PassMatchingScale{.94} \or % 7, BaskervilleF -\PassMathScale +%\PassMathScale \or % 8, baskervaldx -\PassMathScale +%\PassMathScale \or % 9, heuristica -\PassMatchingScale{.94} +%\PassMatchingScale{.94} \or % 10, libertinus -\PassMathScale +\def\tx@sfrac{X} \@ifundefined{tx@xht}{\def\tx@xht{431}}{} % lowercase letters \@ifundefined{tx@deht}{\def\tx@deht{324}}{} % denominator figures ht \@ifundefined{tx@nubase}{\def\tx@nubase{364}}{} % baseline of numerators @@ -483,7 +518,7 @@ %{\addfontfeature{RawFeature=+frac}#2/#3}}% %}}}} \or % 11, erewhon -\PassMathScale +\def\tx@sfrac{X} \@ifundefined{tx@xht}{\def\tx@xht{461}}{} % lowercase letters \@ifundefined{tx@deht}{\def\tx@deht{384}}{} % denominator figures ht \@ifundefined{tx@nubase}{\def\tx@nubase{256}}{} % baseline of numerators @@ -493,7 +528,7 @@ \@ifundefined{tx@sfrTH}{\def\tx@sfrTH{58}}{} % bar thickness \@ifundefined{tx@sfrSC}{\def\tx@sfrSC{.8}}{} % scale defigures by this \or % 12, XCharter -\PassMatchingScale{.935} +\def\tx@sfrac{X} \@ifundefined{tx@xht}{\def\tx@xht{481}}{} % lowercase letters \@ifundefined{tx@deht}{\def\tx@deht{382}}{} % denominator figures ht \@ifundefined{tx@nubase}{\def\tx@nubase{295}}{} % baseline of numerators @@ -503,7 +538,7 @@ \@ifundefined{tx@sfrTH}{\def\tx@sfrTH{54}}{} % bar thickness \@ifundefined{tx@sfrSC}{\def\tx@sfrSC{.8}}{} % scale defigures by this \or % 13, stickstoo -\PassMathScale +\def\tx@sfrac{X} \@ifundefined{tx@xht}{\def\tx@xht{473}}{} % lowercase letters \@ifundefined{tx@deht}{\def\tx@deht{411}}{} % denominator figures ht \@ifundefined{tx@nubase}{\def\tx@nubase{252}}{} % baseline of numerators @@ -513,7 +548,7 @@ \@ifundefined{tx@sfrTH}{\def\tx@sfrTH{56}}{} % bar thickness \@ifundefined{tx@sfrSC}{\def\tx@sfrSC{.75}}{} % scale defigures by this \or % 14, scholax -\PassMatchingScale{.93} +\def\tx@sfrac{X} \@ifundefined{tx@xht}{\def\tx@xht{466}}{} % lowercase letters \@ifundefined{tx@deht}{\def\tx@deht{423}}{} % denominator figures ht \@ifundefined{tx@nubase}{\def\tx@nubase{289}}{} % baseline of numerators @@ -523,7 +558,7 @@ \@ifundefined{tx@sfrTH}{\def\tx@sfrTH{70}}{} % bar thickness \@ifundefined{tx@sfrSC}{\def\tx@sfrSC{.8}}{} % scale defigures by this \or % 15, scholax/fourier -\PassMatchingScale{.93} +\def\tx@sfrac{X} \@ifundefined{tx@xht}{\def\tx@xht{466}}{} % lowercase letters \@ifundefined{tx@deht}{\def\tx@deht{423}}{} % denominator figures ht \@ifundefined{tx@nubase}{\def\tx@nubase{289}}{} % baseline of numerators @@ -533,7 +568,7 @@ \@ifundefined{tx@sfrTH}{\def\tx@sfrTH{70}}{} % bar thickness \@ifundefined{tx@sfrSC}{\def\tx@sfrSC{.8}}{} % scale defigures by this \or % 16, gelasio -\PassMatchingScale{.92} +\def\tx@sfrac{X} \@ifundefined{tx@xht}{\def\tx@xht{485}}{} % lowercase letters \@ifundefined{tx@deht}{\def\tx@deht{473}}{} % denominator figures \@ifundefined{tx@nubase}{\def\tx@nubase{246}}{} % baseline of numerators @@ -559,6 +594,8 @@ \def\tx@toex#1{\tx@x=\dimexpr 1pt * (\dimexpr #1pt\relax) / \dimexpr \tx@xht pt\relax\relax} %\def\tx@divide#1#2{\ntx@dima=\dimexpr 1pt * (\dimexpr #1 pt\relax) / \dimexpr #2pt\relax\relax} +% Code for stacked fractions---not available in cases 4,6,7,8,9 +\if X\tx@sfrac \newdimen\tx@tmpdima \newdimen\tx@tmpdimb \newdimen\tx@tmpdimC \newdimen\tx@dimX \newdimen\tx@dimY \newdimen\tx@dimZ \newdimen\tx@numrbase \newdimen\tx@dnombase @@ -600,11 +637,16 @@ \hfil\raise \tx@dimZ \box1\hfil}% \egroup}} } +\else +\newcommand*{\textsfrac}[3][]{% +\mbox{% + \ifthenelse{\not\equal{#1}{}}%Test for integer portion [optional #1] + {\textlf{#1}\kern.04em}{}% +#2/#3}} +\fi -%\ifntx@otfmath\typeout{otf math}\else\typeout{type1 math}\fi - - +% Document setup instructions \ifntx@otftext \ifntx@otfmath %I \typeout{I} |