summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/newpx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-12-17 21:30:58 +0000
committerKarl Berry <karl@freefriends.org>2018-12-17 21:30:58 +0000
commitd65b10c7cfb0918a690f01a81c42a331b03ee192 (patch)
tree585b2cbc20a50ced51050c67f83c00d8c7f09ec8 /Master/texmf-dist/tex/latex/newpx
parent0eca414d24b2ef276840906d8b58eafb63bd573f (diff)
newpx (17dec18)
git-svn-id: svn://tug.org/texlive/trunk@49438 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/newpx')
-rw-r--r--Master/texmf-dist/tex/latex/newpx/newpxmath.sty282
1 files changed, 195 insertions, 87 deletions
diff --git a/Master/texmf-dist/tex/latex/newpx/newpxmath.sty b/Master/texmf-dist/tex/latex/newpx/newpxmath.sty
index 29f408e04f0..60b6483fc14 100644
--- a/Master/texmf-dist/tex/latex/newpx/newpxmath.sty
+++ b/Master/texmf-dist/tex/latex/newpx/newpxmath.sty
@@ -11,8 +11,8 @@
% of glyph collisions.
% These modifications are by Michael Sharpe, msharpe at ucsd dot edu
-\def\fileversion{1.32}
-\def\filedate{2017/05/31}
+\def\fileversion{1.33}
+\def\filedate{2018/11/22}
\ProvidesPackage{newpxmath}
[\filedate\space v\fileversion]
%\@ifundefined{newpxmathLoaded}{}{\endinput}
@@ -22,7 +22,10 @@
%\csname newpxmathLoaded\endcsname
%\let\newpxmathLoaded\endinput
\RequirePackage{amsmath} % for better \left
-%\def\ly@one{LY1}
+\RequirePackage{etoolbox}
+%\RequirePackage{etextools} % for \ifiscs, conflicts with biblatex
+% replacement for \ifiscs
+\def\ifiscseq#1{\ifcat$\expandafter\@gobble\string#1$\expandafter\@secondoftwo\else\expandafter\@firstoftwo\fi}%\def\ly@one{LY1}
\def\t@one{T1}
%\def\ot@one{OT1}
@@ -201,26 +204,44 @@ amssymbols,uprightGreek}
\DeclareMathSymbol{#1}{#2}{#3}{#4}
\advance #4 by1}
+\DeclareRobustCommand{\BI@}[1]{%
+\begingroup\text{\mathversion{bold}$#1$}\endgroup}
+%\DeclareRobustCommand{\BIA}{\BI@{A}} % etc
+
+\newcount\px@cntz
+\newcount\px@IsAlNum
\def\px@isdigit#1{% #1 should be a single character
\px@Isdigit=\z@ %
-\count0=\number`#1\relax%
-\ifnum\count0>47\relax%
-\ifnum\count0<58\relax%
+\px@cntz=\number`#1\relax%
+\ifnum\px@cntz>47\relax%
+\ifnum\px@cntz<58\relax%
\px@Isdigit=\@ne %
\fi%
\fi%
}
-\DeclareRobustCommand{\BI@}[1]{%
-\begingroup\text{\mathversion{bold}$#1$}\endgroup}
-%\DeclareRobustCommand{\BIA}{\BI@{A}} % etc
+\def\px@isAlNum#1{% #1 should be a single character
+\px@IsAlNum=\z@ %
+\px@cntz=\number`#1\relax%
+\ifnum\px@cntz>47\relax%
+ \ifnum\px@cntz<58\relax%
+ \px@IsAlNum=\@ne %
+ \else
+ \ifnum\px@cntz>64\relax%
+ \ifnum\px@cntz<91\relax%
+ \px@IsAlNum=\tw@ %
+ \else
+ \ifnum\px@cntz>96\relax%
+ \ifnum\px@cntz<123\relax%
+ \px@IsAlNum=3\relax %
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+\fi
+}
-\def\px@XXX#1#2\@nil{% #1=first character, #2=rest of string
-\px@isdigit{#1}%
-\ifnum\px@Isdigit>\z@ $#1$\else#1\fi%
-\if\relax\detokenize{#2}\relax \else
-\edef\px@XXXcmd{\noexpand\px@XXX #2\noexpand\@nil}\px@XXXcmd \fi}
-\def\equalht#1{\px@XXX #1\@nil}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1524,98 +1545,185 @@ $\hfil\displaystyle{#1}\hfil$\crcr%
\re@DeclareMathSymbol{\varg}{\mathord}{lettersA}{49}
\DeclareMathSymbol{\uppartial}{\mathord}{lettersA}{64}
-\def\npx@UC{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z}
-\def\npx@lc{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}
-\def\npx@num{0,1,2,3,4,5,6,7,8,9}
+%\def\npx@UC{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z}
+%\def\npx@lc{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}
+%\def\npx@num{0,1,2,3,4,5,6,7,8,9}
-%\@for\npx@x:=\npx@UC\do{\edef\npx@tmp{\edef\csname
+%%\@for\npx@x:=\npx@UC\do{\edef\npx@tmp{\edef\csname
+%%\DeclareMathSymbol{\m@thbbch@rA}{\mathord}{lettersA}{129}
%\DeclareMathSymbol{\m@thbbch@rA}{\mathord}{lettersA}{129}
-\DeclareMathSymbol{\m@thbbch@rA}{\mathord}{lettersA}{129}
-\DeclareMathSymbol{\m@thbbch@rB}{\mathord}{lettersA}{130}
-\DeclareMathSymbol{\m@thbbch@rC}{\mathord}{lettersA}{131}
-\DeclareMathSymbol{\m@thbbch@rD}{\mathord}{lettersA}{132}
-\DeclareMathSymbol{\m@thbbch@rE}{\mathord}{lettersA}{133}
-\DeclareMathSymbol{\m@thbbch@rF}{\mathord}{lettersA}{134}
-\DeclareMathSymbol{\m@thbbch@rG}{\mathord}{lettersA}{135}
-\DeclareMathSymbol{\m@thbbch@rH}{\mathord}{lettersA}{136}
-\DeclareMathSymbol{\m@thbbch@rI}{\mathord}{lettersA}{137}
-\DeclareMathSymbol{\m@thbbch@rJ}{\mathord}{lettersA}{138}
-\DeclareMathSymbol{\m@thbbch@rK}{\mathord}{lettersA}{139}
-\DeclareMathSymbol{\m@thbbch@rL}{\mathord}{lettersA}{140}
-\DeclareMathSymbol{\m@thbbch@rM}{\mathord}{lettersA}{141}
-\DeclareMathSymbol{\m@thbbch@rN}{\mathord}{lettersA}{142}
-\DeclareMathSymbol{\m@thbbch@rO}{\mathord}{lettersA}{143}
-\DeclareMathSymbol{\m@thbbch@rP}{\mathord}{lettersA}{144}
-\DeclareMathSymbol{\m@thbbch@rQ}{\mathord}{lettersA}{145}
-\DeclareMathSymbol{\m@thbbch@rR}{\mathord}{lettersA}{146}
-\DeclareMathSymbol{\m@thbbch@rS}{\mathord}{lettersA}{147}
-\DeclareMathSymbol{\m@thbbch@rT}{\mathord}{lettersA}{148}
-\DeclareMathSymbol{\m@thbbch@rU}{\mathord}{lettersA}{149}
-\DeclareMathSymbol{\m@thbbch@rV}{\mathord}{lettersA}{150}
-\DeclareMathSymbol{\m@thbbch@rW}{\mathord}{lettersA}{151}
-\DeclareMathSymbol{\m@thbbch@rX}{\mathord}{lettersA}{152}
-\DeclareMathSymbol{\m@thbbch@rY}{\mathord}{lettersA}{153}
-\DeclareMathSymbol{\m@thbbch@rZ}{\mathord}{lettersA}{154}
-
-\DeclareMathSymbol{\m@thbbch@rk}{\mathord}{lettersA}{171}
-% Original \varmathbb macro, slightly polished
-\def\DoFutureLet{%
- \def\@FutureLetDecide{%
- \ifx\@nil\@FutureLetToken
- \def\@FutureLetNext{\@EachCharacterDone}
- \else
- \def\@FutureLetNext{\@PickUpTheCharacter}
- \fi
- \@FutureLetNext
- }%
-\futurelet\@FutureLetToken\@FutureLetDecide}% end DoFutureLet
-
-%\def\m@keCharacter#1{%
-% \@tempcnta=`#1\relax \advance\@tempcnta "40\relax
-% \edef\npx@char{\npx@lettersA\nhex{2}{\the\@tempcnta}}
-% \expandafter\mathchar\npx@char}
-%\def\@PickUpTheCharacter#1{\m@keCharacter{#1}\DoFutureLet}
-%\def\@EachCharacterDone \@nil{}% cleanup---get rid of \@nil
-%\newif\ifnpx@notnil
-%\def\@EachCharacter{%
-% \DoFutureLet{\@EachCharacterDone}{\@PickUpTheCharacter}}
+%\DeclareMathSymbol{\m@thbbch@rB}{\mathord}{lettersA}{130}
+%\DeclareMathSymbol{\m@thbbch@rC}{\mathord}{lettersA}{131}
+%\DeclareMathSymbol{\m@thbbch@rD}{\mathord}{lettersA}{132}
+%\DeclareMathSymbol{\m@thbbch@rE}{\mathord}{lettersA}{133}
+%\DeclareMathSymbol{\m@thbbch@rF}{\mathord}{lettersA}{134}
+%\DeclareMathSymbol{\m@thbbch@rG}{\mathord}{lettersA}{135}
+%\DeclareMathSymbol{\m@thbbch@rH}{\mathord}{lettersA}{136}
+%\DeclareMathSymbol{\m@thbbch@rI}{\mathord}{lettersA}{137}
+%\DeclareMathSymbol{\m@thbbch@rJ}{\mathord}{lettersA}{138}
+%\DeclareMathSymbol{\m@thbbch@rK}{\mathord}{lettersA}{139}
+%\DeclareMathSymbol{\m@thbbch@rL}{\mathord}{lettersA}{140}
+%\DeclareMathSymbol{\m@thbbch@rM}{\mathord}{lettersA}{141}
+%\DeclareMathSymbol{\m@thbbch@rN}{\mathord}{lettersA}{142}
+%\DeclareMathSymbol{\m@thbbch@rO}{\mathord}{lettersA}{143}
+%\DeclareMathSymbol{\m@thbbch@rP}{\mathord}{lettersA}{144}
+%\DeclareMathSymbol{\m@thbbch@rQ}{\mathord}{lettersA}{145}
+%\DeclareMathSymbol{\m@thbbch@rR}{\mathord}{lettersA}{146}
+%\DeclareMathSymbol{\m@thbbch@rS}{\mathord}{lettersA}{147}
+%\DeclareMathSymbol{\m@thbbch@rT}{\mathord}{lettersA}{148}
+%\DeclareMathSymbol{\m@thbbch@rU}{\mathord}{lettersA}{149}
+%\DeclareMathSymbol{\m@thbbch@rV}{\mathord}{lettersA}{150}
+%\DeclareMathSymbol{\m@thbbch@rW}{\mathord}{lettersA}{151}
+%\DeclareMathSymbol{\m@thbbch@rX}{\mathord}{lettersA}{152}
+%\DeclareMathSymbol{\m@thbbch@rY}{\mathord}{lettersA}{153}
+%\DeclareMathSymbol{\m@thbbch@rZ}{\mathord}{lettersA}{154}
%
-\def\m@keCharacter#1{\csname\F@ntPrefix#1\endcsname}
-\def\@PickUpTheCharacter#1{\m@keCharacter{#1}\DoFutureLet}
-\def\@EachCharacterDone \@nil{}
+%\DeclareMathSymbol{\m@thbbch@rk}{\mathord}{lettersA}{171}
+%% Original \varmathbb macro, slightly polished
+%\def\DoFutureLet{%
+% \def\@FutureLetDecide{%
+% \ifx\@nil\@FutureLetToken
+% \def\@FutureLetNext{\@EachCharacterDone}
+% \else
+% \def\@FutureLetNext{\@PickUpTheCharacter}
+% \fi
+% \@FutureLetNext
+% }%
+%\futurelet\@FutureLetToken\@FutureLetDecide}% end DoFutureLet
%
+%%\def\m@keCharacter#1{%
+%% \@tempcnta=`#1\relax \advance\@tempcnta "40\relax
+%% \edef\npx@char{\npx@lettersA\nhex{2}{\the\@tempcnta}}
+%% \expandafter\mathchar\npx@char}
+%%\def\@PickUpTheCharacter#1{\m@keCharacter{#1}\DoFutureLet}
+%%\def\@EachCharacterDone \@nil{}% cleanup---get rid of \@nil
+%%\newif\ifnpx@notnil
+%%\def\@EachCharacter{%
+%% \DoFutureLet{\@EachCharacterDone}{\@PickUpTheCharacter}}
+%%
+%\def\m@keCharacter#1{\csname\F@ntPrefix#1\endcsname}
+%\def\@PickUpTheCharacter#1{\m@keCharacter{#1}\DoFutureLet}
+%\def\@EachCharacterDone \@nil{}
+%%
+%%\DeclareRobustCommand*{\varmathbb}[1]{\gdef\F@ntPrefix{m@thbbch@r}%
+%% \@EachCharacter #1\@nil}
%\DeclareRobustCommand*{\varmathbb}[1]{\gdef\F@ntPrefix{m@thbbch@r}%
-% \@EachCharacter #1\@nil}
-\DeclareRobustCommand*{\varmathbb}[1]{\gdef\F@ntPrefix{m@thbbch@r}%
- \DoFutureLet #1\@nil}
+% \DoFutureLet #1\@nil}
% Additional macros to access process a single character only, work with \bm
-\def\npx@char{}
-\DeclareRobustCommand*{\vmathbb}[1]{% for original variant bb
- \@tempcnta=`#1\relax \advance\@tempcnta "40\relax
- \edef\npx@char{"\hexnumber@\symlettersA\nhex{2}{\the\@tempcnta}}
- \expandafter\mathchar\npx@char
-}
-\DeclareRobustCommand*{\vvmathbb}[1]{% for new (STIX) variant
- \@tempcnta=`#1\relax \advance\@tempcnta "80\relax
- \edef\npx@char{"\hexnumber@\symlettersA\nhex{2}{\the\@tempcnta}}
- \expandafter\mathchar\npx@char
-}
+%\def\npx@char{}
+%\DeclareRobustCommand*{\vmathbb}[1]{% for original variant bb
+% \@tempcnta=`#1\relax \advance\@tempcnta "40\relax
+% \edef\npx@char{"\hexnumber@\symlettersA\nhex{2}{\the\@tempcnta}}
+% \expandafter\mathchar\npx@char
+%}
+%\DeclareRobustCommand*{\vvmathbb}[1]{% for new (STIX) variant
+% \@tempcnta=`#1\relax \advance\@tempcnta "80\relax
+% \edef\npx@char{"\hexnumber@\symlettersA\nhex{2}{\the\@tempcnta}}
+% \expandafter\mathchar\npx@char
+%}
%\DeclareRobustCommand*{\vvmathbbb}[1]{% for new (STIX) variant
% \@tempcnta=`#1\relax \advance\@tempcnta "80\relax
% \edef\npx@char{"\hexnumber@\symboldlettersA\nhex{2}{\the\@tempcnta}}
% \expandafter\mathchar\npx@char
%}
+% Experimental code May 8, 2018
+\newcount\npx@numstart
+\newcount\npx@UCstart
+\newcount\npx@lcstart
+\newcount\npx@tmpc
+\newcount\npx@imath
+\newcount\npx@jmath
+\newif\ifnpx@notempty
+\def\npx@fam{}
+\def\npx@char{}
+\def\npx@alfa#1#2#3#4#5#6#7{%#1=string, #2=UC,#3=lc,#4=imath,#5=jmath,#6=numstart,#7=fam
+ \npx@UCstart=#2
+ %\gdef\xx{x#3x}
+ \@xp\ifblank\@xp{#3}{\npx@lcstart=512 }{\npx@lcstart=#3}
+ \@xp\ifblank\@xp{#4}{\npx@imath=512 }{\npx@imath=#4}
+ \@xp\ifblank\@xp{#5}{\npx@jmath=512 }{\npx@jmath=#5}
+ \@xp\ifblank\@xp{#6}{\npx@numstart=512 }{\npx@numstart=#6}
+ \def\npx@fam{#7}
+ \@xp\ifblank\@xp{#1}{\relax}{\@xp\npx@@alfa #1\@nil}}
+
+\def\npx@@alfa#1#2\@nil{%
+ \npx@out{#1}
+ \ifblank{#2}{\relax}{\npx@@alfa #2\@nil}}
+
+\def\npx@out#1{% #1 is always a single token---use values from \npx@alfa
+ %\showthe\npx@numstart
+ \npx@tmpc=\z@
+ \ifx#1\imath\npx@tmpc=128\relax
+ \ifnum\npx@imath>255\relax #1\npx@tmpc=256 \message{^^JNo imath in this alphabet^^J}\fi
+ \else % not \imath
+ \ifx#1\jmath\npx@tmpc=129\relax
+ \ifnum\npx@jmath>255\relax #1\npx@tmpc=256 \message{^^JNo jmath in this alphabet^^J}\fi
+ \else % neither \imath nor \jmath
+ \ifiscseq{#1}{#1\npx@tmpc=256 }{% not a cs
+ \npx@tmpc=\number\@xp`#1}
+ \fi
+ \fi
+ %\message{^^JCharacter index = \the\npx@tmpc^^J}
+ \ifnum\npx@tmpc<128\relax % neither \imath nor \jmath nor cs
+ \px@isAlNum{#1}
+ %\message{^^JIsAlNum = \the\px@IsAlNum^^J}
+ \ifnum\px@IsAlNum=\@ne % it's a digit
+ \ifnum\npx@numstart>255\relax #1\npx@tmpc=256 \message{^^JNo digits in this alphabet^^J}
+ \else
+ \advance\npx@tmpc -48 % 0..9
+ \advance\npx@tmpc \npx@numstart
+ \fi
+ \else
+ \ifnum\px@IsAlNum=\tw@ % it's UC
+ \advance\npx@tmpc -65 % 0..25
+ \advance\npx@tmpc\npx@UCstart
+ \else
+ \ifnum\px@IsAlNum>\tw@ % it's lc
+ \ifnum\npx@lcstart>255 #1\npx@tmpc=256 \message{^^JNo lowercase in this alphabet^^J}
+ \else
+ %\message{^^JCharacter index = \the\npx@tmpc^^J
+ %lcstart = \the\npx@lcstart^^J}
+ \advance\npx@tmpc -97 % 0..25
+ \advance\npx@tmpc\npx@lcstart
+ %\message{^^JCharacter index = \the\npx@tmpc^^J}
+ \fi
+ \else % it must be a character outside alphanumerics
+ #1
+ \fi
+ \fi
+ \fi
+ \else % npx@tmpc>127
+ \ifnum\npx@tmpc=128\relax % imath
+ \npx@tmpc=\npx@imath
+ \else
+ \ifnum\npx@tmpc=129\relax % jmath
+ \npx@tmpc=\npx@jmath
+ \fi
+ \fi
+ \fi
+ \ifnum\npx@tmpc<256\relax
+ \edef\npx@char{"\@xp\hexnumber@\csname sym\npx@fam\endcsname\nhex{2}{\the\npx@tmpc}}
+ %\message{^^Joutput char = \npx@char^^J}
+ \@xp\mathchar\npx@char%\traceoff
+ \fi %end of ifnum <256
+}
+
+\DeclareRobustCommand{\vmathbb}[1]{\npx@alfa{#1}{129}{159}{}{}{}{lettersA}}
+\DeclareRobustCommand{\vvmathbb}[1]{\npx@alfa{#1}{193}{225}{}{}{176}{lettersA}}
+
\ifpx@vvarbb
\let\mathbb\vvmathbb
\else
\ifpx@varbb
- \let\mathbb\varmathbb
+ \let\mathbb\vmathbb
\else
- \ifpx@ams\else\let\mathbb\varmathbb\fi
+ \ifpx@ams\else\let\mathbb\vmathbb\fi
\fi
\fi
+\let\varmathbb\vmathbb
+\let\vvarmathbb\vvmathbb
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Math Extension (npxex) Definition % largesymbols
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%