summaryrefslogtreecommitdiff
path: root/fonts/newpx/tex/newpx.sty
diff options
context:
space:
mode:
Diffstat (limited to 'fonts/newpx/tex/newpx.sty')
-rw-r--r--fonts/newpx/tex/newpx.sty45
1 files changed, 37 insertions, 8 deletions
diff --git a/fonts/newpx/tex/newpx.sty b/fonts/newpx/tex/newpx.sty
index 6cb08a9a82..f26e2a5b54 100644
--- a/fonts/newpx/tex/newpx.sty
+++ b/fonts/newpx/tex/newpx.sty
@@ -2,8 +2,8 @@
%Package to simplify loading of newpxmath with a text font family such as newpxtext for all latex engines, or for newpxtext and an otf math package.
-\def\fileversion{1.533}
-\def\filedate{2023/11/08}
+\def\fileversion{1.536}
+\def\filedate{2024/02/09}
\ProvidesPackage{newpx}[%
\filedate\space v\fileversion (Michael Sharpe) latex and unicode latex support for newpxmath and newpxtext, or for newpxtext and an otf math package]
@@ -14,9 +14,10 @@
\RequirePackage{ifthen,iftex,etoolbox,scalefnt,trimspaces}
\forcsvlist{\listadd\zpl@mathlst}{vecsep,amsthm,nosubscriptcorrection,subscriptcorrection,varbb,vvarbb,nosymbolsc,noamssymbols,amssymbols,uprightscript,uprightGreek,slantedGreek,frenchmath,upint,smallerops,useBImacros,varg,varvw,noOT1,fracspacing,subscriptcorrectionfile,curlybraces}
-%\show\zpl@mathlst
-\RequirePackage{kvoptions}
+\RequirePackage{kvoptions}
+\def\zpl@scale{1}
+\def\newpx@helvratio{1}
\DeclareDefaultOption{
\xifinlist{\CurrentOptionKey}{\zpl@mathlst}
{% true branch for xifinlist
@@ -27,14 +28,18 @@
{\CurrentOption}{newpxtext}}
\ifthenelse{\equal{scale}{\CurrentOptionKey} \OR \equal{scaled}{\CurrentOptionKey}}
{% true branch for ifthenelse
-%\expandafter\PassOptionsToPackage\expandafter{\CurrentOption}{newpxmath}
-\edef\zpl@scale{\CurrentOptionValue}
-\edef\npxmath@scaled{\CurrentOptionValue}
+\xdef\zpl@scale{\CurrentOptionValue}
+\xdef\npxmath@scaled{\CurrentOptionValue}
}{ % false branch for ifthenelse
-}}
+\ifthenelse{\equal{helvratio}{\CurrentOptionKey}}
+{% true branch
+\xdef\newpx@helvratio{\CurrentOptionValue}
+}{}}}
%\newif\ifzpl@otfmath %\zpl@otfmathfalse % default is type1 math
\DeclareBoolOption{otfmath}% creates and inits \ifnewpx@otfmath
%{\@nameuse{if#1}\iftutex\zpl@otfmathtrue\fi\fi}
+\DeclareBoolOption{nohelv}% creates and inits \ifnewpx@nohelv
+\DeclareBoolOption{nott}% creates and inits \ifnewpx@nott
\DeclareBoolOption{type1}%[true]{}% no effect now
%{%\@nameuse{if#1}\zpl@otftextfalse\fi}
@@ -76,7 +81,31 @@
%\newcommand{\PassMathScale}{\ifzpl@iszero\gdef\zpltext@scale{\zplmath@scale}\gdef\zpltext@scaled{s*[\zpltext@scale]}\fi
%\PassOptionsToPackage{scaled=\zpltext@scale}{\zpl@TF}
%}
+\ifnewpx@otfmath
+\else % t1 math
+ \ifthenelse{\not\equal{\sfdefault}{cmss}}%
+ {\newpx@nohelvtrue}{}
+ \ifthenelse{\not\equal{\ttdefault}{cmtt}}%
+ {\newpx@notttrue}{}
+ \ifnewpx@nohelv
+ \else
+ \renewcommand*{\sfdefault}{qhv}
+ \@tempdima=\zpl@scale\p@
+ \@tempdima=\newpx@helvratio\@tempdima%
+ \edef\qhv@scale{\strip@pt\@tempdima}
+% \else
+% \PassOptionsToPackage{nohelv=true}{newtxtext}
+ \fi
+ \ifnewpx@nott\else%
+ \renewcommand*{\ttdefault}{npxtt}
+ \fi
+% \ifthenelse{\not\equal{\newpx@helvratio}{.94}}%
+% {\PassOptionsToPackage{helvratio=\newpx@helvratio}%
+% {newtxtext}}{}
+% \iftx@tt\else%
+% \PassOptionsToPackage{nott=true}{newtxtext}\fi
+\fi
\ifzpl@otftext
\ifnewpx@otfmath %
\typeout{I}