diff options
author | Norbert Preining <norbert@preining.info> | 2023-08-22 03:01:06 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-08-22 03:01:06 +0000 |
commit | cf3e954514eb50bea0335bdc97d6b76f80f5d03e (patch) | |
tree | 84960c9724915fd64626f3b8c532a671ea7e87f2 /fonts/newpx/tex/newpxtext.sty | |
parent | f4e4c48e897bec27fd8d07ba278c03c6f0c64336 (diff) |
CTAN sync 202308220301
Diffstat (limited to 'fonts/newpx/tex/newpxtext.sty')
-rw-r--r-- | fonts/newpx/tex/newpxtext.sty | 144 |
1 files changed, 110 insertions, 34 deletions
diff --git a/fonts/newpx/tex/newpxtext.sty b/fonts/newpx/tex/newpxtext.sty index 046df984b0..8df47a8fb1 100644 --- a/fonts/newpx/tex/newpxtext.sty +++ b/fonts/newpx/tex/newpxtext.sty @@ -8,8 +8,8 @@ % Text is now directed to an extension of TeXGyrePagella rather than ppl. % 1.5 is first version of newpxtext to support both [pdf]latex and unicode latex. -\def\fileversion{1.504} -\def\filedate{2022/01/30} +\def\fileversion{1.51} +\def\filedate{2023/08/06} \ProvidesPackage{newpxtext}[% \filedate\space v\fileversion (Michael Sharpe) latex and unicode latex support for TeXGyrePagellaX] @@ -18,7 +18,7 @@ \RequirePackage[T1]{fontenc} \renewcommand*{\rmdefault}{zplTLF} % the default until end of preamble \renewcommand*{\familydefault}{\rmdefault} -\RequirePackage{ifxetex,ifluatex,xkeyval,etoolbox,textcomp} +\RequirePackage{iftex,xkeyval,etoolbox,textcomp} \RequirePackage{xstring,ifthen,scalefnt} % for \textfrac \IfFileExists{mweights.sty}{\RequirePackage{mweights}}{} \DeclareEncodingSubset{TS1}{zpl*}{0} @@ -30,14 +30,11 @@ % Engine check \newif\ifzpl@otf -\ifxetex - \zpl@otftrue -\else\ifluatex - \zpl@otftrue -\else % [pdf]LaTeX - \zpl@otffalse -\fi\fi - +\iftutex\zpl@otftrue +%\else % [pdf]LaTeX +% \zpl@otffalse +\fi +\def\zpl@divide#1#2{\strip@pt\dimexpr 1pt * (\dimexpr #1pt\relax) / \dimexpr #2pt\relax\relax} %%%%%%%%%%%%%%%%%% \IfFileExists{xkeyval.sty}{ \RequirePackage{xkeyval} @@ -46,17 +43,17 @@ \let\ExecuteOptionsX\ExecuteOptions \let\ProcessOptionsX\ProcessOptions } -%%%%Start Options +%%%% Start Options \newif\ifzpl@nomath\zpl@nomathfalse % load fontspec with no-math \newif\ifzpl@lining\zpl@liningtrue \newif\ifzpl@tabular\zpl@tabulartrue % default is tabular lining figures \@ifundefined{ver@newpxmath.sty}{}{\zpl@nomathtrue} \DeclareOptionX{type1}[true]{% -\@nameuse{if#1}\zpl@otffalse\fi +%\@nameuse{if#1}\zpl@otffalse\fi } \DeclareOptionX{nofontspec}[true]{% -\@nameuse{if#1}\zpl@otffalse\fi +%\@nameuse{if#1}\zpl@otffalse\fi } \DeclareOptionX{no-math}[true]{% \@nameuse{if#1}\zpl@nomathtrue\fi @@ -111,9 +108,9 @@ } %Scale -\newcommand*{\zpl@scale}{1} % actual scaled command in \zpl@scaled -\DeclareOptionX{scale}{\renewcommand*{\zpl@scale}{#1}} -\DeclareOptionX{scaled}{\renewcommand*{\zpl@scale}{#1}} +\providecommand{\zpl@scale}{1} % actual scaled command in \zpl@scaled +\DeclareOptionX{scale}{\def\zpl@scale{#1}} +\DeclareOptionX{scaled}{\def\zpl@scale{#1}} \newif\ifzpl@defaultsups %\newif\ifzpl@adobesc % we don't use this exc. in fd, but may in future @@ -158,13 +155,13 @@ \DeclareOptionX{shrink}{% \def\zpl@shrink{#1} } -\def\zpl@defaultfeatures{} \newcount\zpl@cnt \zpl@cnt=0 \newif\ifzpl@zeroslash +\newif\ifzpl@notextnu \def\zpl@thmlin{X} % default is to not change to lining \def\zpl@noti{T}\def\zpl@nolo{T} -\DeclareOptionX{defaultfeatures}{\def\zpl@defaultfeatures{#1}} \DeclareOptionX{oldSS}{\advance\zpl@cnt 32 } +\DeclareOptionX{notextnu}{\zpl@notextnutrue} \DeclareOptionX{slashedzero}{\zpl@zeroslashtrue} \DeclareOptionX{theoremfont}{\zpl@thrmtrue } \DeclareOptionX{thmlining}{\edef\zpl@thmlin{l}} @@ -177,8 +174,27 @@ \gdef\zpl@spc{.3em}\gdef\zpl@stretch{.2em}% \gdef\zpl@shrink{.1em}\def\zpl@nolo{F}} +\DeclareOptionX{sfracvcenter}{% +\def\zpl@sfrVC{#1}} +\DeclareOptionX{sfracvspacing}{% +\def\zpl@sfrVS{#1}} +\DeclareOptionX{sfracbarthick}{% +\def\zpl@sfrTH{#1}} +\DeclareOptionX{sfracscaling}{% +\def\zpl@sfrSC{#1}} + \ProcessOptionsX\relax +% for stacked fractions +\@ifundefined{zpl@xht}{\def\zpl@xht{460}}{} % lowercase letters +\@ifundefined{zpl@deht}{\def\zpl@deht{412}}{} % denominator figures ht +\@ifundefined{zpl@nubase}{\def\zpl@nubase{270}}{} % baseline of numerators +\@ifundefined{zpl@debase}{\def\zpl@debase{0}}{} % baseline of denoms +\@ifundefined{zpl@sfrVC}{\def\zpl@sfrVC{335}}{}% vertical center of sfrac +\@ifundefined{zpl@sfrVS}{\def\zpl@sfrVS{106}}{} % space above/below bar +\@ifundefined{zpl@sfrTH}{\def\zpl@sfrTH{52}}{} % bar thickness +\@ifundefined{zpl@sfrSC}{\def\zpl@sfrSC{.9}}{} % scale defigures by this + \def\re@DeclareTextSymbol#1#2#3{% \let#1=\undefined \DeclareTextSymbol{#1}{#2}{#3}} @@ -189,7 +205,8 @@ \RequirePackage{fontspec} \fi - \ifxetex\XeTeXtracingfonts=1\fi + %\ifxetex\XeTeXtracingfonts=1\fi % causing unwanted warnings in Tectonic system + \ifluatex % avoid possibly uncorrected "system" fonts \directlua{fonts.names.set_location_precedence{ "local", "texmf", "system" }} @@ -219,7 +236,7 @@ \let\sufigures=\sustyle \let\nustyle=\sustyle \let\nufigures=\sustyle - + \fa@naming@exception{figures}{{inferior}{proportional}}{inf} \fa@naming@exception{figures}{{inferior}{tabular}}{inf} % \def\infigures{\@nomath\infigures @@ -260,7 +277,7 @@ \mbox{% \ifthenelse{\not\equal{#1}{}}%Test for integer portion [optional #1] {\textlf{#1}\kern.1em}{}% - {\sustyle#2}% numerator + {\nustyle#2}% numerator \StrRight{#2}{1}[\@digit@]% % look for 1, 2, 6, 7 \ifcase\@digit@% 0 @@ -331,7 +348,7 @@ {\edef\zpl@dflt{\zpl@dflt StylisticSet={\zpl@lst} , }}{} - \defaultfontfeatures{ + \defaultfontfeatures[\zpl@base]{ Ligatures = TeX , Scale = \zpl@scale , Extension = .otf , @@ -375,7 +392,8 @@ \ifzpl@defaultsups % \else \ifzpl@KOMA - %\let\textsuperscript\sustyle + \let\textsuperscript\sustyle + \setkomafont{footnotelabel}{\textsuperscript} \else % NOT KOMA \def\f@@tn@te{footnote} \def\@makefnmark{% @@ -444,14 +462,14 @@ \let\nustyle=\nufigures \let\instyle=\infigures \let\destyle=\defigures + \ifzpl@KOMA + \setkomafont{footnotereference}{\normalfont} + \else + \renewcommand{\footnotemarkfont}{\normalfont} + \fi \ifzpl@defaultsups % \else - \usepackage{realscripts} - \ifzpl@KOMA - \setkomafont{footnotelabel}{\normalfont} - \else - \renewcommand\footnotemarkfont{\normalfont} - \fi + \RequirePackage{realscripts} \fi % \ifzpl@scosf % \edef\zpl@fnt{\expandafter\csname zpl\ifzpl@tabular T\fi OsF\endcsname} @@ -491,13 +509,63 @@ } \DeclareTextFontCommand{\textsu}{\sustyle} \let\textsuperior\textsu -\DeclareTextFontCommand{\textnu}{\nustyle} - \let\textnumerator\textnu +\DeclareTextFontCommand{\textnumerator}{\nustyle} + \ifzpl@notextnu\else\let\textnu=\textnumerator\fi + \let\textnum\textnumerator \DeclareTextFontCommand{\textde}{\destyle} \let\textdenominator\textde \DeclareTextFontCommand{\textinf}{\instyle} \let\textinferior\textinf +\newdimen\zpl@sixem\zpl@sixem6pt % for checking if a number refers to ex +\newdimen\zpl@y \newdimen\zpl@x + +% convert numerical entry that may be multiple of ex (<6) or em value +\def\zpl@toex#1{\zpl@x#1pt \ifdim\zpl@x<\z@\zpl@y-\zpl@x\else\zpl@y\zpl@x\fi \ifdim\zpl@y>\zpl@sixem \zpl@x\dimexpr + 1pt * (\dimexpr #1pt\relax) / \dimexpr \zpl@xht pt\relax\relax\fi} + +\newdimen\zpl@tmpdima \newdimen\zpl@tmpdimb \newdimen\zpl@tmpdimc +\newdimen\zpl@tmpdimd \newdimen\zpl@tmpdime \newdimen\zpl@tmpdimf +\newdimen\zpl@dimA +\newdimen\zpl@dimAA \newdimen\zpl@dimB \newdimen\zpl@dimBB +\newdimen\zpl@dimC % vertical center +% double cap letters for below bar, single cap for above + +\zpl@toex\zpl@sfrVC\zpl@dimC\zpl@x %Vertical center of fraction +\zpl@toex\zpl@sfrTH\zpl@tmpdimb\zpl@x % bar thickness +\zpl@tmpdime.5\zpl@tmpdimb % half bar thickness +\zpl@toex\zpl@sfrVS\zpl@tmpdimc\zpl@x% vertical space +\zpl@toex\zpl@deht\zpl@tmpdimd\zpl@x % height of unscaled figures +\zpl@tmpdimd\zpl@sfrSC\zpl@tmpdimd % height of scaled figures +\zpl@toex\zpl@debase\zpl@tmpdimf\zpl@x % unscaled baseline of de figures +\zpl@toex\zpl@nubase\zpl@tmpdima\zpl@x % unscaled baseline of nu figures +\zpl@tmpdima\zpl@sfrSC\zpl@tmpdima % scaled nu baseline +\zpl@tmpdimf\zpl@sfrSC\zpl@tmpdimf % scaled de baseline +\zpl@dimA\zpl@dimC +\advance\zpl@dimA by \zpl@tmpdime % top of bar +\zpl@dimAA\zpl@dimC +\advance\zpl@dimAA by -\zpl@tmpdime % bottom of bar +\zpl@dimB\zpl@dimA +\advance\zpl@dimB by \zpl@tmpdimc % top figure baseline +\advance\zpl@dimB by -\zpl@tmpdima +\zpl@dimBB\zpl@dimAA +\advance\zpl@dimBB by -\zpl@tmpdimc % +\advance\zpl@dimBB by -\zpl@tmpdimd % bottom figure baseline +\advance\zpl@dimBB by -\zpl@tmpdimf +\newcommand*{\textsfrac}[3][]{% like \textsfrac[1]{23}{34} +\mbox{% + \ifthenelse{\not\equal{#1}{}}%Test for integer portion [optional #1] + {\textlf{#1}\kern.12em}{}% + {\hmode@bgroup% +\ooalign{% + \setbox0=\hbox{\scalefont{\zpl@sfrSC}\nustyle#2}% + \hfil \raise\strip@pt\zpl@dimB ex\box0\hfil \crcr% + \leaders\hrule height \strip@pt\zpl@dimA ex depth -\strip@pt\zpl@dimAA ex\hfill \crcr% + \setbox1=\hbox{\scalefont{\zpl@sfrSC}\destyle#3}% + \hfil\raise\strip@pt\zpl@dimBB ex\box1\hfil}% +\egroup}} +} + \AtEndPreamble{% \ifzpl@otf \ifzpl@lining @@ -556,15 +624,23 @@ \fi % there just two possible figure styles for the theorem font \newcommand*{\thdefault}{zplth-\zpl@thfigurestyle} \normalfont +\fi % type1 +% both +\ifzpl@KOMA + \let\textsuperscript\textsu + \@ifpackageloaded{AB@authnote}{% + \renewcommand\AB@authnote[1]{\textsuperscript{#1}} + \renewcommand\AB@affilnote[1]{\textsuperscript{#1}} + } \fi -} %both \ifzpl@thrm \@ifundefined{theoremstyle}{}{ \theoremstyle{plain} \patchcmd{\th@plain}{\itshape}{\thfamily}{\message{Replaced itshape by thfamily in theorem style plain.}}{\message{Unable to replace itshape by thfamily in theorem style plain.}} } -\fi +\fi +} % Define \oldstylenums, \liningnums ,\tabularnums and \proportionalnums \ifzpl@otf |