texlive[71602] Master/texmf-dist/tex/latex/newtx/newtx.sty: newtx

commits+karl at tug.org commits+karl at tug.org
Sun Jun 23 22:28:05 CEST 2024


Revision: 71602
          https://tug.org/svn/texlive?view=revision&revision=71602
Author:   karl
Date:     2024-06-23 22:28:05 +0200 (Sun, 23 Jun 2024)
Log Message:
-----------
newtx (23jun24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/tex/latex/newtx/newtx.sty

Modified: trunk/Master/texmf-dist/tex/latex/newtx/newtx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/newtx/newtx.sty	2024-06-23 20:27:28 UTC (rev 71601)
+++ trunk/Master/texmf-dist/tex/latex/newtx/newtx.sty	2024-06-23 20:28:05 UTC (rev 71602)
@@ -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 at 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 at 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 at 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 at mathlst
 
 % Note that subscriptcorrectionfile is not on the list---we process it in this sty file
@@ -279,6 +282,22 @@
 % \ntx at Topt contains all unknown options that are not math options. It contains no scale options. \ntx at Mopt lists all the math options.
 \ProcessOptionsX\relax
 
+\def\tx at mathtotextfactor{1}
+\ifcase\ntx at id % 0, newtxtext
+  \or\or % 1,2
+  \or \def\tx at mathtotextfactor{1.05} % 3, ebg
+  \or\or % 4,5
+  \or \def\tx at mathtotextfactor{.94} % 6, garx
+  \or\or % 7,8
+  \or \def\tx at mathtotextfactor{.94} % 9, heur
+  \or\or % 10, 11
+  \or \def\tx at mathtotextfactor{.935} % 12, xch
+  \or % 13
+  \or \def\tx at mathtotextfactor{.93} % 14, schx
+  \or \def\tx at mathtotextfactor{.93} % 15, schx/four
+  \or \def\tx at mathtotextfactor{.92} % 16, gel
+\fi
+
 %\show\ntx at Mopt
 %\show\ntx at Topt
 %\traceon
@@ -289,6 +308,18 @@
 %	\ntx at otftextfalse
 %  \fi
 %\fi
+\newif\ifntx at iszero
+\@tempdima=\@ne\p@\@tempdima=\ntxtext at scale\@tempdima
+\expandafter\ifnum\number\@tempdima=0\relax\ntx at iszerotrue\fi
+
+\ifntx at iszero%
+  \@tempdima=\tx at mathtotextfactor\p@%
+  \@tempdima=\ntxmath at scale\@tempdima%
+  \edef\ntxtext at scale{\strip at pt\@tempdima}
+  %\show\ntxtext at scale
+\fi
+\def\ntxtext at scaled{s*[\ntxtext at scale]}
+  
 \ifntx at otfmath
    \ifnum\ntx at id>0
      \PackageWarning{newtx.sty}{Reverting to newtxtext: newtx with option {\tt otfmath} can not handle other text packages.}
@@ -295,28 +326,30 @@
      \ntx at id=0
      \ntx at text % revert to newtxtext
    \fi
-\else % t1 math
-  \ifnum\ntx at id=0
+\fi
+
+\ifnum\ntx at id=0
     \ifthenelse{\not\equal{\sfdefault}{cmss}}%
       {\tx at helvfalse}{}
     \ifthenelse{\not\equal{\ttdefault}{cmtt}}%
       {\tx at ttfalse}{}
-    \iftx at helv
+\fi
+\iftx at helv
       \renewcommand*{\sfdefault}{qhv}
       \@tempdima=\ntxtext at scale\p@
       \@tempdima=\tx at helvratio\@tempdima%
       \edef\qhv at scale{\strip at pt\@tempdima}
-    \else
+\else
       \PassOptionsToPackage{nohelv=true}{newtxtext}
-    \fi
-    \iftx at tt\renewcommand*{\ttdefault}{ntxtt}\fi
-    \ifthenelse{\not\equal{\tx at helvratio}{.94}}%
+\fi
+
+\ifthenelse{\not\equal{\tx at helvratio}{.94}}%
       {\PassOptionsToPackage{helvratio=\tx at helvratio}%
       {newtxtext}}{}
-    \iftx at tt\else%
-      \PassOptionsToPackage{nott=true}{newtxtext}\fi
-    
-  \fi
+      
+\iftx at tt\renewcommand*{\ttdefault}{ntxtt}\fi
+\iftx at tt\else%
+      \PassOptionsToPackage{nott=true}{newtxtext}  
 \fi
 %\ifntx at 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 at scale}{\ntx at TF}
 \edef\ntxmath at scaled{s*[\ntxmath at scale]}
 % For the min text fd files, need to use actual scale macro passed to fd?
-%\@namedef{\ntx at sc}{\ntxtext at scale}
+%\@namedef{\ntx at sc}{\ntxtext at scale}%
 
-\newif\ifntx at iszero
-\@tempdima\@ne\p@\@tempdima\ntxtext at scale\@tempdima
-\expandafter\ifnum\number\@tempdima=0\relax\ntx at iszerotrue\fi
-%
+%\newcommand{\PassMathScale}{%\ifntx at iszero\gdef\ntxtext at scale{\ntxmath at scale}
+%\gdef\ntxtext at scaled{s*[\ntxtext at scale]}\fi
 
-\newcommand{\PassMathScale}{\ifntx at iszero\gdef\ntxtext at scale{\ntxmath at scale}\gdef\ntxtext at scaled{s*[\ntxtext at scale]}\fi
+% The following block sents scale instructions to text package
 \ifnum\ntx at id=4 % MinionPro
   \PassOptionsToPackage{scale=\ntxtext at scale}{\ntx at TF}
 \else
@@ -354,28 +385,32 @@
 		  \@tempdimb=\ntxtext at TT\@tempdima
 		  \PassOptionsToPackage{ttscale=\strip at pt\@tempdimb}{\ntx at TF}
 
-      \else % 
-		  \PassOptionsToPackage{scaled=\ntxtext at scale}{\ntx at TF}
+      \else %
+          \ifnum\ntx at id=16 % gelasio
+              \PassOptionsToPackage{scale=\ntxtext at scale}{\ntx at TF}%
+ 		  \else
+		    \PassOptionsToPackage{scaled=\ntxtext at scale}{\ntx at TF}
+		  \fi
 	  \fi
   \fi
 \fi
-}
+%}
 %
-\newcommand{\PassMatchingScale}[1]{%
-  \ifntx at iszero%
-    \@tempdima #1\p@ \@tempdima\ntxmath at scale\@tempdima		  	\xdef\ntxtext at scale{\strip at pt\@tempdima}
-  \fi
-  \xdef\ntxtext at scaled{s*[\ntxtext at scale]}
-  \ifnum\ntx at id=16 % gelasio
-    \PassOptionsToPackage{scale=\ntxtext at scale}{\ntx at TF}%
-  \else
-    \PassOptionsToPackage{scaled=\ntxtext at scale}{\ntx at TF}%
-  \fi
-}
+%\newcommand{\PassMatchingScale}[1]{%
+%  \ifntx at iszero%
+%    \@tempdima #1\p@ \@tempdima\ntxmath at scale\@tempdima		  	\xdef\ntxtext at scale{\strip at pt\@tempdima}
+%  \fi
+%  \xdef\ntxtext at scaled{s*[\ntxtext at scale]}
+%}
 %\fi
 
+%\PassMathScale
+%\traceon
+% Send parameters for stacked fractions
+\def\tx at sfrac{} % X for cases where parameters are given
 \ifcase\ntx at id % 0, newtxtext
-\PassMathScale
+\def\tx at sfrac{X}
+%\PassMathScale
 % info for sfrac (stacked fractions) involving newtxtext
 \@ifundefined{tx at xht}{\def\tx at xht{450}}{} % lowercase letters
 \@ifundefined{tx at deht}{\def\tx at deht{406}}{} % denominator figures ht
@@ -386,7 +421,7 @@
 \@ifundefined{tx at sfrTH}{\def\tx at sfrTH{54}}{} % bar thickness
 \@ifundefined{tx at sfrSC}{\def\tx at sfrSC{.9}}{} % scale defigures by this
 \or %1, libertine
-\PassMathScale
+\def\tx at sfrac{X}
 % \PassOptionsToPackage{ttscaled=\ntxtext at scale,
 % llscaled=\ntxtext at scale}{\ntx at TF} % for tt and serifed in Libertine
 \@ifundefined{tx at xht}{\def\tx at xht{431}}{} % lowercase letters
@@ -406,7 +441,7 @@
 %{\addfontfeature{RawFeature=+frac}#2/#3}}%
 %}}
 \or % 2, etbb
-\PassMathScale
+\def\tx at sfrac{X}
 \@ifundefined{tx at xht}{\def\tx at xht{431}}{} % lowercase letters
 \@ifundefined{tx at deht}{\def\tx at deht{357}}{} % denominator figures ht
 \@ifundefined{tx at nubase}{\def\tx at nubase{295}}{} % baseline of numerators
@@ -416,7 +451,7 @@
 \@ifundefined{tx at sfrTH}{\def\tx at sfrTH{64}}{} % bar thickness
 \@ifundefined{tx at sfrSC}{\def\tx at sfrSC{.8}}{} % scale defigures by this
 \or % 3, ebgaramond
-\PassMatchingScale{1.05}
+\def\tx at sfrac{X}
 \@ifundefined{tx at xht}{\def\tx at xht{431}}{} % lowercase letters
 \@ifundefined{tx at deht}{\def\tx at deht{341}}{} % denominator figures ht
 \@ifundefined{tx at nubase}{\def\tx at nubase{443}}{} % baseline of numerators
@@ -435,7 +470,7 @@
 %{\addfontfeature{RawFeature=+frac}#2/#3}}%
 %}}}}
 \or % 4, MinionPro
-\PassMathScale
+%\PassMathScale
 %\@ifundefined{tx at xht}{\def\tx at xht{437}}{} % lowercase letters
 %\@ifundefined{tx at deht}{\def\tx at deht{359}}{} % denominator figures ht
 %\@ifundefined{tx at nubase}{\def\tx at nubase{277}}{} % baseline of numerators
@@ -445,7 +480,7 @@
 %\@ifundefined{tx at sfrTH}{\def\tx at sfrTH{54}}{} % bar thickness
 %\@ifundefined{tx at sfrSC}{\def\tx at sfrSC{.9}}{} % scale defigures by this 
 \or % 5, cochineal
-\PassMathScale
+\def\tx at sfrac{X}
 \@ifundefined{tx at xht}{\def\tx at xht{430}}{} % lowercase letters
 \@ifundefined{tx at deht}{\def\tx at deht{378}}{} % denominator figures ht
 \@ifundefined{tx at nubase}{\def\tx at nubase{248}}{} % baseline of numerators
@@ -455,15 +490,15 @@
 \@ifundefined{tx at sfrTH}{\def\tx at sfrTH{54}}{} % bar thickness
 \@ifundefined{tx at sfrSC}{\def\tx at 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 at sfrac{X}
 \@ifundefined{tx at xht}{\def\tx at xht{431}}{} % lowercase letters
 \@ifundefined{tx at deht}{\def\tx at deht{324}}{} % denominator figures ht
 \@ifundefined{tx at nubase}{\def\tx at nubase{364}}{} % baseline of numerators
@@ -483,7 +518,7 @@
 %{\addfontfeature{RawFeature=+frac}#2/#3}}%
 %}}}}
 \or % 11, erewhon
-\PassMathScale
+\def\tx at sfrac{X}
 \@ifundefined{tx at xht}{\def\tx at xht{461}}{} % lowercase letters
 \@ifundefined{tx at deht}{\def\tx at deht{384}}{} % denominator figures ht
 \@ifundefined{tx at nubase}{\def\tx at nubase{256}}{} % baseline of numerators
@@ -493,7 +528,7 @@
 \@ifundefined{tx at sfrTH}{\def\tx at sfrTH{58}}{} % bar thickness
 \@ifundefined{tx at sfrSC}{\def\tx at sfrSC{.8}}{} % scale defigures by this 
 \or % 12, XCharter
-\PassMatchingScale{.935}
+\def\tx at sfrac{X}
 \@ifundefined{tx at xht}{\def\tx at xht{481}}{} % lowercase letters
 \@ifundefined{tx at deht}{\def\tx at deht{382}}{} % denominator figures ht
 \@ifundefined{tx at nubase}{\def\tx at nubase{295}}{} % baseline of numerators
@@ -503,7 +538,7 @@
 \@ifundefined{tx at sfrTH}{\def\tx at sfrTH{54}}{} % bar thickness
 \@ifundefined{tx at sfrSC}{\def\tx at sfrSC{.8}}{} % scale defigures by this 
 \or % 13, stickstoo
-\PassMathScale
+\def\tx at sfrac{X}
 \@ifundefined{tx at xht}{\def\tx at xht{473}}{} % lowercase letters
 \@ifundefined{tx at deht}{\def\tx at deht{411}}{} % denominator figures ht
 \@ifundefined{tx at nubase}{\def\tx at nubase{252}}{} % baseline of numerators
@@ -513,7 +548,7 @@
 \@ifundefined{tx at sfrTH}{\def\tx at sfrTH{56}}{} % bar thickness
 \@ifundefined{tx at sfrSC}{\def\tx at sfrSC{.75}}{} % scale defigures by this 
 \or % 14, scholax
-\PassMatchingScale{.93}
+\def\tx at sfrac{X}
 \@ifundefined{tx at xht}{\def\tx at xht{466}}{} % lowercase letters
 \@ifundefined{tx at deht}{\def\tx at deht{423}}{} % denominator figures ht
 \@ifundefined{tx at nubase}{\def\tx at nubase{289}}{} % baseline of numerators
@@ -523,7 +558,7 @@
 \@ifundefined{tx at sfrTH}{\def\tx at sfrTH{70}}{} % bar thickness
 \@ifundefined{tx at sfrSC}{\def\tx at sfrSC{.8}}{} % scale defigures by this 
 \or % 15, scholax/fourier
-\PassMatchingScale{.93}
+\def\tx at sfrac{X}
 \@ifundefined{tx at xht}{\def\tx at xht{466}}{} % lowercase letters
 \@ifundefined{tx at deht}{\def\tx at deht{423}}{} % denominator figures ht
 \@ifundefined{tx at nubase}{\def\tx at nubase{289}}{} % baseline of numerators
@@ -533,7 +568,7 @@
 \@ifundefined{tx at sfrTH}{\def\tx at sfrTH{70}}{} % bar thickness
 \@ifundefined{tx at sfrSC}{\def\tx at sfrSC{.8}}{} % scale defigures by this
 \or % 16, gelasio
-\PassMatchingScale{.92}
+\def\tx at sfrac{X}
 \@ifundefined{tx at xht}{\def\tx at xht{485}}{} % lowercase letters
 \@ifundefined{tx at deht}{\def\tx at deht{473}}{} % denominator figures 
 \@ifundefined{tx at nubase}{\def\tx at nubase{246}}{} % baseline of numerators
@@ -559,6 +594,8 @@
 \def\tx at toex#1{\tx at x=\dimexpr 1pt * (\dimexpr #1pt\relax) / \dimexpr \tx at xht pt\relax\relax}
 %\def\tx at divide#1#2{\ntx at 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 at sfrac
 \newdimen\tx at tmpdima \newdimen\tx at tmpdimb  \newdimen\tx at tmpdimC
 \newdimen\tx at dimX \newdimen\tx at dimY \newdimen\tx at dimZ
 \newdimen\tx at numrbase \newdimen\tx at dnombase
@@ -600,11 +637,16 @@
   \hfil\raise \tx at 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 at otfmath\typeout{otf math}\else\typeout{type1 math}\fi
-
-
+% Document setup instructions
 \ifntx at otftext
   \ifntx at otfmath %I
   \typeout{I}



More information about the tex-live-commits mailing list.