summaryrefslogtreecommitdiff
path: root/fonts/newtx/tex
diff options
context:
space:
mode:
Diffstat (limited to 'fonts/newtx/tex')
-rw-r--r--fonts/newtx/tex/newtx.sty44
-rw-r--r--fonts/newtx/tex/newtxtext.sty17
2 files changed, 48 insertions, 13 deletions
diff --git a/fonts/newtx/tex/newtx.sty b/fonts/newtx/tex/newtx.sty
index 753b259ef2..ed91042f05 100644
--- a/fonts/newtx/tex/newtx.sty
+++ b/fonts/newtx/tex/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.735}
-\def\filedate{2023/12/18}
+\def\fileversion{1.738}
+\def\filedate{2024/02/08}
\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]
@@ -105,7 +105,6 @@
\newcommand*{\ntxtext@rm}{} % not understood by libertinus-otf
\newcommand*{\ntxtext@sf}{}% not understood by libertinus-otf
-
\newcommand*{\ntxtext@scale}{1}
\newcommand*{\ntxmath@scale}{1}
\DeclareOptionX{scaled}[1]{\renewcommand*{\ntxtext@scale}{#1}\renewcommand*{\ntxmath@scale}{#1}}
@@ -121,6 +120,16 @@
\DeclareOptionX{ttscale}[]{\renewcommand*{\ntxtext@ttscale}{#1}}
\DeclareOptionX{rm}[true]{\renewcommand*{\ntxtext@rm}{#1}}
\DeclareOptionX{sf}[true]{\renewcommand*{\ntxtext@sf}{#1}}
+\newif\iftx@helv \tx@helvtrue
+\newif\iftx@tt \tx@tttrue
+\DeclareOptionX{nohelv}[true]{%
+\@nameuse{if#1}\tx@helvfalse\fi}
+\DeclareOptionX{nott}[true]{%
+\@nameuse{if#1}\tx@ttfalse\fi}
+\def\tx@helvratio{.94}
+\DeclareOptionX{helvratio}[0.94]{%
+\def\tx@helvratio{#1}
+}
\DeclareOptionX{type1}[true]{}% no effect now
%{%\@nameuse{if#1}\ntx@otftextfalse\fi}
@@ -259,7 +268,8 @@
\DeclareOptionX{sfracscaling}{%
\def\tx@sfrSC{#1}}
% \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
+\ProcessOptionsX\relax
+
%\show\ntx@Mopt
%\show\ntx@Topt
%\traceon
@@ -275,8 +285,30 @@
\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\fi
-
+ \fi
+\else % t1 math
+ \ifnum\ntx@id=0
+ \ifthenelse{\not\equal{\sfdefault}{cmss}}%
+ {\tx@helvfalse}{}
+ \ifthenelse{\not\equal{\ttdefault}{cmtt}}%
+ {\tx@ttfalse}{}
+ \iftx@helv
+ \renewcommand*{\sfdefault}{qhv}
+ \@tempdima=\ntxtext@scale\p@
+ \@tempdima=\tx@helvratio\@tempdima%
+ \edef\qhv@scale{\strip@pt\@tempdima}
+ \else
+ \PassOptionsToPackage{nohelv=true}{newtxtext}
+ \fi
+ \iftx@tt\renewcommand*{\ttdefault}{ntxtt}\fi
+ \ifthenelse{\not\equal{\tx@helvratio}{.94}}%
+ {\PassOptionsToPackage{helvratio=\tx@helvratio}%
+ {newtxtext}}{}
+ \iftx@tt\else%
+ \PassOptionsToPackage{nott=true}{newtxtext}\fi
+
+ \fi
+\fi
%\ifntx@badnof\PackageError{newtx.sty}{Incompatible options, nofontspec and otfmath}{Incompatible options, nofontspec and otfmath}\fi
% Set the text scale macros appropriately
%\show\ntx@TF
diff --git a/fonts/newtx/tex/newtxtext.sty b/fonts/newtx/tex/newtxtext.sty
index ac7033051d..8cf041be09 100644
--- a/fonts/newtx/tex/newtxtext.sty
+++ b/fonts/newtx/tex/newtxtext.sty
@@ -11,8 +11,8 @@
%\def\ntx@state{0} % 0 for both, 1 for tutex only, 2 for legacy only
\def\setstate#1{\if 1\ntx@showstate\typeout{State=#1}\fi}
-\def\fileversion{1.737}
-\def\filedate{2024/01/11}
+\def\fileversion{1.738}
+\def\filedate{2024/02/08}
\ProvidesPackage{newtxtext}[%
\filedate\space v\fileversion (Michael Sharpe) latex and unicode latex support for TeXGyreTermesX]
@@ -227,7 +227,14 @@
\ProcessOptionsX\relax
\ifntx@supsflag%
-\PackageWarningNoLine{newpxtext}{sups options no longer handled---use superiors package (v2) instead.}\fi
+\PackageWarningNoLine{newtxtext}{sups options no longer handled---use superiors package (v2) instead.}\fi
+
+\ifthenelse{\not\equal{\sfdefault}{cmss}}%
+ {\ntx@helvfalse}{}
+\ifthenelse{\not\equal{\ttdefault}{cmtt}}%
+ {\ntx@ttfalse}{}
+\ifntx@helv\renewcommand*{\sfdefault}{qhv}\fi
+\ifntx@tt\renewcommand*{\ttdefault}{ntxtt}\fi
% otfmath beats no-math
\ifntx@otfmath\ntx@nomathfalse\fi
@@ -241,8 +248,6 @@
\ifntx@newtx\let\ntx@scale=\ntxtext@scale\fi
% following lines required by newtxmath
% They must follow the definition of \ntx@scaled
-\@tempdima=\ntx@scale\p@\@tempdima=\ntx@helvratio\@tempdima%
-\edef\qhv@scale{\strip@pt\@tempdima}
\edef\ntx@scaled{s*[\ntx@scale]}% used in fd files
\providecommand*{\ntx@minfam}{minntx} % won't override value from newtx
@@ -552,8 +557,6 @@
% \fi}%
% \fi
% \fi
- \ifntx@helv\renewcommand*{\sfdefault}{qhv}\fi
- \ifntx@tt\renewcommand*{\ttdefault}{ntxtt}\fi
\DeclareRobustCommand\thfamily % new family for theorem font
{\not@math@alphabet\thfamily\relax
\fontfamily\thdefault\selectfont}