diff options
author | Norbert Preining <norbert@preining.info> | 2021-12-26 03:01:20 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-12-26 03:01:20 +0000 |
commit | 4a2abb95db9b87c04422a05174b2606b2c8e1d2b (patch) | |
tree | 1ea1cbeb1e7aec8eaa4abf37c6b38fbaa21ca046 /fonts/newtx/tex/newtxmath.sty | |
parent | 41baa3fc38fdb0dfd5f1825d8548a999ab07bf5d (diff) |
CTAN sync 202112260301
Diffstat (limited to 'fonts/newtx/tex/newtxmath.sty')
-rw-r--r-- | fonts/newtx/tex/newtxmath.sty | 96 |
1 files changed, 87 insertions, 9 deletions
diff --git a/fonts/newtx/tex/newtxmath.sty b/fonts/newtx/tex/newtxmath.sty index 75489ce01e..54f1563bc4 100644 --- a/fonts/newtx/tex/newtxmath.sty +++ b/fonts/newtx/tex/newtxmath.sty @@ -11,8 +11,8 @@ % of glyph collisions. % These modifications are by Michael Sharpe, msharpe at ucsd dot edu -\def\fileversion{1.659} -\def\filedate{2021/10/21} +\def\fileversion{1.7} +\def\filedate{2021/12/18} \ProvidesPackage{newtxmath}[\filedate\space v\fileversion ] \@ifundefined{newtxmathLoaded}{}{\endinput} @@ -92,13 +92,13 @@ \newif\iftx@cochf % switch to long f \newif\iftx@cochrho % switch to long rho \newif\iftx@fourier -%\show\rmdefault \edef\tx@rmdefault{\rmdefault} \edef\tx@encdefault{\encodingdefault} \tx@ottrue % default is true \let\rmdefaultB\rmdefault \newif\iftx@hastm -\ifx\tx@rmdefault\@tx@ptm \tx@hastmtrue\fi\@ifundefined{ver@newtxtext.sty}{}{\tx@hastmtrue} +\ifx\tx@rmdefault\@tx@ptm \tx@hastmtrue\fi +\@ifundefined{ver@newtxtext.sty}{}{\tx@hastmtrue} \@ifundefined{ver@tgtermes.sty}{}{\tx@hastmtrue} \iftx@hastm\def\rmdefaultB{ntxtlf}\fi % test if tm is loaded minimally as with XeLaTeX newtxmath @@ -172,7 +172,7 @@ \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}} - +\newif\ifntx@amsthm %\def\tx@sb{\the\tx@tA \the\tx@tB}\enablesbcorrection} %\newcommand*{\loadsupfile}[1]{\readsufile{#1}%creates toks tx@tA. tx@tB %\def\tx@sp{\the\tx@tA \the\tx@tB}\enablespcorrection} @@ -196,7 +196,9 @@ \tx@tB\expandafter{\the\tx@tB\fi}} \newif\iftx@subsfile -\DeclareOption{subscriptcorrectionfile}{\def\tx@subs{#1}\tx@subsfiletrue} +\@ifpackageloaded{newtx}% +{\@for\ntx@x:=\ntx@textlst\do{\DeclareOption{\ntx@x}{}}}{} +\DeclareOption{subscriptcorrectionfile}{\def\tx@subs{##1}\tx@subsfiletrue} \DeclareOption{nosubscriptcorrection}{\tx@sbcfalse} \DeclareOption{subscriptcorrection}{\tx@sbctrue} %\DeclareOption{nosuperscriptcorrection}{\disablespcorrection} @@ -255,10 +257,19 @@ \DeclareOption{varvw}{\def\X@s@v@rg{0}} \DeclareOption{internaldigits}{\tx@digitstrue} \DeclareOption{noOT1}{\tx@nootonetrue} +\DeclareOption{amsthm}{\ntx@amsthmtrue} + \ExecuteOptions{% amssymbols,uprightGreek,nosubscriptcorrection} -\ProcessOptions* +\ProcessOptions\relax + +\ifntx@amsthm + \RequirePackage{amsthm} + \typeout{amsthm loaded} +\else + \typeout{amsthm NOT loaded} +\fi % noto option requires special handling because of scaling issues--- % The noto package does not have an option that controls the scale @@ -364,8 +375,6 @@ amssymbols,uprightGreek,nosubscriptcorrection} \def\operator@font{\mathgroup\symoperators} -%\show\ttdefault - \DeclareSymbolFontAlphabet{\mathrm}{operators} \DeclareMathAlphabet{\mathsf}{\encodingdefault}{\sfdefault}{m}{n} @@ -3126,4 +3135,73 @@ $\hfil\displaystyle{#1}\hfil$\crcr% \pdfglyphtounicode{radicalBig}{221A FE03}% \pdfglyphtounicode{radicalBigg}{221A FE04}% \fi + +% 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"0362{#1}}^H$}% + \setbox2\hbox{${\mathaccent"0362{\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 +} \endinput |