%% This is part of OpTeX project, see http://petr.olsak.net/optex \_codedecl \sin {Math macros plus mathchardefs <2020-03-14>} % preloaded in format %% The character _ as subscript prefix: \catcode`\_ = 8 \let\sb = _ \catcode`\_ = 13 \let _ = \sb \catcode`\_ = 11 \_private \sb ; % \int_a^b -> \int _a^B, \max_M -> \max _M etc. In general: % let be a word. Then \_ or \_ % (in both cases terminated by non-leter) will be rewritten to % \ _ or \ _ in preprocessor. \_def \_mathsbon {% \directlua{ callback.register("process_input_buffer", function (str) return string.gsub(str.." ", "(\_nbb[a-zA-Z]+)_([a-zA-Z]?[^_a-zA-Z])", "\_pcent 1 _\_pcent 2") end) }} \_def \_mathsboff {% \directlua{ callback.register("process_input_buffer", nil) }% } \_public \mathsboff \mathsbon ; %% Mathcodes prom plainTeX: \_mathcode`\^^@="2201 % \cdot \_mathcode`\^^A="3223 % \downarrow \_mathcode`\^^B="010B % \alpha \_mathcode`\^^C="010C % \beta \_mathcode`\^^D="225E % \land \_mathcode`\^^E="023A % \lnot \_mathcode`\^^F="3232 % \in \_mathcode`\^^G="0119 % \pi \_mathcode`\^^H="0115 % \lambda \_mathcode`\^^I="010D % \gamma \_mathcode`\^^J="010E % \delta \_mathcode`\^^K="3222 % \uparrow \_mathcode`\^^L="2206 % \pm \_mathcode`\^^M="2208 % \oplus \_mathcode`\^^N="0231 % \infty \_mathcode`\^^O="0140 % \partial \_mathcode`\^^P="321A % \subset \_mathcode`\^^Q="321B % \supset \_mathcode`\^^R="225C % \cap \_mathcode`\^^S="225B % \cup \_mathcode`\^^T="0238 % \forall \_mathcode`\^^U="0239 % \exists \_mathcode`\^^V="220A % \otimes \_mathcode`\^^W="3224 % \leftrightarrow \_mathcode`\^^X="3220 % \leftarrow \_mathcode`\^^Y="3221 % \rightarrow \_mathcode`\^^Z="8000 % \ne \_mathcode`\^^[="2205 % \diamond \_mathcode`\^^\="3214 % \le \_mathcode`\^^]="3215 % \ge \_mathcode`\^^^="3211 % \equiv \_mathcode`\^^_="225F % \lor \_mathcode`\ ="8000 % \space \_mathcode`\!="5021 \_mathcode`\'="8000 % ^\prime \_mathcode`\(="4028 \_mathcode`\)="5029 \_mathcode`\*="2203 % \ast \_mathcode`\+="202B \_mathcode`\,="613B \_mathcode`\-="2200 \_mathcode`\.="013A \_mathcode`\/="013D \_mathcode`\:="303A \_mathcode`\;="603B \_mathcode`\<="313C \_mathcode`\=="303D \_mathcode`\>="313E \_mathcode`\?="503F \_mathcode`\[="405B \_mathcode`\\="026E % \backslash \_mathcode`\]="505D \_mathcode`\_="8000 % math-active subscript \_mathcode`\{="4266 \_mathcode`\|="026A \_mathcode`\}="5267 \_mathcode`\^^?="1273 % \smallint \_delcode`\(="028300 \_delcode`\)="029301 \_delcode`\[="05B302 \_delcode`\]="05D303 \_delcode`\<="26830A \_delcode`\>="26930B \_delcode`\/="02F30E \_delcode`\|="26A30C \_delcode`\\="26E30F %% \mathchardef's from plainTeX: \_mathchardef\alpha="010B \_mathchardef\beta="010C \_mathchardef\gamma="010D \_mathchardef\delta="010E \_mathchardef\epsilon="010F \_mathchardef\zeta="0110 \_mathchardef\eta="0111 \_mathchardef\theta="0112 \_mathchardef\iota="0113 \_mathchardef\kappa="0114 \_mathchardef\lambda="0115 \_mathchardef\mu="0116 \_mathchardef\nu="0117 \_mathchardef\xi="0118 \_mathchardef\pi="0119 \_mathchardef\rho="011A \_mathchardef\sigma="011B \_mathchardef\tau="011C \_mathchardef\upsilon="011D \_mathchardef\phi="011E \_mathchardef\chi="011F \_mathchardef\psi="0120 \_mathchardef\omega="0121 \_mathchardef\varepsilon="0122 \_mathchardef\vartheta="0123 \_mathchardef\varpi="0124 \_mathchardef\varrho="0125 \_mathchardef\varsigma="0126 \_mathchardef\varphi="0127 \_mathchardef\Gamma="7000 \_mathchardef\Delta="7001 \_mathchardef\Theta="7002 \_mathchardef\Lambda="7003 \_mathchardef\Xi="7004 \_mathchardef\Pi="7005 \_mathchardef\Sigma="7006 \_mathchardef\Upsilon="7007 \_mathchardef\Phi="7008 \_mathchardef\Psi="7009 \_mathchardef\Omega="700A \_mathchardef\aleph="0240 \_mathchardef\imath="017B \_mathchardef\jmath="017C \_mathchardef\ell="0160 \_mathchardef\wp="017D \_mathchardef\Re="023C \_mathchardef\Im="023D \_mathchardef\partial="0140 \_mathchardef\infty="0231 \_mathchardef\prime="0230 \_mathchardef\emptyset="023B \_mathchardef\nabla="0272 \_protected\_def \surd{{\_mathchar"1270}} \_mathchardef\top="023E \_mathchardef\bot="023F \_mathchardef\triangle="0234 \_mathchardef\forall="0238 \_mathchardef\exists="0239 \_mathchardef\neg="023A \_let\lnot=\neg \_mathchardef\flat="015B \_mathchardef\natural="015C \_mathchardef\sharp="015D \_mathchardef\clubsuit="027C \_mathchardef\diamondsuit="027D \_mathchardef\heartsuit="027E \_mathchardef\spadesuit="027F \_mathchardef\coprod="1360 \_mathchardef\bigvee="1357 \_mathchardef\bigwedge="1356 \_mathchardef\biguplus="1355 \_mathchardef\bigcap="1354 \_mathchardef\bigcup="1353 \_mathchardef\intop="1352 \_protected\_def \int{\_intop\_nolimits} \_private \intop; \_mathchardef\prod="1351 \_mathchardef\sum="1350 \_mathchardef\bigotimes="134E \_mathchardef\bigoplus="134C \_mathchardef\bigodot="134A \_mathchardef\ointop="1348 \_protected\_def\_oint {\_ointop\_nolimits} \_private \ointop; \_mathchardef\bigsqcup="1346 \_mathchardef\smallint="1273 \_mathchardef\triangleleft="212F \_private \triangleleft; \_mathchardef\triangleright="212E \_private \trianglerigt; \_mathchardef\bigtriangleup="2234 \_mathchardef\bigtriangledown="2235 \_mathchardef\wedge="225E \let\land=\wedge \_mathchardef\vee="225F \let\lor=\vee \_mathchardef\cap="225C \_mathchardef\cup="225B \_mathchardef\ddagger="227A \_mathchardef\dagger="2279 \_mathchardef\sqcap="2275 \_mathchardef\sqcup="2274 \_mathchardef\uplus="225D \_mathchardef\amalg="2271 \_mathchardef\diamond="2205 \_mathchardef\bullet="220F \_private \bullet; \_mathchardef\wr="226F \_mathchardef\div="2204 \_mathchardef\odot="220C \_mathchardef\oslash="220B \_mathchardef\otimes="220A \_mathchardef\ominus="2209 \_mathchardef\oplus="2208 \_mathchardef\mp="2207 \_mathchardef\pm="2206 \_mathchardef\circ="220E \_mathchardef\bigcirc="220D \_mathchardef\setminus="226E % for set difference A\setminus B \_mathchardef\cdot="2201 \_mathchardef\ast="2203 \_mathchardef\times="2202 \_mathchardef\star="213F \_mathchardef\propto="322F \_mathchardef\sqsubseteq="3276 \_mathchardef\sqsupseteq="3277 \_mathchardef\parallel="326B \_mathchardef\mid="326A \_mathchardef\dashv="3261 \_mathchardef\vdash="3260 \_mathchardef\nearrow="3225 \_mathchardef\searrow="3226 \_mathchardef\nwarrow="322D \_mathchardef\swarrow="322E \_mathchardef\Leftrightarrow="322C \_mathchardef\Leftarrow="3228 \_mathchardef\Rightarrow="3229 \_protected\_def \neq{\_not=} \_let\ne=\neq \_mathchardef\leq="3214 \let\le=\leq \_mathchardef\geq="3215 \let\ge=\geq \_mathchardef\succ="321F \_mathchardef\prec="321E \_mathchardef\approx="3219 \_mathchardef\succeq="3217 \_mathchardef\preceq="3216 \_mathchardef\supset="321B \_mathchardef\subset="321A \_mathchardef\supseteq="3213 \_mathchardef\subseteq="3212 \_mathchardef\in="3232 \_mathchardef\ni="3233 \let\owns=\ni \_mathchardef\gg="321D \_mathchardef\ll="321C % \_mathchardef\not="3236 % defined below \_mathchardef\leftrightarrow="3224 \_mathchardef\leftarrow="3220 \_let\gets=\leftarrow \_mathchardef\rightarrow="3221 \_let\to=\rightarrow \_mathchardef\mapstochar="3237 \_protected\_def\mapsto{\_mapstochar\_rightarrow} \_private \mapstochar \rightarrow ; \_mathchardef\sim="3218 \_mathchardef\simeq="3227 \_mathchardef\perp="323F \_mathchardef\equiv="3211 \_mathchardef\asymp="3210 \_mathchardef\smile="315E \_mathchardef\frown="315F \_mathchardef\leftharpoonup="3128 \_mathchardef\leftharpoondown="3129 \_mathchardef\rightharpoonup="312A \_mathchardef\rightharpoondown="312B %% Math rm texts: \_protected\_def\log {\_mathop{\_rm log}\_nolimits} \_protected\_def\lg {\_mathop{\_rm lg}\_nolimits} \_protected\_def\ln {\_mathop{\_rm ln}\_nolimits} \_protected\_def\lim {\_mathop{\_rm lim}} \_protected\_def\limsup {\_mathop{\_rm lim\_thinsk sup}} \_protected\_def\liminf {\_mathop{\_rm lim\_thinsk inf}} \_protected\_def\sin {\_mathop{\_rm sin}\_nolimits} \_protected\_def\arcsin {\_mathop{\_rm arcsin}\_nolimits} \_protected\_def\sinh {\_mathop{\_rm sinh}\_nolimits} \_protected\_def\cos {\_mathop{\_rm cos}\_nolimits} \_protected\_def\arccos {\_mathop{\_rm arccos}\_nolimits} \_protected\_def\cosh {\_mathop{\_rm cosh}\_nolimits} \_protected\_def\tan {\_mathop{\_rm tan}\_nolimits} \_protected\_def\arctan {\_mathop{\_rm arctan}\_nolimits} \_protected\_def\tanh {\_mathop{\_rm tanh}\_nolimits} \_protected\_def\cot {\_mathop{\_rm cot}\_nolimits} \_protected\_def\coth {\_mathop{\_rm coth}\_nolimits} \_protected\_def\sec {\_mathop{\_rm sec}\_nolimits} \_protected\_def\csc {\_mathop{\_rm csc}\_nolimits} \_protected\_def\max {\_mathop{\_rm max}} \_protected\_def\min {\_mathop{\_rm min}} \_protected\_def\sup {\_mathop{\_rm sup}} \_protected\_def\inf {\_mathop{\_rm inf}} \_protected\_def\arg {\_mathop{\_rm arg}\_nolimits} \_protected\_def\ker {\_mathop{\_rm ker}\_nolimits} \_protected\_def\dim {\_mathop{\_rm dim}\_nolimits} \_protected\_def\hom {\_mathop{\_rm hom}\_nolimits} \_protected\_def\det {\_mathop{\_rm det}} \_protected\_def\exp {\_mathop{\_rm exp}\_nolimits} \_protected\_def\Pr {\_mathop{\_rm Pr}} \_protected\_def\gcd {\_mathop{\_rm gcd}} \_protected\_def\deg {\_mathop{\_rm deg}\_nolimits} %% PlainTeX macros: \_let\_sp=^ \public \sp ; % \sb=_ , defined at beginning of this file \_def\_thinsk {\_mskip\_thinmuskip} \_protected\_def\,{\_relax\_ifmmode \_thinsk \_else \_thinspace \_fi} \_protected\_def\>{\_mskip\_medmuskip} \let\_medsk = \> \_protected\_def\;{\_mskip\_thickmuskip} \let\_thicksk = \; \_protected\_def\!{\_mskip-\_thinmuskip} \let\_thinneg = \! %\_def\*{\discretionary{\thinspace\the\textfont2\char2}{}{}} % obsolete {\_catcode`\'=\active \_gdef'{^\_bgroup\_primes}} % primes dance \_def\_primes{\_prime\_isnextchar'{\_primesA}% {\_isnextchar^{\_primesB}{\_egroup}}} \_def\_primesA #1{\_primes} \_def\_primesB #1#2{#2\egroup} \_private \prime ; %{\catcode`\^^Z=\active \gdef^^Z{\not=}} % ^^Z is like \ne in math %obsolete \_def\_scalebig#1#2{{\_left#1\_vbox to#2\_fontdimen6\_textfont1{}% \_kern-\_nulldelimiterspace\_right.}} \_protected\_def\_big#1{\_scalebig{#1}{.85}} \_protected\_def\_Big#1{\_scalebig{#1}{1.15}} \_protected\_def\_bigg#1{\_scalebig{#1}{1.45}} \_protected\_def\_Bigg#1{\_scalebig{#1}{1.75}} \_public \big \Big \bigg \Bigg ; \_protected\_def\_bigl{\_mathopen\_big} \_protected\_def\_bigm{\_mathrel\_big} \_protected\_def\_bigr{\_mathclose\_big} \_protected\_def\_Bigl{\_mathopen\_Big} \_protected\_def\_Bigm{\_mathrel\_Big} \_protected\_def\_Bigr{\_mathclose\_Big} \_protected\_def\_biggl{\_mathopen\_bigg} \_protected\_def\_biggm{\_mathrel\_bigg} \_protected\_def\_biggr{\_mathclose\_bigg} \_protected\_def\_Biggl{\_mathopen\_Bigg} \_protected\_def\_Biggm{\_mathrel\_Bigg} \_protected\_def\_Biggr{\_mathclose\_Bigg} \_public \bigl \bigm \bigr \Bigl \Bigm \Bigr \biggl \biggm \biggr \Biggl \Biggm \Biggr ; \_protected\_def\_joinrel{\_mathrel{\_mkern-2.5mu}} % -3mu in plainTeX \_protected\_def\relbar{\_mathrel{\_smash-}} % \_smash, because - has the same height as + \_protected\_def\Relbar{\_mathrel=} \_mathchardef\lhook="312C \_protected\_def\hookrightarrow{\_lhook\_joinrel\_rightarrow} \_mathchardef\rhook="312D \_protected\_def\hookleftarrow{\_leftarrow\_joinrel\_rhook} \_protected\_def\bowtie{\_mathrel\_triangleright\_joinrel\_mathrel\_triangleleft} \_protected\_def\models{\_mathrel|\_joinrel=} \_protected\_def\Longrightarrow{\_Relbar\_joinrel\_Rightarrow} \_protected\_def\longrightarrow{\_relbar\_joinrel\_rightarrow} \_protected\_def\longleftarrow{\_leftarrow\_joinrel\_relbar} \_protected\_def\Longleftarrow{\_Leftarrow\_joinrel\_Relbar} \_protected\_def\longmapsto{\_mapstochar\_longrightarrow} \_protected\_def\longleftrightarrow{\_leftarrow\_joinrel\_rightarrow} \_protected\_def\Longleftrightarrow{\_Leftarrow\_joinrel\_Rightarrow} \_protected\_def\iff{\_thicksk\_Longleftrightarrow\_thicksk} \_private \lhook \rightarrow \leftarrow \rhook \triangleright \triangleleft \Relbar \Rightarrow \relbar \rightarrow \Leftarrow \mapstochar \longrightarrow \Longleftrightarrow ; \_public \joinrel ; \_mathchardef\_ldotp="613A % ldot as a punctuation mark \_mathchardef\_cdotp="6201 % cdot as a punctuation mark \_mathchardef\_colon="603A % colon as a punctuation mark \_public \ldotp \cdotp \colon ; \_protected\_def\_ldots{\_mathinner{\_ldotp\_ldotp\_ldotp}} \_protected\_def\_cdots{\_mathinner{\_cdotp\_cdotp\_cdotp}} \_protected\_def\_vdots{\_vbox{\_baselineskip=.4em \_lineskiplimit=0pt \_kern.6em \_hbox{.}\_hbox{.}\_hbox{.}}} \_protected\_def\_ddots{\_mathinner{% \_mkern1mu\_raise.7em\_vbox{\_kern.7em\_hbox{.}}\_mkern2mu \_raise.4em\_hbox{.}\_mkern2mu\_raise.1em\_hbox{.}\_mkern1mu}} \_public \ldots \cdots \vdots \ddots ; \_protected\_def\acute{\_mathaccent"7013 } \_protected\_def\grave{\_mathaccent"7012 } \_protected\_def\ddot{\_mathaccent"707F } \_protected\_def\tilde{\_mathaccent"707E } \_protected\_def\bar{\_mathaccent"7016 } \_protected\_def\breve{\_mathaccent"7015 } \_protected\_def\check{\_mathaccent"7014 } \_protected\_def\hat{\_mathaccent"705E } \_protected\_def\vec{\_mathaccent"017E } \_protected\_def\dot{\_mathaccent"705F } \_protected\_def\widetilde{\_mathaccent"0365 } \_protected\_def\widehat{\_mathaccent"0362 } \_def\_math{\_mathsurround0pt } \_protected\_def\_overrightarrow #1{\_vbox{\_math\_ialign{##\_crcr \_rightarrowfill\_crcr\_noalign{\_kern-.1em \_nointerlineskip} $\_hfil\_displaystyle{#1}\_hfil$\_crcr}}} \_protected\_def\_overleftarrow #1{\_vbox{\_math\_ialign{##\_crcr \_leftarrowfill\_crcr\_noalign{\_kern-.1em \_nointerlineskip} $\_hfil\_displaystyle{#1}\_hfil$\_crcr}}} \_protected\_def\_overbrace #1{\_mathop{% \_vbox{\_math\_ialign{##\_crcr\_noalign{\_kern.3em} \_downbracefill\_crcr\_noalign{\_kern.3em \_nointerlineskip} $\_hfil\_displaystyle{#1}\_hfil$\_crcr}}}\_limits} \_protected\_def\_underbrace #1{\_mathop{\_vtop{\_math\_ialign{##\_crcr $\_hfil\_displaystyle{#1}\_hfil$\_crcr\_noalign{\_kern.3em \_nointerlineskip} \_upbracefill\_crcr\_noalign{\_kern.3em}}}}\_limits} \_protected\_def\_skew #1#2#3{{\_muskip0=#1mu\_divide\_muskip0=by2 \_mkern\_muskip0 #2{\_mkern-\_muskip0{#3}\_mkern\_muskip0}\_mkern-\_muskip0}{}} \_public \overrightarrow \overleftarrow \overbrace \underbrace \skew ; \_protected\_def\lmoustache{\_delimiter"437A340 } % top from (, bottom from ) \_protected\_def\rmoustache{\_delimiter"537B341 } % top from ), bottom from ( \_protected\_def\lgroup{\_delimiter"462833A } % extensible ( with sharper tips \_protected\_def\rgroup{\_delimiter"562933B } % extensible ) with sharper tips \_protected\_def\arrowvert{\_delimiter"26A33C } % arrow without arrowheads \_protected\_def\Arrowvert{\_delimiter"26B33D } % double arrow without arrowheads \_protected\_def\bracevert{\_delimiter"77C33E } % the vertical bar that extends braces \_protected\_def\Vert{\_delimiter"26B30D } \_let\|=\_Vert \_protected\_def\vert{\_delimiter"26A30C } \_protected\_def\uparrow{\_delimiter"3222378 } \_protected\_def\downarrow{\_delimiter"3223379 } \_protected\_def\updownarrow{\_delimiter"326C33F } \_protected\_def\Uparrow{\_delimiter"322A37E } \_protected\_def\Downarrow{\_delimiter"322B37F } \_protected\_def\Updownarrow{\_delimiter"326D377 } \_protected\_def\backslash{\_delimiter"26E30F } % for double coset G\_backslash H \_protected\_def\rangle{\_delimiter"526930B } \_protected\_def\langle{\_delimiter"426830A } \_protected\_def\rbrace{\_delimiter"5267309 } \_let\}=\rbrace \_let\_rbrace=\rbrace \_protected\_def\lbrace{\_delimiter"4266308 } \_let\{=\lbrace \_let\_lbrace=\lbrace \_protected\_def\rceil{\_delimiter"5265307 } \_protected\_def\lceil{\_delimiter"4264306 } \_protected\_def\rfloor{\_delimiter"5263305 } \_protected\_def\lfloor{\_delimiter"4262304 } \_protected\_def\choose{\_atopwithdelims()} \_protected\_def\brack{\_atopwithdelims[]} \_protected\_def\brace{\_atopwithdelims\_lbrace\_rbrace} \_protected\_def\_sqrt{\_radical"270370 } \_public \sqrt ; \_def\_mathpalette#1#2{\_mathchoice{#1\_displaystyle{#2}}% {#1\_textstyle{#2}}{#1\_scriptstyle{#2}}{#1\_scriptscriptstyle{#2}}} \_newbox\_rootbox \_protected\_def\root#1\of{\_setbox\_rootbox \_hbox{$\_math\_scriptscriptstyle{#1}$}\_mathpalette\_rootA} \_def\_rootA#1#2{\_setbox0=\_hbox{$\_math#1\_sqrt{#2}$}\_dimen0=\_ht0 \_advance\_dimen0by-\_dp0 \_mkern5mu\_raise.6\_dimen0\_copy\_rootbox \_mkern-10mu\_box0 } \_newifi\_ifvp \_newifi\_ifhp \_protected\_def\_vphantom{\_vptrue\_hpfalse\_phant} \_protected\_def\_hphantom{\_vpfalse\_hptrue\_phant} \_protected\_def\_phantom{\_vptrue\_hptrue\_phant} \_def\_phant{\_ifmmode\_def\_next{\_mathpalette\_mathphant}% \_else\_let\_next=\_makephant\_fi\_next} \_def\_makephant#1{\_setbox0\_hbox{#1}\_finphant} \_def\_mathphant#1#2{\_setbox0=\_hbox{$\_math#1{#2}$}\_finphant} \_def\_finphant{\_setbox2=\_null \_ifvp \_ht2=\_ht0 \_dp2=\_dp0 \_fi \_ifhp \_wd2=\_wd0 \_fi \_box2 } \_def\_mathstrut{\_vphantom(} \_protected\_def\_smash{\_relax % \_relax, in case this comes first in \halign \_ifmmode\_def\_next{\_mathpalette\_mathsmash}\_else\_let\_next\_makesmash \_fi\_next} \_def\_makesmash#1{\_setbox0=\_hbox{#1}\_finsmash} \_def\_mathsmash#1#2{\_setbox0=\_hbox{$\_math#1{#2}$}\_finsmash} \_def\_finsmash{\_ht0=0pt \_dp0=0pt \_box0 } \_public \mathpalette \vphantom \hphantom \phantom \mathstrut \smash ; \_protected\_def\_cong{\_mathrel{\_mathpalette\_overeq\_sim}} % congruence sign \_def\_overeq#1#2{\_lower.05em\_vbox{\_lineskiplimit\_maxdimen\_lineskip=-.05em \_ialign{$\_math#1\_hfil##\_hfil$\_crcr#2\_crcr=\_crcr}}} \_protected\_def\_notin{\_mathrel{\_mathpalette\_cancel\_in}} \_def\_cancel#1#2{\_math\_ooalign{$\_hfil#1\_mkern1mu/\_hfil$\_crcr$#1#2$}} \_protected\_def\_rightleftharpoons{\_mathrel{\_mathpalette\_rlhp{}}} \_def\_rlhp#1{\_vcenter{\_math\_hbox{\_ooalign{\_raise.2em \_hbox{$#1\_rightharpoonup$}\_crcr $#1\_leftharpoondown$}}}} \_protected\_def\_buildrel#1\over#2{\_mathrel{\_mathop{\_kern0pt #2}\_limits^{#1}}} \_protected\_def\_doteq{\_buildrel\_textstyle.\over=} \_public \cong \notin \rightleftharpoons \buildrel \doteq ; \_protected\_def\_bmod{\_nonscript\_mskip-\_medmuskip\_mkern5mu \_mathbin{\_rm mod}\_penalty900\_mkern5mu\_nonscript\_mskip-\_medmuskip} \_protected\_def\_pmod#1{\_allowbreak\_mkern18mu({\_rm mod}\_thinsk\_thinsk#1)} \_public \bmod \pmod ; \_protected\_def\_cases#1{\_left\{\_thinsk\_vcenter{\_normalbaselines\_math \_ialign{$##\_hfil$&\_quad##\_hfil\_crcr#1\_crcr}}\_right.} \_protected\_def\_matrix#1{\_null\_thinsk\_vcenter{\_normalbaselines\_math \_ialign{\_hfil$##$\_hfil&&\_quad\_hfil$##$\_hfil\_crcr \_mathstrut\_crcr\_noalign{\_kern-\_baselineskip} #1\_crcr\_mathstrut\_crcr\_noalign{\_kern-\_baselineskip}}}\_thinsk} \_protected\_def\_pmatrix#1{\_left(\_matrix{#1}\_right)} \_newdimen\_ptrenwd \_ptrenwd=0.875\fontdimen6\textfont1 % width of the big left ( \_protected\_def\_bordermatrix#1{\_begingroup \_math \_setbox0=\_vbox{\_def\_cr{\_crcr\_noalign{\_kern.2em\_global\_let\_cr\_endline}}% \_ialign{$##$\_hfil\_kern.2em\_kern\_ptrenwd&\_thinspace\_hfil$##$\_hfil &&\_quad\_hfil$##$\_hfil\_crcr \_omit\_strut\_hfil\_crcr\_noalign{\_kern-\_baselineskip}% #1\_crcr\_omit\_strut\_cr}}% \_setbox2=\_vbox{\_unvcopy0 \_global\_setbox1=\_lastbox}% \_setbox2=\_hbox{\_unhbox1 \_unskip\_global\_setbox1=\_lastbox}% \_setbox2=\_hbox{$\_kern\_wd1 \_kern-\_ptrenwd\_left(\_kern-\_wd1 \_global\_setbox1=\_vbox{\_box1 \_kern.2em}% \_vcenter{\_kern-\_ht1 \_unvbox0 \_kern-\_baselineskip}\_thinsk\_right)$}% \_null\_thicksk\_vbox{\_kern\_ht1 \_box2}\_endgroup} \_public \cases \matrix \pmatrix \bordermatrix ; \_def\_openup{\_afterassignment\_openupA\_dimen0=} \_def\_openupA{\_advance\_lineskip by\_dimen0 \_advance\_baselineskip by\_dimen0 \_advance\_lineskiplimit by\_dimen0 } \_def\_eqalign#1{\_null\_thinsk\_vcenter{\_openup\_jot\_math \_ialign{\_strut\_hfil$\_displaystyle{##}$&$\_displaystyle{{}##}$\_hfil \_crcr#1\_crcr}}\_thinsk} \_newifi\_ifdtop \_def\_display{\_global\_dtoptrue\_openup\_jot\_math \_everycr{\_noalign{\_ifdtop \_global\_dtopfalse \_ifdim\_prevdepth>-1000pt \_vskip-\_lineskiplimit \_vskip\_normallineskiplimit \_fi \_else \_penalty\_interdisplaylinepenalty \_fi}}} \_def\_elign{\_tabskip=\_zoskip\_everycr{}} % restore inside \_display \_def\_displaylines#1{\_display \_tabskip=\_zoskip \_halign{\_hbox to\_displaywidth{$\_elign\_hfil\_displaystyle##\_hfil$}\_crcr #1\_crcr}} \_def\_eqalignno#1{\_display \_tabskip=\_centering \_halign to\_displaywidth{\_hfil$\_elign\_displaystyle{##}$\_tabskip=\_zoskip &$\_elign\_displaystyle{{}##}$\_hfil\_tabskip\_centering &\_llap{$\_elign##$}\_tabskip\_zoskip\_crcr #1\_crcr}} \_def\_leqalignno#1{\_display \_tabskip=\_centering \_halign to\_displaywidth{\_hfil$\_elign\_displaystyle{##}$\_tabskip=\_zoskip &$\_elign\_displaystyle{{}##}$\_hfil\_tabskip=\_centering &\_kern-\_displaywidth\_rlap{$\_elign##$}\_tabskip\_displaywidth\_crcr #1\_crcr}} \_public \openup \eqalign \displaylines \eqalignno ; %% Mathchardefs for AMS fonts: \_def\_amsafam{4} \_def\_amsbfam{5} \_mathchardef \boxdot "2\_amsafam 00 \_mathchardef \boxplus "2\_amsafam 01 \_mathchardef \boxtimes "2\_amsafam 02 \_mathchardef \square "0\_amsafam 03 \_mathchardef \blacksquare "0\_amsafam 04 \_mathchardef \centerdot "2\_amsafam 05 \_mathchardef \lozenge "0\_amsafam 06 \_mathchardef \blacklozenge "0\_amsafam 07 \_mathchardef \circlearrowright "3\_amsafam 08 \_mathchardef \circlearrowleft "3\_amsafam 09 \_mathchardef \rightleftharpoons "3\_amsafam 0A \_mathchardef \leftrightharpoons "3\_amsafam 0B \_mathchardef \boxminus "2\_amsafam 0C \_mathchardef \Vdash "3\_amsafam 0D \_mathchardef \Vvdash "3\_amsafam 0E \_mathchardef \vDash "3\_amsafam 0F \_mathchardef \twoheadrightarrow "3\_amsafam 10 \_mathchardef \twoheadleftarrow "3\_amsafam 11 \_mathchardef \leftleftarrows "3\_amsafam 12 \_mathchardef \rightrightarrows "3\_amsafam 13 \_mathchardef \upuparrows "3\_amsafam 14 \_mathchardef \downdownarrows "3\_amsafam 15 \_mathchardef \upharpoonright "3\_amsafam 16 \_mathchardef \downharpoonright "3\_amsafam 17 \_mathchardef \upharpoonleft "3\_amsafam 18 \_mathchardef \downharpoonleft "3\_amsafam 19 \_mathchardef \rightarrowtail "3\_amsafam 1A \_mathchardef \leftarrowtail "3\_amsafam 1B \_mathchardef \leftrightarrows "3\_amsafam 1C \_mathchardef \rightleftarrows "3\_amsafam 1D \_mathchardef \Lsh "3\_amsafam 1E \_mathchardef \Rsh "3\_amsafam 1F \_mathchardef \rightsquigarrow "3\_amsafam 20 \_mathchardef \leftrightsquigarrow "3\_amsafam 21 \_mathchardef \looparrowleft "3\_amsafam 22 \_mathchardef \looparrowright "3\_amsafam 23 \_mathchardef \circeq "3\_amsafam 24 \_mathchardef \succsim "3\_amsafam 25 \_mathchardef \gtrsim "3\_amsafam 26 \_mathchardef \gtrapprox "3\_amsafam 27 \_mathchardef \multimap "3\_amsafam 28 \_mathchardef \therefore "3\_amsafam 29 \_mathchardef \because "3\_amsafam 2A \_mathchardef \doteqdot "3\_amsafam 2B \_mathchardef \triangleq "3\_amsafam 2C \_mathchardef \precsim "3\_amsafam 2D \_mathchardef \lesssim "3\_amsafam 2E \_mathchardef \lessapprox "3\_amsafam 2F \_mathchardef \eqslantless "3\_amsafam 30 \_mathchardef \eqslantgtr "3\_amsafam 31 \_mathchardef \curlyeqprec "3\_amsafam 32 \_mathchardef \curlyeqsucc "3\_amsafam 33 \_mathchardef \preccurlyeq "3\_amsafam 34 \_mathchardef \leqq "3\_amsafam 35 \_mathchardef \leqslant "3\_amsafam 36 \_mathchardef \lessgtr "3\_amsafam 37 \_mathchardef \backprime "0\_amsafam 38 \_mathchardef \risingdotseq "3\_amsafam 3A \_mathchardef \fallingdotseq "3\_amsafam 3B \_mathchardef \succcurlyeq "3\_amsafam 3C \_mathchardef \geqq "3\_amsafam 3D \_mathchardef \geqslant "3\_amsafam 3E \_mathchardef \gtrless "3\_amsafam 3F \_mathchardef \sqsubset "3\_amsafam 40 \_mathchardef \sqsupset "3\_amsafam 41 \_mathchardef \vartriangleright "3\_amsafam 42 \_mathchardef \vartriangleleft "3\_amsafam 43 \_mathchardef \trianglerighteq "3\_amsafam 44 \_mathchardef \trianglelefteq "3\_amsafam 45 \_mathchardef \bigstar "0\_amsafam 46 \_mathchardef \between "3\_amsafam 47 \_mathchardef \blacktriangledown "0\_amsafam 48 \_mathchardef \blacktriangleright "3\_amsafam 49 \_mathchardef \blacktriangleleft "3\_amsafam 4A \_mathchardef \vartriangle "3\_amsafam 4D \_mathchardef \blacktriangle "0\_amsafam 4E \_mathchardef \triangledown "0\_amsafam 4F \_mathchardef \eqcirc "3\_amsafam 50 \_mathchardef \lesseqgtr "3\_amsafam 51 \_mathchardef \gtreqless "3\_amsafam 52 \_mathchardef \lesseqqgtr "3\_amsafam 53 \_mathchardef \gtreqqless "3\_amsafam 54 \_mathchardef \Rrightarrow "3\_amsafam 56 \_mathchardef \Lleftarrow "3\_amsafam 57 \_mathchardef \veebar "2\_amsafam 59 \_mathchardef \barwedge "2\_amsafam 5A \_mathchardef \doublebarwedge "2\_amsafam 5B \_mathchardef \angle "0\_amsafam 5C \_mathchardef \measuredangle "0\_amsafam 5D \_mathchardef \sphericalangle "0\_amsafam 5E \_mathchardef \varpropto "3\_amsafam 5F \_mathchardef \smallsmile "3\_amsafam 60 \_mathchardef \smallfrown "3\_amsafam 61 \_mathchardef \Subset "3\_amsafam 62 \_mathchardef \Supset "3\_amsafam 63 \_mathchardef \Cup "2\_amsafam 64 \_mathchardef \Cap "2\_amsafam 65 \_mathchardef \curlywedge "2\_amsafam 66 \_mathchardef \curlyvee "2\_amsafam 67 \_mathchardef \leftthreetimes "2\_amsafam 68 \_mathchardef \rightthreetimes "2\_amsafam 69 \_mathchardef \subseteqq "3\_amsafam 6A \_mathchardef \supseteqq "3\_amsafam 6B \_mathchardef \bumpeq "3\_amsafam 6C \_mathchardef \Bumpeq "3\_amsafam 6D \_mathchardef \lll "3\_amsafam 6E \_mathchardef \ggg "3\_amsafam 6F \_protected\_def \ulcorner {\_delimiter"4\_amsafam 70\_amsafam 70 } \_protected\_def \urcorner {\_delimiter"5\_amsafam 71\_amsafam 71 } \_mathchardef \circledS "0\_amsafam 73 \_mathchardef \pitchfork "3\_amsafam 74 \_mathchardef \dotplus "2\_amsafam 75 \_mathchardef \backsim "3\_amsafam 76 \_mathchardef \backsimeq "3\_amsafam 77 \_protected\_def \llcorner {\_delimiter"4\_amsafam 78\_amsafam 78 } \_protected\_def \lrcorner {\_delimiter"5\_amsafam 79\_amsafam 79 } \_mathchardef \complement "0\_amsafam 7B \_mathchardef \intercal "2\_amsafam 7C \_mathchardef \circledcirc "2\_amsafam 7D \_mathchardef \circledast "2\_amsafam 7E \_mathchardef \circleddash "2\_amsafam 7F \_mathchardef \rhd "2\_amsafam 42 \_mathchardef \lhd "2\_amsafam 43 \_mathchardef \unrhd "2\_amsafam 44 \_mathchardef \unlhd "2\_amsafam 45 \_let\restriction\upharpoonright \_let\Doteq\doteqdot \_let\doublecup\Cup \_let\doublecap\Cap \_let\llless\lll \_let\gggtr\ggg \_let\Box=\square % LaTeX symbol \_let\Box=\square % LaTeX symbol \_mathchardef \lvertneqq "3\_amsbfam 00 \_mathchardef \gvertneqq "3\_amsbfam 01 \_mathchardef \nleq "3\_amsbfam 02 \_mathchardef \ngeq "3\_amsbfam 03 \_mathchardef \nless "3\_amsbfam 04 \_mathchardef \ngtr "3\_amsbfam 05 \_mathchardef \nprec "3\_amsbfam 06 \_mathchardef \nsucc "3\_amsbfam 07 \_mathchardef \lneqq "3\_amsbfam 08 \_mathchardef \gneqq "3\_amsbfam 09 \_mathchardef \nleqslant "3\_amsbfam 0A \_mathchardef \ngeqslant "3\_amsbfam 0B \_mathchardef \lneq "3\_amsbfam 0C \_mathchardef \gneq "3\_amsbfam 0D \_mathchardef \npreceq "3\_amsbfam 0E \_mathchardef \nsucceq "3\_amsbfam 0F \_mathchardef \precnsim "3\_amsbfam 10 \_mathchardef \succnsim "3\_amsbfam 11 \_mathchardef \lnsim "3\_amsbfam 12 \_mathchardef \gnsim "3\_amsbfam 13 \_mathchardef \nleqq "3\_amsbfam 14 \_mathchardef \ngeqq "3\_amsbfam 15 \_mathchardef \precneqq "3\_amsbfam 16 \_mathchardef \succneqq "3\_amsbfam 17 \_mathchardef \precnapprox "3\_amsbfam 18 \_mathchardef \succnapprox "3\_amsbfam 19 \_mathchardef \lnapprox "3\_amsbfam 1A \_mathchardef \gnapprox "3\_amsbfam 1B \_mathchardef \nsim "3\_amsbfam 1C \_mathchardef \ncong "3\_amsbfam 1D \_mathchardef \diagup "0\_amsbfam 1E \_mathchardef \diagdown "0\_amsbfam 1F \_mathchardef \varsubsetneq "3\_amsbfam 20 \_mathchardef \varsupsetneq "3\_amsbfam 21 \_mathchardef \nsubseteqq "3\_amsbfam 22 \_mathchardef \nsupseteqq "3\_amsbfam 23 \_mathchardef \subsetneqq "3\_amsbfam 24 \_mathchardef \supsetneqq "3\_amsbfam 25 \_mathchardef \varsubsetneqq "3\_amsbfam 26 \_mathchardef \varsupsetneqq "3\_amsbfam 27 \_mathchardef \subsetneq "3\_amsbfam 28 \_mathchardef \supsetneq "3\_amsbfam 29 \_mathchardef \nsubseteq "3\_amsbfam 2A \_mathchardef \nsupseteq "3\_amsbfam 2B \_mathchardef \nparallel "3\_amsbfam 2C \_mathchardef \nmid "3\_amsbfam 2D \_mathchardef \nshortmid "3\_amsbfam 2E \_mathchardef \nshortparallel "3\_amsbfam 2F \_mathchardef \nvdash "3\_amsbfam 30 \_mathchardef \nVdash "3\_amsbfam 31 \_mathchardef \nvDash "3\_amsbfam 32 \_mathchardef \nVDash "3\_amsbfam 33 \_mathchardef \ntrianglerighteq "3\_amsbfam 34 \_mathchardef \ntrianglelefteq "3\_amsbfam 35 \_mathchardef \ntriangleleft "3\_amsbfam 36 \_mathchardef \ntriangleright "3\_amsbfam 37 \_mathchardef \nleftarrow "3\_amsbfam 38 \_mathchardef \nrightarrow "3\_amsbfam 39 \_mathchardef \nLeftarrow "3\_amsbfam 3A \_mathchardef \nRightarrow "3\_amsbfam 3B \_mathchardef \nLeftrightarrow "3\_amsbfam 3C \_mathchardef \nleftrightarrow "3\_amsbfam 3D \_mathchardef \divideontimes "2\_amsbfam 3E \_mathchardef \varnothing "0\_amsbfam 3F \_mathchardef \nexists "0\_amsbfam 40 \_mathchardef \Finv "0\_amsbfam 60 \_mathchardef \Game "0\_amsbfam 61 \_mathchardef \mho "0\_amsbfam 66 \_mathchardef \eth "0\_amsbfam 67 \_mathchardef \eqsim "3\_amsbfam 68 \_mathchardef \beth "0\_amsbfam 69 \_mathchardef \gimel "0\_amsbfam 6A \_mathchardef \daleth "0\_amsbfam 6B \_mathchardef \lessdot "2\_amsbfam 6C \_mathchardef \gtrdot "2\_amsbfam 6D \_mathchardef \ltimes "2\_amsbfam 6E \_mathchardef \rtimes "2\_amsbfam 6F \_mathchardef \shortmid "3\_amsbfam 70 \_mathchardef \shortparallel "3\_amsbfam 71 \_mathchardef \smallsetminus "2\_amsbfam 72 \_mathchardef \thicksim "3\_amsbfam 73 \_mathchardef \thickapprox "3\_amsbfam 74 \_mathchardef \approxeq "3\_amsbfam 75 \_mathchardef \precapprox "3\_amsbfam 76 \_mathchardef \succapprox "3\_amsbfam 77 \_mathchardef \curvearrowleft "3\_amsbfam 78 \_mathchardef \curvearrowright "3\_amsbfam 79 \_mathchardef \digamma "0\_amsbfam 7A \_mathchardef \varkappa "0\_amsbfam 7B \_mathchardef \Bbbk "0\_amsbfam 7C \_mathchardef \hslash "0\_amsbfam 7D \_mathchardef \hbar "0\_amsbfam 7E \_mathchardef \backepsilon "3\_amsbfam 7F \_let\circledplus\oplus \_let\circledminus\ominus \_let\circledtimes\otimes \_let\circledslash\oslash \_let\circleddot\odot % \not redefined: % \not< becomes \_nless % \not> becomes \_ngtr % if \_notXXX is defined, \not\XXX becomes \_notXXX; % if \_nXXX is defined, \not\XXX becomes \_nXXX; % otherwise, \not\XXX is done in the usual way. \_mathchardef \_notchar "3236 \_protected\_def \_not#1{% \_ifx #1<\_nless \_else \_ifx #1>\_ngtr \_else \_edef\_tmpn{\_csstring#1}% \_ifcsname _not\_tmpn\_endcsname \_csname _not\_tmpn\_endcsname \_else \_ifcsname _n\_tmpn\_endcsname \_csname _n\_tmpn\_endcsname \_else \_mathrel{\_mathord{\_notchar}\_mathord{#1}}% \_fi \_fi \_fi \_fi} \_private \nleq \ngeq \nless \ngtr \nprec \nsucc \nleqslant \ngeqslant \npreceq \nsucceq \nleqq \ngeqq \nsim \ncong \nsubseteqq \nsupseteqq \nsubseteq \nsupseteq \nparallel \nmid \nshortmid \nshortparallel \nvdash \nVdash \nvDash \nVDash \ntrianglerighteq \ntrianglelefteq \ntriangleleft \ntriangleright \nleftarrow \nrightarrow \nLeftarrow \nRightarrow \nLeftrightarrow \nleftrightarrow \nexists ; \_public \not ; \_def\_mathbox#1{{\_mathchoice{\_mathboxA\_displaystyle[]{#1}}{\_mathboxA\_textstyle[]{#1}} {\_mathboxA\_textstyle[700]{#1}}{\_mathboxA\_textstyle[500]{#1}}}} \_def\_mathboxA#1[#2]#3{\_hbox{\_everymath={#1}\_if^#2^\_else\_typoscale[#2/]\_relax\_fi #3}} \_public \mathbox ; \_endcode %--------------------------------------------------- \secc The character `_` as subscript prefix %------------------------------------------ The category code of `_` remains as letter (11) and the mathocode of `_` is `"8000`. It means that it is active character in math mode. It is defined as subscript prefix. There is a problem: The `x_n` is tokenized as `x`, `_`, `n` and it works without problem. But `\int_a^b` is tokenized as `\int_a`, `^`, `b`. The control sequence `\int_a` isn't defined. We m,aut write `\int _a^b`. The lua code presented here solves this problem. But you cannot set our own control sequence in the form `\_` or `\_` (where is sequence of letters) because such contol sequences are unacessible: proprocessor rewrites them. \secc Mathcodes from plain\TeX/ %------------------------------ All mathcodes are set to equal values as in plain\TeX/. \secc Mathchardef from plain\TeX/ %-------------------------------- All control sequences declared by `\mathchardef` are supposed (by default) only for public usage. It means that they are delcared without `_` prefix. If such sequences are used in internal \OpTeX/ macro then their internal prefixed form is declared using `\_private` macro only if it is explicitly needed. \secc Math rm texts %------------------ The math functions like log, sin, cos are declared in tha same way as in plain\TeX/, but they are `\protected`. \secc Plain\TeX/ macros %---------------------- These macros are defined similarly as in plain\TeX. Only internal macro names from plain\TeX/ with `@` character are we-written in more readable form. \secc Matchchardefs from AMS fonts %--------------------------------- These macros are inspired from `ams-math.tex` file.