summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/libertinust1math
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-01-02 21:03:59 +0000
committerKarl Berry <karl@freefriends.org>2022-01-02 21:03:59 +0000
commitc223d864b37c40c9e2ea5a487c0a112dd8f52ad6 (patch)
tree0027904b236762b5855488e9dcea16a79f9de717 /Master/texmf-dist/tex/latex/libertinust1math
parentfbb993ad4587960c39c6ca00b831b178b1cc116f (diff)
libertinust1math (2jan22)
git-svn-id: svn://tug.org/texlive/trunk@61467 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/libertinust1math')
-rw-r--r--Master/texmf-dist/tex/latex/libertinust1math/libertinust1math.sty334
1 files changed, 288 insertions, 46 deletions
diff --git a/Master/texmf-dist/tex/latex/libertinust1math/libertinust1math.sty b/Master/texmf-dist/tex/latex/libertinust1math/libertinust1math.sty
index 1b5a46861e6..38d00514e97 100644
--- a/Master/texmf-dist/tex/latex/libertinust1math/libertinust1math.sty
+++ b/Master/texmf-dist/tex/latex/libertinust1math/libertinust1math.sty
@@ -1,10 +1,10 @@
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\def\fileversion{1.2.4}
-\def\filedate{2021/06/01}
+\def\fileversion{2.0.0}
+\def\filedate{2021/12/31}
\ProvidesPackage{libertinust1math}
[\filedate\space v\fileversion---latex support for LibertinusT1Math (msharpe)]
-\RequirePackage{xkeyval}
+\RequirePackage{xkeyval,etoolbox}
\newif\iflibus@upint %\libus@upintfalse
\newif\iflibus@ams % amsfonts
\newif\iflibus@frenchm
@@ -15,7 +15,16 @@
\newif\iflibus@reuseMathAlphabets
\newif\iflibus@mathsfit %
\let\libus@lcgc\mathord
+\newif\iflibus@sbc
+\newif\iflibus@subsfile
+\newcommand{\enablesbcorrection}{\libus@sbctrue\AtBeginDocument{\mathcode`\_=\string"8000 \catcode`\_=12\relax}}
+\newif\ifntx@amsthm
+\def\ntxmath@vecsep{.25ex}
+
+\DeclareOptionX{subscriptcorrectionfile}{\def\libus@subs{#1}\libus@subsfiletrue}
+\DeclareOptionX{nosubscriptcorrection}{\libus@sbcfalse}
+\DeclareOptionX{subscriptcorrection}{\libus@sbctrue}
\DeclareOptionX{lcgreekalpha}{\let\libus@lcgc\mathalpha}
\DeclareOptionX{upint} {\libus@upinttrue}
\DeclareOptionX{frenchmath} {\libus@frenchmtrue}
@@ -28,8 +37,10 @@
\DeclareOptionX{mathsfit} {\libus@mathsfittrue}
\DeclareOptionX{scale} {\def\libus@scale{#1}}
\DeclareOptionX{scaled} {\def\libus@scale{#1}}
+\DeclareOptionX{amsthm}{\ntx@amsthmtrue}
\ProcessOptionsX\relax
+
\iflibus@frenchm\libus@slantedGfalse\fi
\iflibus@sansmath\libus@nosanstrue\fi
\iflibus@mathsfit\libus@nosansfalse\fi
@@ -45,6 +56,12 @@
\fi
\RequirePackage{amsmath}
+\ifntx@amsthm
+ \RequirePackage{amsthm}
+ \typeout{amsthm loaded}
+\else
+ \typeout{amsthm NOT loaded}
+\fi
\def\libus@undefine#1{%
\if\relax\noexpand#1\let#1=\@undefined\fi}
\def\libus@MathSymbol#1#2#3#4{%
@@ -132,7 +149,101 @@
\DeclareMathAlphabet{\mathbcal} {U}{stixcal}{b}{n}
\DeclareSymbolFontAlphabet{\mathbb} {symbolsbb}
+% Should test for which math italic font and customize these numbers.
+\def\tx@sb@dflt{% default subscript kerns, usually negative
+ \if\next f\mkern-2mu\else
+ \if\next j\mkern-3mu\else
+ \if\next p\mkern-2mu\else
+ \if\next y\mkern-\@ne mu\else
+ \if\next A\mkern-3mu\else
+ \if\next B\mkern-\@ne mu\else
+ \if\next D\mkern-\@ne mu\else
+ \if\next H\mkern-\@ne mu\else
+ \if\next I\mkern-\@ne mu\else
+ \if\next K\mkern-\@ne mu\else
+ \if\next L\mkern-\@ne mu\else
+ \if\next M\mkern-\@ne mu\else
+ \if\next N\mkern-0.5mu\else
+ \if\next P\mkern-\@ne mu\else
+ \if\next X\mkern-\@ne mu\else
+ \if\next \rho\mkern-2mu\else
+ \if\next \beta\mkern-\@ne mu\else
+ \fi
+ \fi
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi}
+\newtoks\tx@tA
+\newtoks\tx@tB
+\newcommand*{\loadsubfile}[1]{\readsufile{#1}%creates toks tx@tA. tx@tB
+\tx@tA\expandafter{\the\expandafter\tx@tA\the\tx@tB}
+\expandafter\def\expandafter\tx@sb\expandafter{\the\tx@tA}}
+\def\tx@subs{libertinus-subs.tex}
+\newread\tx@su
+
+\def\readsufile#1{%
+ \tx@tA={}
+ \tx@tB={}
+ \openin\tx@su=#1
+ \loop\unless\ifeof\tx@su
+ \read\tx@su to \tx@line
+ \if\tx@line\par\else
+ \expandafter\tx@addrec\tx@line
+ \fi
+ \repeat
+}
+\def\tx@addrec#1#2{%
+\ifiscseq{#1}{\tx@tA\expandafter{\the\tx@tA\ifx}}{\tx@tA\expandafter{\the\tx@tA\if}}
+\tx@tA\expandafter{\the\tx@tA\next #1\mkern #2 mu\else}
+\tx@tB\expandafter{\the\tx@tB\fi}}
+\AtEndPreamble{%
+%\traceon
+\iflibus@sbc
+ \expandafter\ifx\csname xyversion\endcsname\relax \else
+ \PackageError{newtxmath}{xy package is not compatible with the subscriptcorrection macros}{Either remove xy or disable
+ subscriptcorrection by means of package option nosubscriptcorrection}
+ \fi
+ \IfFileExists{\tx@subs}{\loadsubfile{\tx@subs}}%
+ {\def\tx@sb{\tx@sb@dflt}\message{File \tx@subs\space not found. Using internal defaults for subscript correction.^^J}}
+\fi
+%\traceoff
+}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Subscript correction code
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\newtoks\tx@sbptoks
+% next 2 macros borrowed from TeX by Topic
+\def\tx@Pop#1(into:)#2{%
+ \edef\tx@act{\noexpand\tx@SplitOff\the#1%
+ (tx@head:)\noexpand#2(tx@tail:)\noexpand#1}%
+ \tx@act}
+\def\tx@SplitOff#1#2(tx@head:)#3(tx@tail:)#4{\def#3{\noexpand #1}#4={#2}}
+
+\iflibus@sbc
+\AtBeginDocument{% first check if _ has been redefined
+ \mathcode`\_=\string"8000 \catcode`\_=12\relax} \begingroup
+ \catcode`\_=13
+ \gdef_{\expandafter\s@@b@}
+\endgroup
+%\def\s@@b{\expandafter\s@@b@}
+\def\s@@b@#1{\def\tx@next@{#1}%
+\tx@sbptoks={#1}%
+\tx@Pop\tx@sbptoks(into:)\next% first token is \next
+\sb{\tx@sb \tx@next@}} % \tx@sb provides mkern to insert before first tok
+\fi
\libus@MathSymbol{\upGamma} {\mathalpha}{operators}{"00}
@@ -223,47 +334,90 @@
\let\varphiup\upvarphi
\let\varkappaup\upvarkappa
%
-\libus@MathSymbol{\Gammait}{\mathalpha}{letters}{0}
-\libus@MathSymbol{\Deltait}{\mathalpha}{letters}{1}
-\libus@MathSymbol{\Thetait}{\mathalpha}{letters}{2}
-\libus@MathSymbol{\Lambdait}{\mathalpha}{letters}{3}
-\libus@MathSymbol{\Xiit}{\mathalpha}{letters}{4}
-\libus@MathSymbol{\Piit}{\mathalpha}{letters}{5}
-\libus@MathSymbol{\Sigmait}{\mathalpha}{letters}{6}
-\libus@MathSymbol{\Upsilonit}{\mathalpha}{letters}{7}
-\libus@MathSymbol{\Phiit}{\mathalpha}{letters}{8}
-\libus@MathSymbol{\Psiit}{\mathalpha}{letters}{9}
-\libus@MathSymbol{\Omegait}{\mathalpha}{letters}{10}
-\libus@MathSymbol{\alphait}{\libus@lcgc}{letters}{11}
-\libus@MathSymbol{\betait}{\libus@lcgc}{letters}{12}
-\libus@MathSymbol{\gammait}{\libus@lcgc}{letters}{13}
-\libus@MathSymbol{\deltait}{\libus@lcgc}{letters}{14}
-\libus@MathSymbol{\epsilonit}{\libus@lcgc}{letters}{15}
-\libus@MathSymbol{\zetait}{\libus@lcgc}{letters}{16}
-\libus@MathSymbol{\etait}{\libus@lcgc}{letters}{17}
-\libus@MathSymbol{\thetait}{\libus@lcgc}{letters}{18}
-\libus@MathSymbol{\iotait}{\libus@lcgc}{letters}{19}
-\libus@MathSymbol{\kappait}{\libus@lcgc}{letters}{20}
-\libus@MathSymbol{\lambdait}{\libus@lcgc}{letters}{21}
-\libus@MathSymbol{\muit}{\libus@lcgc}{letters}{22}
-\libus@MathSymbol{\nuit}{\libus@lcgc}{letters}{23}
-\libus@MathSymbol{\xiit}{\libus@lcgc}{letters}{24}
-\libus@MathSymbol{\piit}{\libus@lcgc}{letters}{25}
-\libus@MathSymbol{\rhoit}{\libus@lcgc}{letters}{26}
-\libus@MathSymbol{\sigmait}{\libus@lcgc}{letters}{27}
-\libus@MathSymbol{\tauit}{\libus@lcgc}{letters}{28}
-\libus@MathSymbol{\upsilonit}{\libus@lcgc}{letters}{29}
-\libus@MathSymbol{\phiit}{\libus@lcgc}{letters}{30}
-\libus@MathSymbol{\chiit}{\libus@lcgc}{letters}{31}
-\libus@MathSymbol{\psiit}{\libus@lcgc}{letters}{32}
-\libus@MathSymbol{\omegait}{\libus@lcgc}{letters}{33}
-\libus@MathSymbol{\varepsilonit}{\libus@lcgc}{letters}{34}
-\libus@MathSymbol{\varthetait}{\libus@lcgc}{letters}{35}
-\libus@MathSymbol{\varpiit}{\libus@lcgc}{letters}{36}
-\libus@MathSymbol{\varrhoit}{\libus@lcgc}{letters}{37}
-\libus@MathSymbol{\varsigmait}{\libus@lcgc}{letters}{38}
-\libus@MathSymbol{\varphiit}{\libus@lcgc}{letters}{39}
-\libus@MathSymbol{\varkappait}{\libus@lcgc}{letters}{"FE}
+\libus@MathSymbol{\itGamma}{\mathalpha}{letters}{0}
+\libus@MathSymbol{\itDelta}{\mathalpha}{letters}{1}
+\libus@MathSymbol{\itTheta}{\mathalpha}{letters}{2}
+\libus@MathSymbol{\itLambda}{\mathalpha}{letters}{3}
+\libus@MathSymbol{\itXi}{\mathalpha}{letters}{4}
+\libus@MathSymbol{\itPi}{\mathalpha}{letters}{5}
+\libus@MathSymbol{\itSigma}{\mathalpha}{letters}{6}
+\libus@MathSymbol{\itUpsilon}{\mathalpha}{letters}{7}
+\libus@MathSymbol{\itPhi}{\mathalpha}{letters}{8}
+\libus@MathSymbol{\itPsi}{\mathalpha}{letters}{9}
+\libus@MathSymbol{\itOmega}{\mathalpha}{letters}{10}
+\libus@MathSymbol{\italpha}{\libus@lcgc}{letters}{11}
+\libus@MathSymbol{\itbeta}{\libus@lcgc}{letters}{12}
+\libus@MathSymbol{\itgamma}{\libus@lcgc}{letters}{13}
+\libus@MathSymbol{\itdelta}{\libus@lcgc}{letters}{14}
+\libus@MathSymbol{\itepsilon}{\libus@lcgc}{letters}{15}
+\libus@MathSymbol{\itzeta}{\libus@lcgc}{letters}{16}
+\libus@MathSymbol{\iteta}{\libus@lcgc}{letters}{17}
+\libus@MathSymbol{\ittheta}{\libus@lcgc}{letters}{18}
+\libus@MathSymbol{\itiota}{\libus@lcgc}{letters}{19}
+\libus@MathSymbol{\itkappa}{\libus@lcgc}{letters}{20}
+\libus@MathSymbol{\itlambda}{\libus@lcgc}{letters}{21}
+\libus@MathSymbol{\itmu}{\libus@lcgc}{letters}{22}
+\libus@MathSymbol{\itnu}{\libus@lcgc}{letters}{23}
+\libus@MathSymbol{\itxi}{\libus@lcgc}{letters}{24}
+\libus@MathSymbol{\itpi}{\libus@lcgc}{letters}{25}
+\libus@MathSymbol{\itrho}{\libus@lcgc}{letters}{26}
+\libus@MathSymbol{\itsigma}{\libus@lcgc}{letters}{27}
+\libus@MathSymbol{\ittau}{\libus@lcgc}{letters}{28}
+\libus@MathSymbol{\itupsilon}{\libus@lcgc}{letters}{29}
+\libus@MathSymbol{\itphi}{\libus@lcgc}{letters}{30}
+\libus@MathSymbol{\itchi}{\libus@lcgc}{letters}{31}
+\libus@MathSymbol{\itpsi}{\libus@lcgc}{letters}{32}
+\libus@MathSymbol{\itomega}{\libus@lcgc}{letters}{33}
+\libus@MathSymbol{\itvarepsilon}{\libus@lcgc}{letters}{34}
+\libus@MathSymbol{\itvartheta}{\libus@lcgc}{letters}{35}
+\libus@MathSymbol{\itvarpi}{\libus@lcgc}{letters}{36}
+\libus@MathSymbol{\itvarrho}{\libus@lcgc}{letters}{37}
+\libus@MathSymbol{\itvarsigma}{\libus@lcgc}{letters}{38}
+\libus@MathSymbol{\itvarphi}{\libus@lcgc}{letters}{39}
+\libus@MathSymbol{\itvarkappa}{\libus@lcgc}{letters}{"FE}
+\let\Gammait\itGamma
+\let\Deltait\itDelta
+\let\Thetait\itTheta
+\let\Lambdait\itLambda
+\let\Xiit\itXi
+\let\Piit\itPi
+\let\Gammait\itGamma
+\let\Sigmait\itSigma
+\let\Upsilonit\itUpsilon
+\let\Phiit\itPhi
+\let\Psiit\itPsi
+\let\Omegait\itOmega
+\let\alphait\italpha
+\let\betait\itbeta
+\let\gammait\itgamma
+\let\deltait\itdelta
+\let\epsilonit\itepsilon
+\let\zetait\itzeta
+\let\etait\iteta
+\let\thetait\ittheta
+\let\iotait\itiota
+\let\kappait\itkappa
+\let\lambdait\itlambda
+\let\muit\itmu
+\let\nuit\itnu
+\let\xiit\itxi
+\let\piit\itpi
+\let\rhoit\itrho
+\let\sigmait\itsigma
+\let\tauit\ittau
+\let\upsilonit\itupsilon
+\let\phiit\itphi
+\let\chiit\itchi
+\let\psiit\itpsi
+\let\omegait\itomega
+\let\varepsilonit\itvarepsilon
+\let\varthetait\itvartheta
+\let\varpiit\itvarpi
+\let\varrhoit\itvarrho
+\let\varsigmait\itvarsigma
+\let\varphiit\itvarphi
+\let\varkappait\itvarkappa
+
\iflibus@slantedG
\let\Gamma\Gammait
\let\Delta\Deltait
@@ -1047,6 +1201,7 @@
%\libus@MathSymbol{\smallintsl} {\mathop}{symbols}{"08}
\libus@MathSymbol{\smallprod} {\mathop}{symbols}{"11}
\libus@MathSymbol{\smallcoprod} {\mathop}{symbols}{"12}
+\let\amalg\smallcoprod
\libus@MathSymbol{\backsimeq} {\mathrel}{symbols}{"13}
\libus@MathSymbol{\curlyvee} {\mathbin}{symbols}{"14}
\libus@MathSymbol{\curlywedge} {\mathbin}{symbols}{"15}
@@ -1243,8 +1398,8 @@
%\libus@MathSymbol{\parallelogram} {\mathord}{symbols}{"C8}
\libus@MathSymbol{\bigblacktriangleup} {\mathord}{symbols}{"C9}
\libus@MathSymbol{\bigtriangleup} {\mathbin}{symbols}{"CA} \let\varbigtriangleup=\bigtriangleup \let\triangle=\bigtriangleup
-%\libus@MathSymbol{\blacktriangle} {\mathord}{symbols}{"CB}
-%\libus@MathSymbol{\vartriangle} {\mathrel}{symbols}{"CC}
+\libus@MathSymbol{\Perp} {\mathrel}{symbols}{"CB}
+\libus@MathSymbol{\nPerp} {\mathrel}{symbols}{"CC}
\libus@MathSymbol{\blacktriangleright} {\mathord}{symbols}{"CD}
\libus@MathSymbol{\vartriangleright} {\mathrel}{symbols}{"CE} \libus@MathSymbol{\rhd}{\mathbin}{symbols}{"CE}
%\libus@MathSymbol{\smallblacktriangleright} {\mathord}{symbols}{"CF}
@@ -1369,5 +1524,92 @@
\repeat
\typeout{***}}
+% Code from Murray Eisenberg for a macro \widebar to complement \widehat and \widetilde
+% Original by Hendrik Vogt
+% http://tex.stackexchange.com/questions/16337/can-i-get-a-widebar-without-using-the-mathabx-package/60253#60253
+% Modified at http://tex.stackexchange.com/questions/186607/combine-boldsymbol-and-widebar
+\newcommand*\if@single[3]{%
+ \setbox0\hbox{${\mathaccent"0\hexnumber@\symletters 9A{#1}}^H$}%
+ \setbox2\hbox{${\mathaccent"0\hexnumber@\symletters 9A{\kern0pt#1}}^H$}%
+ \ifdim\ht0=\ht2 #3\else #2\fi
+ }
+%The bar will be moved to the right by a half of \macc@kerna, which is computed by amsmath:
+\newcommand*\rel@kern[1]{\kern#1\dimexpr\macc@kerna}
+%If there's a superscript following the bar, then no negative kern may follow the bar;
+%an additional {} makes sure that the superscript is high enough in this case:
+\newcommand*\widebar[1]{\@ifnextchar^{{\wide@bar{#1}{0}}}{\wide@bar{#1}{1}}}
+%Use a separate algorithm for single symbols:
+\newcommand*\wide@bar[2]{\if@single{#1}{\wide@bar@{#1}{#2}{1}}{\wide@bar@{#1}{#2}{2}}}
+\newcommand*\wide@bar@[3]{%
+ \begingroup
+ \def\mathaccent##1##2{%
+%If there's more than a single symbol, use the first character instead (see below):
+ \if#32 \let\macc@nucleus\first@char \fi
+%Determine the italic correction:
+ \setbox\z@\hbox{$\macc@style{\macc@nucleus}_{}$}%
+ \setbox\tw@\hbox{$\macc@style{\macc@nucleus}{}_{}$}%
+ \dimen@\wd\tw@
+ \advance\dimen@-\wd\z@
+%Now \dimen@ is the italic correction of the symbol.
+ \divide\dimen@ 3
+ \@tempdima\wd\tw@
+ \advance\@tempdima-\scriptspace
+%Now \@tempdima is the width of the symbol.
+ \divide\@tempdima 10
+ \advance\dimen@-\@tempdima
+%Now \dimen@ = (italic correction / 3) - (Breite / 10)
+ \ifdim\dimen@>\z@ \dimen@0pt\fi
+%The bar will be shortened in the case \dimen@<0 !
+ \rel@kern{0.6}\kern-\dimen@
+ \if#31
+ \overline{\rel@kern{-0.6}\kern\dimen@\macc@nucleus\rel@kern{0.4}\kern\dimen@}%
+ \advance\dimen@0.4\dimexpr\macc@kerna
+%Place the combined final kern (-\dimen@) if it is >0 or if a superscript follows:
+ \let\final@kern#2%
+ \ifdim\dimen@<\z@ \let\final@kern1\fi
+ \if\final@kern1 \kern-\dimen@\fi
+ \else
+ \overline{\rel@kern{-0.6}\kern\dimen@#1}%
+ \fi
+ }%
+ \macc@depth\@ne
+ \let\math@bgroup\@empty \let\math@egroup\macc@set@skewchar
+ \mathsurround\z@ \frozen@everymath{\mathgroup\macc@group\relax}%
+ \macc@set@skewchar\relax
+ \let\mathaccentV\macc@nested@a
+%The following initialises \macc@kerna and calls \mathaccent:
+ \if#31
+ \macc@nested@a\relax111{#1}%
+ \else
+%If the argument consists of more than one symbol, and if the first token is
+%a letter, use that letter for the computations:
+ \def\gobble@till@marker##1\endmarker{}%
+ \futurelet\first@char\gobble@till@marker#1\endmarker
+ \ifcat\noexpand\first@char A\else
+ \def\first@char{}%
+ \fi
+ \macc@nested@a\relax111{\first@char}%
+ \fi
+ \endgroup
+}
+%%%%%%% Begin txvec code 2019-07-31 (adaptive vec)
+\DeclareMathSymbol{\rVec@h}{\mathrel}{symbols}{199}% vector head
+\DeclareMathSymbol{\rVec@x}{\mathrel}{symbols}{200}% vector extension
+%% borrow interfacefrom esvect
+\def\vv{\@ifstar{\vvstar}{\txvec}}
+
+\def\vvstar#1#2{{\txvec{#1}}_{\mkern-1mu\relax#2}}
+%%
+\newcommand{\txvec}{\mathpalette{\overVec@\Vecfill@}}
+%
+\def\Vecfill@{\@rrowfill@\rVec@x\rVec@h}
+%
+\def\@rrowfill@#1#2#3{$\m@th\mkern2mu%
+\relax#3#1\mkern-1.5mu\cleaders\hbox{$#3\mkern-.4mu#1\mkern-.4mu$}\hfill\mkern-1.5mu#2$}
+%
+\def\overVec@#1#2#3{\mathop{\vbox{\ialign{##\crcr\noalign{\kern-.2ex}%
+#1#2\crcr\noalign{\kern\ntxmath@vecsep\nointerlineskip}% kern controls sep to arrow
+$\m@th\hfil #2#3\hfil$\crcr}}}}
+%%%%%%%% End txvec code
\endinput