summaryrefslogtreecommitdiff
path: root/macros/xetex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-11-23 03:01:10 +0000
committerNorbert Preining <norbert@preining.info>2022-11-23 03:01:10 +0000
commit815cebb06d1054b263303b39da2b399828b116c3 (patch)
tree057b1c00ff0fd80e37b126da4fd2f425e7cd679a /macros/xetex
parentd8e47184a9a1a04b1aa016bb4a56d066b8940805 (diff)
CTAN sync 202211230301
Diffstat (limited to 'macros/xetex')
-rw-r--r--macros/xetex/plain/unimath-plain-xetex/doc/unimath-plain-xetex-doc.pdfbin39206 -> 44146 bytes
-rw-r--r--macros/xetex/plain/unimath-plain-xetex/doc/unimath-plain-xetex-doc.tex48
-rw-r--r--macros/xetex/plain/unimath-plain-xetex/tex/unimath-plain-xetex.tex36
3 files changed, 75 insertions, 9 deletions
diff --git a/macros/xetex/plain/unimath-plain-xetex/doc/unimath-plain-xetex-doc.pdf b/macros/xetex/plain/unimath-plain-xetex/doc/unimath-plain-xetex-doc.pdf
index b64b05c93d..ed1756eacf 100644
--- a/macros/xetex/plain/unimath-plain-xetex/doc/unimath-plain-xetex-doc.pdf
+++ b/macros/xetex/plain/unimath-plain-xetex/doc/unimath-plain-xetex-doc.pdf
Binary files differ
diff --git a/macros/xetex/plain/unimath-plain-xetex/doc/unimath-plain-xetex-doc.tex b/macros/xetex/plain/unimath-plain-xetex/doc/unimath-plain-xetex-doc.tex
index 5140d0a2b5..093e183bf7 100644
--- a/macros/xetex/plain/unimath-plain-xetex/doc/unimath-plain-xetex-doc.tex
+++ b/macros/xetex/plain/unimath-plain-xetex/doc/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/macros/xetex/plain/unimath-plain-xetex/tex/unimath-plain-xetex.tex b/macros/xetex/plain/unimath-plain-xetex/tex/unimath-plain-xetex.tex
index 37118739d8..5346a34963 100644
--- a/macros/xetex/plain/unimath-plain-xetex/tex/unimath-plain-xetex.tex
+++ b/macros/xetex/plain/unimath-plain-xetex/tex/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