diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/newtx/newtxtext.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/newtx/newtxtext.sty | 910 |
1 files changed, 583 insertions, 327 deletions
diff --git a/Master/texmf-dist/tex/latex/newtx/newtxtext.sty b/Master/texmf-dist/tex/latex/newtx/newtxtext.sty index f7aa8971c8b..5c4b9aa2a82 100644 --- a/Master/texmf-dist/tex/latex/newtx/newtxtext.sty +++ b/Master/texmf-dist/tex/latex/newtx/newtxtext.sty @@ -1,218 +1,428 @@ \NeedsTeXFormat{LaTeX2e} -\def\fileversion{1.658} -\def\filedate{2021/10/13} -\ProvidesPackage{newtxtext}[\filedate\space v\fileversion] +% Based originally on Young Ryu's txfonts.sty, v.1.1.1 +% +% Changes from original txfonts.sty by Michael Sharpe, msharpe at ucsd dot edu; +% Text and math versions now separate. +% Added scaled keyword and osf option; +% Text is now directed to an extension of TeXGyreTermes rather than tx. +% 2.0 is first version of newtxtext to support both [pdf]latex and unicode latex. -\message{`newtxtext' v\fileversion, \filedate\space Text macros taking advantage of TeX-Gyre Termes fonts (msharpe)} -\RequirePackage{fontaxes}% so we can have [bold] italic small caps +\def\fileversion{1.7} +\def\filedate{2021/12/15} +\ProvidesPackage{newtxtext}[% +\filedate\space v\fileversion (Michael Sharpe) latex and unicode latex support for TeXGyreTermesX] -\let\orig@footnote=\thefootnote -\let\orig@makefnmark=\@makefnmark -\newdimen\ntx@fs -\RequirePackage{xkeyval,etoolbox,xstring,ifthen,scalefnt} -\RequirePackage{mweights} -\renewcommand*{\rmdefault}{ntxtlf} % always TLF for math +\message{`newtxtext' v\fileversion, \filedate\space Text macros taking advantage of TeXGyre Termes and its extensions (msharpe)} + +\RequirePackage[T1]{fontenc} +\renewcommand*{\rmdefault}{ntxtlf} % the default until end of preamble \renewcommand*{\familydefault}{\rmdefault} -\def\useosf{\edef\ntx@figurestyle{osf}} -\@onlypreamble\useosf -\def\useproportional{\edef\ntx@figurealign{}} -\@onlypreamble\useproportional -\RequirePackage{etoolbox} +\RequirePackage{ifxetex,ifluatex,xkeyval,etoolbox,textcomp} +\RequirePackage{xstring,ifthen,scalefnt} % for \textfrac +\@ifpackageloaded{mweights}{}{% + \IfFileExists{mweights.sty}{\RequirePackage{mweights}}{}% +} -\def\ntx@dfltfigurestyle{lf} -\def\ntx@figurestyle{lf}% default is lining figure style -\def\ntx@figurealign{t}% default is tabular figure alignment -\newif\ifntx@defaultsups +\DeclareEncodingSubset{TS1}{ntx*}{0} +\input{binhex} +\newcount\ntx@tmpcnta +\newcount\ntx@cnt \ntx@cnt=0 + +%KOMA check \newif\ifntx@KOMA \@ifundefined{KOMAClassName}{}{\ntx@KOMAtrue} \@ifundefined{ver@scrextend.sty}{}{\ntx@KOMAtrue} -\newif\ifntx@adobesc + +% Engine check +\newif\ifntx@newtx +\@ifundefined{ntxotftrue}{\newif\ifntxotf% +\newif\ifntxorigotf% true iff either xelatex or lualatex + % might have been defined in newtx.sty +\ifxetex + \ntxotftrue +\else\ifluatex + \ntxotftrue +\else % [pdf]LaTeX + \ntxotffalse +\fi\fi +\ifntxotf\ntx@origotftrue +}{\ntx@newtxtrue% +%\ifntxotf\typeout{ntxotftrue.^^J}\else\typeout{ntxotffalse.^^J}\fi +} +%%%%%%%%%%%%%%%%%% +\IfFileExists{xkeyval.sty}{ + \RequirePackage{xkeyval} + }{ + \let\DeclareOptionX\DeclareOption + \let\ExecuteOptionsX\ExecuteOptions + \let\ProcessOptionsX\ProcessOptions +} +%%%%Start Options +\@ifpackageloaded{newtx}% +{\@for\ntx@x:=\ntx@mathlst\do{\expandafter\DeclareOptionX\expandafter{\ntx@x}{}}}{} +\newif\ifntx@nomath\ntx@nomathfalse +\newif\ifntx@lining\ntx@liningtrue +\newif\ifntx@tabular\ntx@tabulartrue % default is tabular lining figures +\@ifundefined{ver@newtxmath.sty}{}{\ntx@nomathtrue} + +\DeclareOptionX{type1}[true]{% +\def\ntx@tmpx{\@nameuse{if#1}\ntxotffalse\fi} +\ifntx@newtx +\else\ntx@tmpx\fi} + +\DeclareOptionX{nofontspec}[true]{% +\def\ntx@tmpx{\@nameuse{if#1}\ntxotffalse\fi} +\ifntx@newtx +\else\ntx@tmpx\fi} + +\DeclareOptionX{no-math}[true]{% +\def\ntx@tmpx{\@nameuse{if#1}\ntx@nomathtrue\fi} +\ifntx@newtx +\else\ntx@tmpx\fi} + +\def\ntx@defaultfeatures{} +\DeclareOptionX{defaultfeatures}{\def\ntx@defaultfeatures{#1}} + +%Figure style options +\edef\ntx@dfltfigurestyle{lf} +\edef\ntx@dfltfigurealign{t} + +\DeclareOptionX{lining}[true]{% +\@nameuse{ntx@lining#1} +} +\DeclareOptionX{lf}[true]{% +\@nameuse{ntx@lining#1} +} +\DeclareOptionX{oldstyle}[true]{% +\@nameuse{if#1}% + \ntx@liningfalse +\else + \ntx@liningtrue +\fi +} +\DeclareOptionX{osf}[true]{% +\@nameuse{if#1}% + \ntx@liningfalse +\else + \ntx@liningtrue +\fi +} +\DeclareOptionX{tabular}[true]{% +\@nameuse{ntx@tabular#1} +} +\DeclareOptionX{t}[true]{% +\@nameuse{ntx@tabular#1} +} +\DeclareOptionX{proportional}[true]{% +\@nameuse{if#1}% + \ntx@tabularfalse +\else + \ntx@tabulartrue +\fi +} +\DeclareOptionX{p}[true]{% +\@nameuse{if#1}% + \ntx@tabularfalse +\else + \ntx@tabulartrue +\fi +} + +%Scale +\newcommand*{\ntx@scale}{1} % actual scaled command in \ntx@scaled +\DeclareOptionX{scale}{\renewcommand*{\ntx@scale}{#1}} +\DeclareOptionX{scaled}{\renewcommand*{\ntx@scale}{#1}} + +\newif\ifntx@defaultsups +%\newif\ifntx@adobesc % we don't use this exc. in fd, but may in future \newif\ifntx@scosf -\newif\ifntx@largesc -%\newif\ifntx@babel -%\ifdefined\bbl@version \ntx@babeltrue\fi -\define@boolkey{ntx}{defaultsups}[true]{% -\csname ntx@defaultsups#1\endcsname} - -\define@boolkey{ntx}{largesc}[true]{% -\csname ntx@largesc#1\endcsname} -\define@boolkey{ntx}{adobesc}[true]{% -\csname ntx@adobesc#1\endcsname} -\define@key{ntx}{babel}[true]{\relax}% keep, though no effect -%\csname ntx@babel#1\endcsname} +\newif\ifntx@largesc +\newif\ifntx@helv \ntx@helvtrue % default is to load helvetica as sans serif font +\newif\ifntx@tt \ntx@tttrue % default is to load ntxtt as typewriter font \newif\ifntx@thrm -\newif\ifntx@sl % slanted means theoremfont, by default -% If set to true, slanted really does mean true slanted -\define@key{ntx}{helvratio}[0.9]{\def\ntx@helvratio{#1}} -\define@key{ntx}{scaled}[1.0]{\def\ntx@scaled{s*[#1]}% -\def\ntx@scale{#1}\def\LGCscale{#1}} -\setkeys{ntx}{helvratio} % set this first, at least to default 0.9 -\setkeys{ntx}{scaled} % get at least default - -\def\ntx@foresolidus{0em} -\def\ntx@aftsolidus{0em} -\def\ntx@spc{.25em} -\def\ntx@stretch{.2em} -\def\ntx@shrink{.1em} -\define@key{ntx}{spacing}[.25em]{\gdef\ntx@spc{#1}} -\define@key{ntx}{stretch}[.2em]{\gdef\ntx@stretch{#1}} -\define@key{ntx}{shrink}[.1em]{\gdef\ntx@shrink{#1}} - - -\DeclareOption{lining}{\edef\ntx@figurestyle{lf}} -\DeclareOption{lf}{\edef\ntx@figurestyle{lf}} -\DeclareOption{theoremfont}{\ntx@thrmtrue} -\DeclareOption{trueslanted}{\ntx@sltrue} -\DeclareOption{oldstyle}{\useosf} -\DeclareOption{osf}{\useosf} -\DeclareOption{tabular}{\edef\ntx@figurealign{t}} -\DeclareOption{p}{\useproportional} -\DeclareOption{proportional}{\useproportional} -%\DeclareOption{sups}{\ntx@defaultsupsfalse} -\DeclareOption{scosf}{\ntx@scosftrue} -\DeclareOptionX{foresolidus}{\gdef\ntx@foresolidus{#1}} -\DeclareOptionX{aftsolidus}{\gdef\ntx@aftsolidus{#1}} -\DeclareOption{tighter}{% -\gdef\ntx@spc{.25em}\gdef\ntx@stretch{.15em}\gdef\ntx@shrink{.06em}} -\DeclareOption{looser}{% -\gdef\ntx@spc{.3em}\gdef\ntx@stretch{.2em}\gdef\ntx@shrink{.15em} +\newif\ifntx@sl + +% Other options +\DeclareOptionX{defaultsups}[true]{% +\@nameuse{ntx@defaultsups#1} +} +\DeclareOptionX{babel}[true]{% +\@nameuse{ntx@babel#1}% for backward compatibility } -\ExecuteOptions{lining,tabular} +\DeclareOptionX{largesc}[true]{% +\@nameuse{ntx@largesc#1} +} +\DeclareOptionX{nohelv}[true]{% +\@nameuse{if#1}\ntx@helvfalse\fi}% -\DeclareOption*{% - \begingroup - \edef\x{\endgroup - \noexpand\setkeys{ntx}{\CurrentOption}}% - \x} +\DeclareOptionX{nott}[true]{% +\@nameuse{if#1}\ntx@ttfalse\fi}% -\ProcessOptions* -\def\ntx@spacing{% - \fontdimen2\font=\ntx@spc - \fontdimen3\font=\ntx@stretch - \fontdimen4\font=\ntx@shrink +\def\ntx@helvratio{.94} +\DeclareOptionX{helvratio}[0.94]{% +\def\ntx@helvratio{#1} } +\def\ntx@spcmag{1} +\def\ntx@spc{.25em} +\def\ntx@stretch{.2em} +\def\ntx@shrink{.1em} +\def\ntx@nospc{T} -\@tempdima=\ntx@scale\p@\@tempdima=\ntx@helvratio\@tempdima% -\edef\qhv@scale{\strip@pt\@tempdima} - -\RequirePackage[T1]{fontenc} -\RequirePackage[full]{textcomp} -\DeclareRobustCommand{\sustyle}{% - \not@math@alphabet\sustyle\relax - \fontfamily{ntxsups}\selectfont} -\DeclareRobustCommand{\infigures}{% - \not@math@alphabet\infigures\relax - \fontfamily{ntxdenoms}\selectfont} -\DeclareTextFontCommand{\textinf}{\infigures} - -\ifntx@scosf % -\DeclareRobustCommand{\textsc}[1]{% -{\fontfamily{ntx\ntx@figurealign osf}\scshape\selectfont #1}% -}\fi% use OsF in small caps - -\DeclareRobustCommand{\lfstyle}{% - \not@math@alphabet\lfstyle\relax - \fontfamily{ntxlf}\selectfont % -}% to get lf -\DeclareRobustCommand{\tlfstyle}{% - \not@math@alphabet\tlfstyle\relax - \fontfamily{ntxtlf}\selectfont % -}% to get tlf -\DeclareRobustCommand{\osfstyle}{% - \not@math@alphabet\osfstyle\relax - \fontfamily{ntxosf}\selectfont % -}% to get osf -\DeclareRobustCommand{\tosfstyle}{% - \not@math@alphabet\tosfstyle\relax - \fontfamily{ntxtosf}\selectfont % -}% to get tosf -\DeclareRobustCommand{\textlf}[1]{% - {\lfstyle #1}% -}% to get lf -\DeclareRobustCommand{\texttlf}[1]{% - {\tlfstyle #1}% -}% to get tlf -\DeclareRobustCommand{\textosf}[1]{% - {\osfstyle #1}% -}% to get osf -\DeclareRobustCommand{\texttosf}[1]{% - {\tosfstyle #1}% -}% to get tosf -\DeclareRobustCommand{\textsu}[1]{% - {\sustyle #1}% to get sup style +\DeclareOptionX{spcfactor}{% +\def\ntx@spcmag{#1}\def\ntx@nospc{F} } -%\DeclareRobustCommand{\textin}[1]{% -% {\infigures #1}% denominator style -%} -\DeclareRobustCommand{\textde}[1]{% - {\infigures #1}% denominator style +\DeclareOptionX{spacing}{% +\def\ntx@spc{#1} } - -\newcommand{\textfrac}[3][]{% e.g., \textfrac[1]{7}{8} +\DeclareOptionX{stretch}{% +\def\ntx@stretch{#1} +} +\DeclareOptionX{shrink}{% +\def\ntx@shrink{#1} +} +\def\ntx@defaultfeatures{} +\newif\ifntx@zeroslash +\def\ntx@thmlin{X} % default is to not change to lining +\def\ntx@noti{T}\def\ntx@nolo{T} +\DeclareOptionX{defaultfeatures}{\def\ntx@defaultfeatures{#1}} +\DeclareOptionX{oldSS}{\advance\ntx@cnt 32 } +\DeclareOptionX{slashedzero}{\ntx@zeroslashtrue} +\DeclareOptionX{theoremfont}{\ntx@thrmtrue} +\DeclareOptionX{thmlining}{\edef\ntx@thmlin{l}} +\DeclareOptionX{trueslanted}{\ntx@sltrue} +\DeclareOptionX{scosf}{\ntx@scosftrue} +\DeclareOptionX{tighter}{% +\gdef\ntx@spc{.25em}\gdef\ntx@stretch{.125em}% +\gdef\ntx@shrink{.1em}\def\ntx@noti{F}} +\DeclareOptionX{looser}{% +\gdef\ntx@spc{.3em}\gdef\ntx@stretch{.2em}% +\gdef\ntx@shrink{.1em}\def\ntx@nolo{F}} + +\ProcessOptionsX\relax +\ifntxotf \typeout{ntxotftrue^^J}\else\typeout{ntxotffalse^^J}\fi +\def\re@DeclareTextSymbol#1#2#3{% + \let#1=\undefined + \DeclareTextSymbol{#1}{#2}{#3}} +\ifntxotf + \ifntx@nomath + \RequirePackage[no-math]{fontspec} + \else + \RequirePackage{fontspec} + \fi + + \ifxetex\XeTeXtracingfonts=1\fi + \ifluatex % avoid possibly uncorrected "system" fonts + \directlua{fonts.names.set_location_precedence{ + "local", "texmf", "system" }} + \fi + \def\ntx@base{TeXGyreTermesX} + + \newcommand{\textfrac}[3][]{{%\normalfont% +\mbox{% + \ifthenelse{\not\equal{#1}{}}%Test for integer portion [optional #1] + {{\lfstyle#1}\kern.1em}{}% +\addfontfeatures{RawFeature=+sups}#2\char"2044% numerator +\addfontfeatures{RawFeature=-sups;+dnom;+ss20}\char"2044{}#3% +}}} + +\else % type1 + \RequirePackage{fontaxes} + \fa@naming@exception{figures}{{superior}{proportional}}{sups} + \fa@naming@exception{figures}{{superior}{tabular}}{sups} +% \def\sufigures{\@nomath\sufigures +% \fontfigurestyle{superior}\selectfont} +% \let\sustyle=\sufigures +% \DeclareTextFontCommand{\textsu}{\sufigures} +% \let\textsuperior\textsu + \DeclareRobustCommand{\sustyle}{% + \not@math@alphabet\sustyle\relax + \fontfamily{ntxsups}\selectfont} + \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 +% \fontfigurestyle{inferior}\selectfont} +% \let\instyle=\infigures +% \DeclareTextFontCommand{\textinf}{\infigures} +% \let\textinferior\textinf + \DeclareRobustCommand{\instyle}{% + \not@math@alphabet\instyle\relax + \fontfamily{ntxinf}\selectfont} + \let\infigures=\instyle + + \fa@naming@exception{figures}{{denominators}{proportional}}{dnom} + \fa@naming@exception{figures}{{denominators}{tabular}}{dnom} +% \def\defigures{\@nomath\defigures +% \fontfamily{defigures}\selectfont} +% \let\destyle=\defigures +% \DeclareTextFontCommand{\textde}{\defigures} +% \let\textdenominators\textde + \DeclareRobustCommand{\destyle}{% + \not@math@alphabet\destyle\relax + \fontfamily{ntxdnom}\selectfont} + \let\defigures=\destyle + +% \fa@naming@exception{figures}{{numerators}{proportional}}{numr} +% \fa@naming@exception{figures}{{numerators}{tabular}}{numr} +% \def\defigures{\@nomath\nufigures +% \fontfigurestyle{numerators}\selectfont} +% \let\nustyle=\nufigures +% \DeclareTextFontCommand{\textnu}{\nufigures} +% \let\textnumerators\textnu +% \DeclareRobustCommand{\nustyle}{% +% \not@math@alphabet\nustyle\relax +% \fontfamily{ntxnumr}\selectfont} +% \let\nufigures=\nustyle + +\newcommand{\textfrac}[3][]{% like \textfrac[1]{7}{8} \mbox{% \ifthenelse{\not\equal{#1}{}}%Test for integer portion [optional #1] - {\textlf{#1}\kern.05em}{}% - \textsu{#2}% numerator + {\textlf{#1}\kern.1em}{}% + {\sustyle#2}% numerator \StrRight{#2}{1}[\@digit@]% % look for 1, 2, 6, 7 \ifcase\@digit@% 0 \or%\kern.03em% 1 - \or%\kern.02em% 2 - \or\kern-.02em% 3 - \or%\kern-.01em% 4 - \or\kern-.01em% 5 - \or%\kern-.01em% 6 - \or\kern-.08em% 7 - \or%\kern-.08em% 8 - \or\kern-.04em% 9 - \fi% - \kern\ntx@foresolidus{\fontencoding{TS1}\selectfont\char"2F}% - \kern\ntx@aftsolidus% - \StrLeft{#3}{1}[\@digit@]% + \or\kern.04em% 2 + \or%\kern-.01em% 3 + \or%\kern.02em% 4 + \or%\kern.01em% 5 + \or\kern.01em% 6 + \or\kern-.11em% 7 + \or%\kern-.11em% 8 + \or\kern-.02em% 9 + \fi% +% \kern\ntx@foresolidus{\fontencoding{TS1}\selectfont\char"2F}% +% \kern\ntx@aftsolidus% + {\fontencoding{TS1}\selectfont\char"2F}% + \StrLeft{#3}{1}[\@digit@]% % look for 1, 4, 7 \ifcase\@digit@% 0 \or%\kern -.02em% 1 - \or\kern .01em% 2 + \or% 2 \or% 3 - \or\kern -.08em% 4 - \or\kern -.03em% 5 - \or\kern -.05em% 6 - \or%\kern .02em% 7 + \or\kern -.05em% 4 + \or% 5 + \or\kern-.02em% 6 + \or\kern .01em% 7 \fi% - \textde{#3}% denominator [#3] - }% -} -%\newcommand{\textfrac}[3][]{\mbox{% -% %\ifthenelse{\not\equal{#1}{}}%Test for integer portion [optional #1] -% % {\textlf{#1}\kern.05em}{}% -% {\ntxt@printfalse\edef\ntxt@denom{#2\char"F5}% -% \ntxt@textinf #3\@nil% -% \ifntxt@print\textsu{\ntxt@denom}\fi}}} -%\newcommand*{\textfrac}[2]{% -% {\ntxt@printfalse\edef\ntxt@denom{#1\char"F5}\ntxt@textinf #2\@nil% -% \ifntxt@print\textsu{\ntxt@denom}\fi}} - -\newcount\ntxt@cntz -\newif\ifntxt@print -%\newcount\ntxt@Isdigit -\def\ntxt@isdigit#1{% #1 should be a single character -\ntxt@cntz=\number`#1\relax% -\ifnum\ntxt@cntz>47\relax% - \ifnum\ntxt@cntz<58\relax% - \advance\ntxt@cntz by 198 % 246 (0.inf) -48 - \edef\ntxt@denom{\ntxt@denom\char\the\ntxt@cntz}% - \else - \edef\ntxt@denom{\ntxt@denom X}% - \fi% -\else - \edef\ntxt@denom{\ntxt@denom X}% -\fi% -} -%\def\ntxt@textinf#1#2\@nil{% -%\ntxt@isdigit{#1}% -%\ifblank{#2}{\ntxt@printtrue}{\ntxt@textinf #2\@nil}% -%} + {\destyle #3}% denominator [#3] + }%mbox +} % textfrac +\fi + +\let\orig@footnote=\thefootnote +\let\orig@makefnmark=\@makefnmark +\def\bfseries@rm{b} +\def\mdseries@rm{m} +\def\useosf{\ntx@liningfalse} +\@onlypreamble\useosf +\def\useproportional{\ntx@tabularfalse} +\@onlypreamble\useproportional + +\ifntxotf + \def\ntx@dflt{} + \ifntx@zeroslash\edef\ntx@dflt{Numbers = SlashedZero , + }\fi + \if T\ntx@nospc + \if F\ntx@noti\def\ntx@spcmag{{1,.625,1}}\def\ntx@nospc{F}\fi + \if F\ntx@nolo\def\ntx@spcmag{{1.2,1,1}}\def\ntx@nospc{F}\fi + \fi + \if F\ntx@nospc + \edef\ntx@dflt{\ntx@dflt WordSpace = \ntx@spcmag , + } + \fi + \def\ntx@scraw{pcap} + \ifntx@largesc\def\ntx@scraw{smcp}\fi + + %\ntx@cnt will be 0..2^8-1 + \edef\ntx@lst{} + \ifnum\ntx@cnt>127 \edef\ntx@lst{8}\advance\ntx@cnt -128 \fi + \ifnum\ntx@cnt>63 \edef\ntx@lst{7,\ntx@lst}\advance\ntx@cnt -64 \fi + \ifnum\ntx@cnt>31 \edef\ntx@lst{6,\ntx@lst}\advance\ntx@cnt -32 \fi + \ifnum\ntx@cnt>15 \edef\ntx@lst{5,\ntx@lst}\advance\ntx@cnt -16 \fi + \ifnum\ntx@cnt>7 \edef\ntx@lst{4,\ntx@lst}\advance\ntx@cnt -8 \fi + \ifnum\ntx@cnt>3 \edef\ntx@lst{3,\ntx@lst}\advance\ntx@cnt -4 \fi + \ifnum\ntx@cnt>1 \edef\ntx@lst{2,\ntx@lst}\advance\ntx@cnt -2 \fi + \ifnum\ntx@cnt>0 \edef\ntx@lst{1,\ntx@lst}\fi + \ifthenelse{\not\equal{\ntx@lst}{}} + {\edef\ntx@dflt{\ntx@dflt StylisticSet={\ntx@lst} , + }}{} + + \defaultfontfeatures{ + Ligatures = TeX , + Scale = \ntx@scale , + Extension = .otf , + SmallCapsFeatures={\ifntx@scosf Numbers = OldStyle , + \fi RawFeature = +\ntx@scraw , + \ifluatex Renderer=Basic\fi} , + \ntx@dflt , + RawFeature=-ss05 , + \ntx@defaultfeatures , + } + +\else % type1 + \def\ntx@spacing{% + \fontdimen2\font=\ntx@spc + \fontdimen3\font=\ntx@stretch + \fontdimen4\font=\ntx@shrink} + \@tempdima=\ntx@scale\p@\@tempdima=\ntx@helvratio\@tempdima% + \edef\qhv@scale{\strip@pt\@tempdima} + \def\ntx@scaled{s*[\ntx@scale]}% used in fd files + + %\def\oldstylenums#1{{\fontencoding{TS1}\selectfont #1}} + + %\expandafter\patchcmd\expandafter{\csname scshape \endcsname}{\fontshape}{\fontfamily{ntx\ntx@figurealign osf}\fontshape}{\message{Replaced figure style by osf in sc.}}{\message{Unable to replace figure style by osf in sc.}} + + \DeclareRobustCommand{\lfstyle}{% + \not@math@alphabet\lfstyle\relax + \fontfamily{ntxlf}\selectfont % + } + \DeclareRobustCommand{\tlfstyle}{% + \not@math@alphabet\tlfstyle\relax + \fontfamily{ntxtlf}\selectfont % + } + \DeclareRobustCommand{\osfstyle}{% + \not@math@alphabet\osfstyle\relax + \fontfamily{ntxosf}\selectfont % + } + \DeclareRobustCommand{\tosfstyle}{% + \not@math@alphabet\tosfstyle\relax + \fontfamily{ntxtosf}\selectfont % + } + \ifntx@defaultsups % + \else + \ifntx@KOMA + %\let\textsuperscript\sustyle + \else % NOT KOMA + \def\f@@tn@te{footnote} + \def\@makefnmark{% + \ifx\@mpfn\f@@tn@te% + \ifx\thefootnote\orig@footnote% + \hbox{\sustyle\hspace*{.05em}\@thefnmark\hspace*{.05em}}% + \else% + \orig@makefnmark% + \fi + \else% + \orig@makefnmark% + \fi}% + \fi + \fi + \ifntx@helv\renewcommand*{\sfdefault}{qhv}\fi + \ifntx@tt\renewcommand*{\ttdefault}{ntxtt}\fi + \DeclareRobustCommand\thfamily % new family for theorem font + {\not@math@alphabet\thfamily\relax + \fontfamily\thdefault\selectfont} + \DeclareRobustCommand{\textth}[1]{% + {\thfamily #1}% + } + \let\textthit\textth + +\fi % type1 \ifntx@thrm %\RequirePackage{amsmath,amsthm} % in case of theoremfont @@ -221,7 +431,7 @@ \newtheoremstyle{plain} {\medskipamount} % ABOVESPACE, was \topsep {\medskipamount} % BELOWSPACE, was \topsep - {\slshape} % BODYFONT--\slshape is defined to be \itshape with upright figures and punctuation + {\thfamily} % BODYFONT--\thfamily is italic with upright figures and punctuation {} % INDENT (empty value is the same as 0pt) {\bfseries} % HEADFONT--you may want to add \tlfstyle so the number is tab lining, regardless of text figure selection {.} % HEADPUNCT @@ -229,155 +439,201 @@ {} % CUSTOM-HEAD-SPEC\newtheorem{thm}{Theorem}[section] } % end @ifpackageloaded \fi% -\fi -%\DeclareTextFontCommand{\textsu}{\sustyle} -%\def\@makefnmark{\ifx \thefootnote\orig@footnote \hbox{\sustyle\hspace*{.04em}\@thefnmark}\else\orig@makefnmark\fi} - -\DeclareTextCommand{\textcircled}{TS1}[1]{\hmode@bgroup - \ooalign{% - \hfil \raise -.256ex\hbox {\fontencoding{T1}\fontfamily{ntxsups}\fontseries{m}\fontshape{n}\selectfont\scalefont{.966}\uppercase{#1}}\hfil \crcr - \char 79 %\textbigcircle - }% - \egroup} - -\ifntx@defaultsups % -\else - \ifntx@KOMA % - %\let\textsuperscript\textsu -% \AtEndPreamble{% -% \global\let\@textsuperscript\textsu -% \@ifpackageloaded{authblk}{% -% \renewcommand{\AB@authnote}[1]{\textsu{#1}} -% \renewcommand{\AB@affilnote}[1]{\textsu{#1}} -% }{}% -% }% - \else % not KOMA - \def\f@@tn@te{footnote} - \def\@makefnmark{% - \ifx\@mpfn\f@@tn@te% footnote not in a minipage - \ifx\thefootnote\orig@footnote% - \hbox{\sustyle\hspace*{.04em}\@thefnmark\hspace*{.03em}}% - \else% - \orig@makefnmark% - \fi - \else% footnote in a minipage -% \ntx@fs=\f@size\p@ -% \ntx@fs=1.05\ntx@fs -%\hbox{{\itshape\sustyle\fontsize{\strip@pt\ntx@fs}{12}\selectfont \@thefnmark\hspace*{.1em}}}% - \orig@makefnmark% - \fi}% +\fi%} + +\ifntxotf +% \def\ntx@nft{\if t\ntx@thmtab Monospaced% +% \else Proportional\fi} + \DeclareTextFontCommand{\textsl}{\slshape} + \DeclareTextFontCommand{% + \osfstyle}{\addfontfeatures{Numbers={Proportional,OldStyle}}} + \DeclareTextFontCommand{% + \tosfstyle}{\addfontfeatures{Numbers={Tabular,OldStyle}}} + \DeclareTextFontCommand{% + \tlfstyle}{\addfontfeatures{Numbers={Tabular,Lining}}} + \DeclareTextFontCommand{% + \lfstyle}{\addfontfeatures{Numbers={Proportional,Lining}}} + + \providecommand\sufigures{% + \addfontfeatures{VerticalPosition=Superior}} + \providecommand\infigures{% + \addfontfeatures{VerticalPosition=Inferior}} +% \providecommand\nufigures{% +% \addfontfeatures{VerticalPosition=Numerator}} + \providecommand\defigures{% + \addfontfeatures{VerticalPosition=Denominator}} + \let\sustyle=\sufigures +% \let\nustyle=\nufigures + \let\instyle=\infigures + \let\destyle=\defigures + \ifntx@defaultsups % + \else + \usepackage{realscripts} + \ifntx@KOMA + \setkomafont{footnotelabel}{\normalfont} + \else + \renewcommand\footnotemarkfont{\normalfont} + \fi \fi +% \ifntx@scosf +% \edef\ntx@fnt{\expandafter\csname ntx\ifntx@tabular T\fi OsF\endcsname} +% \DeclareRobustCommand{\textsc}[1]{% +% {\ntx@fnt \addfontfeatures{RawFeature=+smcp}#1}}% +% \fi + \renewcommand*{\textcircled}[1]{% + \StrLen{#1}[\ntx@tmpa]\ntx@tmpcnta=\ntx@tmpa\relax + \ifnum\ntx@tmpcnta>2 + #1 + \else + \ifnum\ntx@tmpcnta=\@ne + \mbox{\normalfont\addfontfeatures{RawFeature=+ss08}#1} + \else % argument has length 2 + \IfInteger{#1}{% + \ntx@tmpcnta=#1\relax + \ifnum\ntx@tmpcnta<10\relax + #1 + \else % >=10 + \ifnum\ntx@tmpcnta>20\relax + #1 + \else % between 10 and 20 + \advance\ntx@tmpcnta 9311 \relax + \symbol{"\nhex{4}{\the\ntx@tmpcnta}} + \fi + \fi %\ifnum + }{#1} % \IfInteger + \fi %ifnum + \fi + } + %\ntx@tmpcnta=9321 % decimal value of "2469 (uni2469 is circled{10}) + %\ntx@cnt=#1 \advance\count@\the\count1 \advance\count@ -10\relax +% \symbol{"\nhex{4}{\the\count@}} +% \renewcommand*{\textcircled}[1]{\hmode@bgroup\ooalign{% +% \hfil \raise -.08ex\hbox{{% +% \normalfont\addfontfeatures{Numbers={Monospaced, Lining}}% +% \scalefont{.8}{\sustyle#1}}}% end hbox +% \hfil \crcr \symbol{"25EF}}% +% \egroup} +\else % type1 + \renewcommand*{\textcircled}[1]{\hmode@bgroup\ooalign{% + \hfil \raise .3ex\hbox{{% + \normalfont + {\scalefont{.6}\tlfstyle#1}}}% end hbox + \hfil \crcr \textbigcircle}% + \egroup} \fi -%%%%%%%%%%%%%%%%%%%%%% -% Text Serif (Times) % -%%%%%%%%%%%%%%%%%%%%%% - -%\renewcommand*{\rmdefault}{ntxr\ntx@style} - -%\DeclareSymbolFont{operators}{OT1}{txr}{m}{n} -%\SetSymbolFont{operators}{bold}{OT1}{txr}{bx}{n} -%\def\operator@font{\mathgroup\symoperators} -% -%\DeclareSymbolFont{italic}{OT1}{txr}{m}{it} -%\SetSymbolFont{italic}{bold}{OT1}{txr}{bx}{it} -% -%\DeclareSymbolFontAlphabet{\mathrm}{operators} -%\DeclareMathAlphabet{\mathbf}{OT1}{txr}{bx}{n} -%\DeclareMathAlphabet{\mathit}{OT1}{txr}{m}{it} -%\SetMathAlphabet{\mathit}{bold}{OT1}{txr}{bx}{it} - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Text Sans Serif (based on Helvetica) % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -\renewcommand*{\sfdefault}{qhv} - -%\DeclareMathAlphabet{\mathsf}{OT1}{txss}{m}{n} -%\SetMathAlphabet{\mathsf}{bold}{OT1}{txss}{b}{n} - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Text (Monospaced) Typewriter % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\renewcommand{\ttdefault}{ntxtt} - -%\DeclareMathAlphabet{\mathtt}{OT1}{txtt}{m}{n} -%\SetMathAlphabet{\mathtt}{bold}{OT1}{txtt}{b}{n} - - - -\def\re@DeclareTextSymbol#1#2#3{% - \let#1=\undefined - \DeclareTextSymbol{#1}{#2}{#3}} - -\def\re@DeclareMathSymbol#1#2#3#4{% - \let#1=\undefined - \DeclareMathSymbol{#1}{#2}{#3}{#4}} - -\re@DeclareTextSymbol{\L}{OT1}{138} -\re@DeclareTextSymbol{\l}{OT1}{170} -\re@DeclareTextSymbol{\textdollar}{OT1}{36} -\re@DeclareTextSymbol{\textsterling}{OT1}{163} -\re@DeclareMathSymbol{\mathsterling}{\mathord}{operators}{163} - -\DeclareTextComposite{\r}{OT1}{A}{197} -\DeclareTextComposite{\r}{OT1}{a}{229} - -\re@DeclareTextSymbol{\textcent}{OT1}{162} -\re@DeclareMathSymbol{\mathcent}{\mathord}{operators}{162} - -%%% Modification of T1 and LY1 encoding related stuff -%%% - -\def\T@n@@nc@d@ng{T1} -%\def\T@n@@nc@d@ngM@cr@M@d{% -%\DeclareTextCommand{\k}{T1}[1]{{\ooalign{\hidewidth\char12\crcr##1}}}% -%} - -\def\LY@n@@nc@d@ng{LY1} -%\def\LY@n@@nc@d@ngM@cr@M@d{% -%\DeclareTextCommand{\k}{LY1}[1]{{\ooalign{\hidewidth\char7\crcr##1}}}% -%} - -%\AtBeginDocument{% -%\ifx\encodingdefault\T@n@@nc@d@ng\T@n@@nc@d@ngM@cr@M@d\fi% -%\ifx\encodingdefault\LY@n@@nc@d@ng\LY@n@@nc@d@ngM@cr@M@d\fi% -%} - -%\ifntx@babel -% \renewcommand*{\rmdefault}{ntx\ntx@figurealign% -% \ntx@figurestyle} -% \normalfont -%\else - -\DeclareRobustCommand\thfamily % new family for theorem font - {\not@math@alphabet\thfamily\relax - \fontfamily\thdefault\selectfont} -\DeclareRobustCommand{\textth}[1]{% - {\thfamily #1}% +% applies to both +\DeclareRobustCommand{\textlf}[1]{% + {\lfstyle #1}% } -\let\textthit\textth - +\DeclareRobustCommand{\texttlf}[1]{% + {\tlfstyle #1}% +} +\DeclareRobustCommand{\textosf}[1]{% + {\osfstyle #1}% +} +\DeclareRobustCommand{\texttosf}[1]{% + {\tosfstyle #1}% +} +\DeclareRobustCommand{\textsu}[1]{% + {\sustyle #1}% +} +\DeclareTextFontCommand{\textsu}{\sustyle} + \let\textsuperior\textsu +\DeclareTextFontCommand{\textnu}{\nustyle} + \let\textnumerator\textnu +\DeclareTextFontCommand{\textde}{\destyle} + \let\textdenominator\textde +\DeclareTextFontCommand{\textinf}{\instyle} + \let\textinferior\textinf + \AtEndPreamble{% -\renewcommand*{\rmdefault}{ntx\ntx@figurealign% -\ntx@figurestyle} -\def\ntx@thfigurestyle{\ntx@figurestyle} -\ifx\ntx@figurestyle\ntx@dfltfigurestyle - \def\ntx@thfigurestyle{tlf} -\else - \def\ntx@thfigurestyle{osf} -\fi % there just two possible figure styles for the theorem font -\newcommand*{\thdefault}{ntxth-\ntx@thfigurestyle} +\ifntxotf + \ifntx@lining + \def\ntx@figurestyle{Lining} + \else + \def\ntx@figurestyle{OldStyle} + \fi + \ifntx@tabular + \def\ntx@figurealign{Monospaced} + \else + \def\ntx@figurealign{Proportional} + \fi + \setmainfont + [ Numbers = {\ntx@figurealign,\ntx@figurestyle}, + UprightFont = *-Regular , + ItalicFont = *-Italic , + BoldFont = *-Bold , + BoldItalicFont = *-BoldItalic , + SlantedFont = *-Slanted , + BoldSlantedFont= *-BoldSlanted , + ] {\ntx@base} + \let\ntx@sty\ntx@figurestyle + \if l\ntx@thmlin\def\ntx@sty{Lining}\fi + \newcommand{\thfamily}%{\@nameuse{ntx\ntx@figurestyle}% + {\itshape\addfontfeatures{% + Numbers={\ntx@figurealign,\ntx@sty} , + RawFeature=+ss05} + } % for theorems + \ifntx@sl\else\let\slshape=\thfamily\fi + + +\else % type1 + \ifntx@lining + \def\ntx@figurestyle{lf} + \else + \def\ntx@figurestyle{osf} + \fi + \ifntx@tabular + \def\ntx@figurealign{t} + \else + \def\ntx@figurealign{} + \fi + + \renewcommand*{\rmdefault}{ntx\ntx@figurealign% + \ntx@figurestyle} + \ifntx@scosf % + \DeclareRobustCommand{\textsc}[1]{% + {\fontfamily{ntx\ntx@figurealign osf}\scshape\selectfont #1}% + }\fi% use OsF in small caps + + \def\ntx@thfigurestyle{\ntx@figurestyle} + \ifx\ntx@figurestyle\ntx@dfltfigurestyle + \def\ntx@thfigurestyle{tlf} + \else + \def\ntx@thfigurestyle{osf} + \fi % there just two possible figure styles for the theorem font + \newcommand*{\thdefault}{ntxth-\ntx@thfigurestyle} + \normalfont +\fi +} +%both \ifntx@thrm \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 -\normalfont} -%\fi +% Define \oldstylenums, \liningnums ,\tabularnums and \proportionalnums +\ifntxotf + \DeclareTextFontCommand{% + \oldstylenums}{\addfontfeatures{Numbers=OldStyle}} + \DeclareTextFontCommand{% + \liningnums}{\addfontfeatures{Numbers=Lining}} + \DeclareTextFontCommand{% + \tabularnums}{\addfontfeatures{Numbers=Tabular}} + \DeclareTextFontCommand{% + \proportionalnums}{\addfontfeatures{Numbers=Proportional}} +\else % type1 + \DeclareTextFontCommand{% + \oldstylenums}{\fontfamily{ntx\ntx@figurealign osf}\selectfont } + \DeclareTextFontCommand{% + \liningnums}{\fontfamily{ntx\ntx@figurealign lf}\selectfont } + \DeclareTextFontCommand{% + \tabularnums}{\fontfamily{ntxt\ntx@figurestyle}\selectfont } + \DeclareTextFontCommand{% + \proportionalnums}{\fontfamily{ntx\ntx@figurestyle}\selectfont } + \re@DeclareTextSymbol{\textdollar}{OT1}{36} +\fi \endinput + |