summaryrefslogtreecommitdiff
path: root/macros/luatex/optex/base/unimath-codes.opm
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-02-10 03:01:13 +0000
committerNorbert Preining <norbert@preining.info>2021-02-10 03:01:13 +0000
commit7428e668f046bec10d1200214789e40390fa51e7 (patch)
treed28de61e9d3ed96c80ebf2300d0ba3d6a76414e6 /macros/luatex/optex/base/unimath-codes.opm
parent1350502b809c028b8f123dec94ca92782eda564f (diff)
CTAN sync 202102100301
Diffstat (limited to 'macros/luatex/optex/base/unimath-codes.opm')
-rw-r--r--macros/luatex/optex/base/unimath-codes.opm40
1 files changed, 35 insertions, 5 deletions
diff --git a/macros/luatex/optex/base/unimath-codes.opm b/macros/luatex/optex/base/unimath-codes.opm
index 21a9b1caeb..a52a9a02cb 100644
--- a/macros/luatex/optex/base/unimath-codes.opm
+++ b/macros/luatex/optex/base/unimath-codes.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \_ncharrmA {Uni math codes <2020-11-13>} % preloaded on demand by \loadmath
+\_codedecl \_ncharrmA {Uni math codes <2021-02-03>} % preloaded on demand by \loadmath
\_doc -----------------------------
The control sequences for `\alpha`, `\beta` etc are redefined here.
@@ -158,7 +158,7 @@
}
\_catcode`#=14
\_everypar={\_setbox0=\_lastbox \_par \_p}
- \_input mathclass.opm
+ \_setbox0=\_vbox{\_input mathclass.opm }
\_endgroup
\_doc -----------------------------
@@ -170,7 +170,9 @@
\_begingroup % \input unimath-table.opm (it is a copy of unicode-math-table.tex):
\_def\UnicodeMathSymbol #1#2#3#4{%
- \_global\_Umathcharnumdef#2=\_Umathcodenum#1\_relax
+ \_ifnum#1=\_Umathcodenum#1 % the code isn't set by mathclass.opm
+ \_global\_Umathchardef#2=0 1 #1 \_global\_Umathcode#1=0 1 #1
+ \_else \_global\_Umathcharnumdef#2=\_Umathcodenum#1 \_fi
\_ifx#3\_mathopen \_gdef#2{\_Udelimiter 4 1 #1 }\_fi
\_ifx#3\_mathclose \_gdef#2{\_Udelimiter 5 1 #1 }\_fi
\_ifx#3\_mathaccent \_gdef#2{\_Umathaccent fixed 7 1 #1 }\_fi
@@ -187,10 +189,21 @@
\_mit % default math alphabets setting
+% hyphen character is transformed to minus:
\_Umathcode `- = 2 1 "2212
-%\_Umathcode`: = 3 1 "3A % mathclass defines it as 6 1 "3A (punctuation)
+
+% mathclass defines : as Punct, plain.tex as Rel, we keep mathclass,
+% i.e. there is difference from plain.tex, you can use $f:A\to B$.
+
\_let\{=\lbrace \_let\}=\rbrace
+% mathclas defines ! as Ord, plain.tex as Close
+\_Umathcode `! = 5 1 `! % keep plain.tex declaration
+\_Umathchardef \mathexclam = 5 1 `!
+% mathclas defines ? as Punct, plain.tex as Close
+\_Umathcode `? = 5 1 `? % keep plain.tex declaration
+\_Umathchardef \mathquestion = 5 1 `?
+
\_protected\_def \_sqrt {\_Uradical 1 "0221A }
\_protected\_def \_cuberoot {\_Uradical 1 "0221B }
\_protected\_def \_fourthroot {\_Uradical 1 "0221C }
@@ -241,6 +254,20 @@
\_global\_Umathcode `/ = 0 1 `/ % mathclass says that / is Bin, Plain TeX says that it is Ord.
+% compressed dots in S and SS styles (usable in \matrix when it is in T, S and SS style)
+\_protected\_def \vdots {\_relax \_ifnum \_mathstyle>3 \_unicodevdots \_else \_vdots \_fi}
+\_protected\_def \ddots {\_relax \_ifnum \_mathstyle>3 \_unicodeddots \_else \_ddots \_fi}
+\_protected\_def \adots {\_relax \_ifnum \_mathstyle>3 \_unicodeadots \_else \_adots \_fi}
+
+% Unicode superscripts (²) and subscripts as simple macros with \mathcode"8000
+\_bgroup
+ \_def\_tmp#1#2{\_global\_mathcode#1="8000 \_lccode`\~=#1 \_lowercase{\_gdef~}{#2}}
+ \_fornum 0..1 \_do {\_tmp{"207#1}{{^#1}}}
+ \_tmp{"B2}{{^2}}\_tmp{"B3}{{^3}}
+ \_fornum 4..9 \_do {\_tmp{"207#1}{{^#1}}}
+ \_fornum 0..9 \_do {\_tmp{"208#1}{{_#1}}}
+\_egroup
+
\_doc -----------------------------
Aliases are declared here. They are names not mentioned in the `unimath-table.opm` file
but commonly used in \TeX.
@@ -379,7 +406,7 @@
\ldotp \cdotp \bullet \triangleleft \trianglerigt \mapstochar \rightarrow
\prime \lhook \rightarrow \leftarrow \rhook \triangleright \triangleleft
\Relbar \Rightarrow \relbar \rightarrow \Leftarrow \mapstochar
- \longrightarrow \Longleftrightarrow \vdots \ddots ;
+ \longrightarrow \Longleftrightarrow \unicodevdots \unicodeddots \unicodeadots ;
\_endcode
@@ -398,6 +425,9 @@ for technical details about Unicode-math.
\_endinput
History:
+2021-02-03 Unicode superscripts, subscripts declared
+2021-01-31 Mathcode of ! ? set to Close, codes undeclared in mathclass set correctly
+2021-01-23 Compressed \vdots, \ddots, \adots in script(script)style.
2020-11-13 Bug fix: \colon declared
2020-06-13 Umathcode of / declared as in Plain TeX
2020-06-07 \_itgreek \_itGreek, \_rmgreek \_rmGreek etc. introduced, names changed