From 383ade8f42bfc4c156b9739d28ae96d370178753 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 22 Nov 2022 21:44:39 +0000 Subject: unimath-plain-xetex (22nov22) git-svn-id: svn://tug.org/texlive/trunk@65085 c570f23f-e606-0410-a88d-b1316a301751 --- .../unimath-plain-xetex-doc.pdf | Bin 39206 -> 44146 bytes .../unimath-plain-xetex-doc.tex | 48 ++++++++++++++++++++- .../unimath-plain-xetex/unimath-plain-xetex.tex | 36 ++++++++++++---- 3 files changed, 75 insertions(+), 9 deletions(-) diff --git a/Master/texmf-dist/doc/xetex/unimath-plain-xetex/unimath-plain-xetex-doc.pdf b/Master/texmf-dist/doc/xetex/unimath-plain-xetex/unimath-plain-xetex-doc.pdf index b64b05c93d6..ed1756eacfa 100644 Binary files a/Master/texmf-dist/doc/xetex/unimath-plain-xetex/unimath-plain-xetex-doc.pdf and b/Master/texmf-dist/doc/xetex/unimath-plain-xetex/unimath-plain-xetex-doc.pdf differ diff --git a/Master/texmf-dist/doc/xetex/unimath-plain-xetex/unimath-plain-xetex-doc.tex b/Master/texmf-dist/doc/xetex/unimath-plain-xetex/unimath-plain-xetex-doc.tex index 5140d0a2b55..093e183bf75 100644 --- a/Master/texmf-dist/doc/xetex/unimath-plain-xetex/unimath-plain-xetex-doc.tex +++ b/Master/texmf-dist/doc/xetex/unimath-plain-xetex/unimath-plain-xetex-doc.tex @@ -11,6 +11,8 @@ \def\monofontname{Source Code Pro} \def\mathfontname{Erewhon Math} \input unimath-plain-xetex +\unicodeprimesoff +\betweenprimeskip=-1mu\relax \def\xetex{X\kern-.125em\lower.5ex\hbox{\char"018E}\kern-.1667em% T\kern-.1667em\lower.5ex\hbox{E}\kern-.125emX} @@ -23,6 +25,7 @@ \def\pkg#1{{\tensf #1}} %\catcode`\@=11 \@sizeat{40pt}\the\sf@size \catcode`\@=12 \font\hugesans="\sansfontname" at 35pt +\font\sevenlmmath="Latin Modern Math:script=math,+ssty=0" at 7pt \makefontcmdcompatible{ten} \def\ttverbatim{\begingroup @@ -34,6 +37,7 @@ {\catcode`\|=0 |catcode`|\=12 % | is temporary escape character |obeylines % end of line is active |gdef|ttfinish#1^^M#2\endtt{#1|vbox{#2}|endgroup$$}} +\def\charhex{\char"} \catcode`\"=\active {\obeylines \gdef"{\ttverbatim \spaceskip.5em \let^^M=\ \let"=\endgroup}} \def\<#1>{$\langle${\it#1\/}$\rangle$} @@ -85,7 +89,7 @@ \centerline{Zhang Tingxuan} \medskip -\centerline{2022/11/06\quad Version 0.0β} +\centerline{2022/11/23\quad Version 0.0γ} \biggskip \centerline{\bf Abstract} @@ -199,4 +203,46 @@ You can also input Unicode math characters in your document's source file. For example, "$∫_a^b y\,dx$" yields $∫_a^b y\,dx$ and "$$∫_a^b y\,dx.$$" yields $$∫_a^b y\,dx.$$ + + +\section{Primes ($'$)} +The package changed ``"'"'' command in math mode, which yields prime(s) +in superscript. After loading this package, the primes produced by ``"'"'' +will be turned into Unicode primes: +$$\vbox{\openup2pt\halign{#\hfil\quad&\quad#\hfil\quad&\quad#\hfil\cr +{\it Input} & {yields} & {\it Unicode slot}\cr +"'" & $^{\hbox{\sevenlmmath\charhex2032}}$ & U+2032 \cr +"''" & $^{\hbox{\sevenlmmath\charhex2033}}$ & U+2033 \cr +"'''" & $^{\hbox{\sevenlmmath\charhex2034}}$ & U+2034 \cr +"''''" & $^{\hbox{\sevenlmmath\charhex2057}}$ & U+2057 \cr +"'''''" & $^{\hbox{\sevenlmmath\charhex2032 + \hskip-.15em\charhex2032 + \hskip-.15em\charhex2032 + \hskip-.15em\charhex2032 + \hskip-.15em\charhex2032}}$ + & $(\hbox{U+2032})\times5$\cr +$\vdots$ & $\vdots$ & $\vdots$ \cr +$(\hbox{"'"})\times N$ & $(^{\hbox{\sevenlmmath\charhex2032}})\times N$ & +$(\hbox{U+2032})\times N$\hbox to 20pt{\quad$(N>4)$\hss} \cr +}}$$ +However, some OpenType math fonts don't contain some of the characters above. +For example, there is no U+2032, U+2033 or U+2034 in Erewhon Math. +When using such fonts, you can ``turn off'' the Unicode primes easily +by inputing the following line {\it after} loading the package: +\begintt +\unicodeprimesoff +\endtt +Then when you input ``"'"'' $n$ times you will get $n$ primes, +and each prime's Unicode character slot is U+2032, even when $n\leq 4$. + +If the primes contain more than one single prime encoded U+2032, +a negative math skip will inserted between every two single primes. +This math skip is defined as "\betweenprimeskip" and its default value +is "-2.7mu", which is proper for Latin Modern Math. To change the value +of "\betweenprimeskip" is just like change any math skip, for example, +\begintt +\betweenprimeskip=-1mu +\endtt +This line should also written {\it after} loading the package. + \bye \ No newline at end of file diff --git a/Master/texmf-dist/tex/xetex/unimath-plain-xetex/unimath-plain-xetex.tex b/Master/texmf-dist/tex/xetex/unimath-plain-xetex/unimath-plain-xetex.tex index 37118739d8a..5346a349632 100644 --- a/Master/texmf-dist/tex/xetex/unimath-plain-xetex/unimath-plain-xetex.tex +++ b/Master/texmf-dist/tex/xetex/unimath-plain-xetex/unimath-plain-xetex.tex @@ -14,7 +14,6 @@ \newdimen\@tempdimd % text font -%\gdef\mainfontname{Latin Modern Roman} \ifdefined\mainfontname\else \gdef\mainfontname{Latin Modern Roman} \fi @@ -32,7 +31,7 @@ \def\textfontopt{mapping=tex-text} \fi \else - \errmessage{umath-plain-xetex Error: Needs XeTeX!} + \errmessage{unimath-plain-xetex Error: Needs XeTeX!} \fi \font\tenrm = "\mainfontname/R:\textfontopt" at 10pt @@ -52,7 +51,7 @@ \gdef\tt@innerratio{\numexpr\dimexpr256\@tempdima/\@tempdimc\relax} \let\tensf@test\relax \let\tentt@test\relax -\def\@sizeat#1{\@tempdimd#1\relax% +\def\@sizeat#1{\@tempdimd#1\relax \sf@size=\dimexpr\sf@innerratio\@tempdimd/256\relax \tt@size=\dimexpr\tt@innerratio\@tempdimd/256\relax } @@ -130,6 +129,9 @@ \def\mathbotaccent{bA} \def\mathbotaccentwide{bAw} +\def\sqrt{sqrt} \def\cuberoot{cuberoot} +\def\fourthroot{fourthroot} \def\longdivision{longdivision} + \begingroup% \catcode`\^^@=13 \protected\gdef\@activedef#1#2{\begingroup% #1: char code; #2: definition @@ -141,6 +143,7 @@ \ifx#3\mathord \Umathchardef #2 = 0 \unimathfam #1 \Umathcode #1 = 0 \unimathfam #1 + % In the future, this module will use another \fam. %\else\ifx#3\mathalpha % \Umathchardef #2 = 0 \unimathfam #1 % \Umathcode #1 = 0 \unimathfam #1 % a \fi in the end @@ -168,13 +171,13 @@ \Umathcode #1 = 4 \unimathfam #1 \Udelcode #1 = \unimathfam #1 \gdef#2{\Udelimiter 4 \unimathfam #1 } - \ifx#2\sqrt + \ifx#2\sqrt%="221A% \gdef#2{\Uradical \unimathfam #1 } - \fi\ifx#2\cuberoot + \fi\ifx#2\cuberoot%="221B \gdef#2{\Uradical \unimathfam #1 } - \fi\ifx#2\fourthroot + \fi\ifx#2\fourthroot%="221C \gdef#2{\Uradical \unimathfam #1 } - \fi\ifx#2\longdivision + \fi\ifx#2\longdivision%="27CC \gdef#2{\Uradical \unimathfam #1 } \fi \else\ifx#3\mathclose @@ -406,7 +409,7 @@ \chardef\AE="00C6 \chardef\OE="0152 \chardef\O="00D8 -\chardef\i="0131 \chardef\j="237 % dotless letters +\chardef\i="0131 \chardef\j="0237 % dotless letters \chardef\aa="00E5 \chardef\l="0142 \chardef\L="0141 @@ -417,6 +420,23 @@ \chardef\P"00B6 \chardef\copyright="00A9 +% Primes. Patch on plain.tex, line 735--739 +\newcount\c@primes% \c@primes=0 +% If the quantity of primes were more than 4, use \nonUprim@s instead. +\newmuskip\betweenprimeskip +\betweenprimeskip=-2.7mu\relax +\def\after@prim@s{\ifcase\c@primes\or\prime\or\dprime\or\trprime\or\qprime% + \else\nonUprim@s\fi} +\def\nonUprim@s{\prime\loop\ifnum\c@primes>1 \advance\c@primes by -1% + \mskip\betweenprimeskip\prime\repeat} +\def\prim@s{\advance\c@primes by 1\futurelet\next\pr@m@s} +\def\pr@m@s{\ifx'\next\let\nxt\pr@@@s \else\ifx^\next\let\nxt\pr@@@t + \else\let\nxt\pr@@@f\fi\fi \nxt} +\def\pr@@@t#1#2{\after@prim@s#2\egroup} +\def\pr@@@f{\after@prim@s\egroup} +% The following command aims to avoid to use \dprime, \trprime, etc. +\def\unicodeprimesoff{\def\after@prim@s{\nonUprim@s}} + \catcode`\@=12 \tenrm \endinput \ No newline at end of file -- cgit v1.2.3