math-def.mkxl /size: 7730 b    last modification: 2021-10-28 13:51
1
    %D \module
2%D   [       file=math-tex,
3%D        version=2001.04.12,
4%D          title=\CONTEXT\ Math Macros,
5%D       subtitle=Definitions,
6%D         author={Hans Hagen, Taco Hoekwater \& Aditya Mahajan},
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14\writestatus{loading}{ConTeXt Math Macros / Definitions}
15
16\unprotect
17
18\pushoverloadmode % cap etc
19
20\startluacode
21    mathematics.define()
22 -- mathematics.xml.registerentities()
23\stopluacode
24
25\popoverloadmode
26
27\activatemathcharacters
28
29%D The \mfunction macro is an alternative for \hbox with a controlable font
30%D switch.
31
32\definemathcommand [arccos]  [nolop] {\mfunctionlabeltext{arccos}}
33\definemathcommand [arcsin]  [nolop] {\mfunctionlabeltext{arcsin}}
34\definemathcommand [arctan]  [nolop] {\mfunctionlabeltext{arctan}}
35\definemathcommand [arccosh] [nolop] {\mfunctionlabeltext{arccosh}}
36\definemathcommand [arcsinh] [nolop] {\mfunctionlabeltext{arcsinh}}
37\definemathcommand [arctanh] [nolop] {\mfunctionlabeltext{arctanh}}
38\definemathcommand [acos]    [nolop] {\mfunctionlabeltext{acos}}
39\definemathcommand [asin]    [nolop] {\mfunctionlabeltext{asin}}
40\definemathcommand [atan]    [nolop] {\mfunctionlabeltext{atan}}
41\definemathcommand [arg]     [nolop] {\mfunctionlabeltext{arg}}
42\definemathcommand [cosh]    [nolop] {\mfunctionlabeltext{cosh}}
43\definemathcommand [cos]     [nolop] {\mfunctionlabeltext{cos}}
44\definemathcommand [coth]    [nolop] {\mfunctionlabeltext{coth}}
45\definemathcommand [cot]     [nolop] {\mfunctionlabeltext{cot}}
46\definemathcommand [csc]     [nolop] {\mfunctionlabeltext{csc}}
47\definemathcommand [deg]     [nolop] {\mfunctionlabeltext{deg}}
48\definemathcommand [det]     [limop] {\mfunctionlabeltext{det}}
49\definemathcommand [dim]     [nolop] {\mfunctionlabeltext{dim}}
50\definemathcommand [exp]     [nolop] {\mfunctionlabeltext{exp}}
51\definemathcommand [gcd]     [limop] {\mfunctionlabeltext{gcd}}
52\definemathcommand [hom]     [nolop] {\mfunctionlabeltext{hom}}
53\definemathcommand [inf]     [limop] {\mfunctionlabeltext{inf}}
54\definemathcommand [injlim]  [limop] {\mfunctionlabeltext{injlim}}
55\definemathcommand [ker]     [nolop] {\mfunctionlabeltext{ker}}
56\definemathcommand [lg]      [nolop] {\mfunctionlabeltext{lg}}
57\definemathcommand [liminf]  [limop] {\mfunctionlabeltext{liminf}}
58\definemathcommand [limsup]  [limop] {\mfunctionlabeltext{limsup}}
59\definemathcommand [lim]     [limop] {\mfunctionlabeltext{lim}}
60\definemathcommand [ln]      [nolop] {\mfunctionlabeltext{ln}}
61\definemathcommand [log]     [nolop] {\mfunctionlabeltext{log}}
62\definemathcommand [median]  [limop] {\mfunctionlabeltext{median}}
63\definemathcommand [max]     [limop] {\mfunctionlabeltext{max}}
64\definemathcommand [min]     [limop] {\mfunctionlabeltext{min}}
65\definemathcommand [mod]     [limop] {\mfunctionlabeltext{mod}}
66%definemathcommand [div]     [limop] {\mfunctionlabeltext{div}}      % overloads \div symbol
67\definemathcommand [projlim] [limop] {\mfunctionlabeltext{projlim}}
68\definemathcommand [Pr]      [limop] {\mfunctionlabeltext{Pr}}
69\definemathcommand [sec]     [nolop] {\mfunctionlabeltext{sec}}
70\definemathcommand [sinh]    [nolop] {\mfunctionlabeltext{sinh}}
71\definemathcommand [sin]     [nolop] {\mfunctionlabeltext{sin}}
72\definemathcommand [sup]     [limop] {\mfunctionlabeltext{sup}}
73\definemathcommand [tanh]    [nolop] {\mfunctionlabeltext{tanh}}
74\definemathcommand [tan]     [nolop] {\mfunctionlabeltext{tan}}
75\definemathcommand [diff]            {\mfunctionlabeltext{diff}}
76
77\aliased\let\normalmatharg\arg % todo: maybe automatically
78
79%D This needs checking:
80
81\permanent\protected\def\setoperatorlimits#1#2% operator limits
82  {\savenormalmeaning{#1}%
83   %frozen\protected\expandafter\def\expandafter#1\expandafter{\csname normal\csstring#1\endcsname#2}}
84   \frozen\protected\edef#1{\expandafter\noexpand\csname\s!normal\csstring#1\endcsname\noexpand#2}}
85
86\pushoverloadmode
87
88\setoperatorlimits \int              \intlimits
89\setoperatorlimits \iint             \intlimits
90\setoperatorlimits \iiint            \intlimits
91\setoperatorlimits \oint             \intlimits
92\setoperatorlimits \oiint            \intlimits
93\setoperatorlimits \oiiint           \intlimits
94\setoperatorlimits \intclockwise     \intlimits
95\setoperatorlimits \ointclockwise    \intlimits
96\setoperatorlimits \ointctrclockwise \intlimits
97
98\popoverloadmode
99
100%D \macros
101%D   {centercolon, colonminus, minuscolon, colonequals, equalscolon,
102%D    colonapprox, approxcolon, colonsim, simcolon, coloncolon,
103%D    coloncolonminus, minuscoloncolon, coloncolonequals,
104%D    equalscoloncolon, coloncolonapprox, approxcoloncolon,
105%D    colonsim, simcoloncolon}
106%D
107%D The following colon related definitions are provided by Aditya
108%D Mahajan who derived them from \type {mathtools.sty} and \type
109%D {colonequals.sty}. This will be redone as part of the overhaul
110%D and font updates.
111%D
112%D In $a := b$ the colon is not vertically centered with the equal
113%D to. Also the distance between colon and equal to is a bit large.
114%D So, we define a vertically centered colon \tex {centercolon} and
115%D a few macros for colon and double colon relation symbols.
116%D
117%D \startlines
118%D \formula {A \centercolon       B}
119%D \formula {A \colonminus        B}
120%D \formula {A \minuscolon        B}
121%D \formula {A \colonequals       B}
122%D \formula {A \equalscolon       B}
123%D \formula {A \colonapprox       B}
124%D \formula {A \approxcolon       B}
125%D \formula {A \colonsim          B}
126%D \formula {A \simcolon          B}
127%D \formula {A \coloncolon        B}
128%D \formula {A \coloncolonminus   B}
129%D \formula {A \minuscoloncolon   B}
130%D \formula {A \coloncolonequals  B}
131%D \formula {A \equalscoloncolon  B}
132%D \formula {A \coloncolonapprox  B}
133%D \formula {A \approxcoloncolon  B}
134%D \formula {A \colonsim          B}
135%D \formula {A \simcoloncolon     B}
136%D \stoplines
137%D
138%D The next macros take care of the space between the colon and the
139%D relation symbol.
140
141\pushoverloadmode
142
143\definemathcommand  [colonsep]        {\mkern-1.2mu}
144\definemathcommand  [doublecolonsep]  {\mkern-0.9mu}
145
146\definemathcommand [centercolon]      [rel] {\mathstylevcenteredhbox\colon}
147\definemathcommand [colonminus]       [rel] {\centercolon\colonsep\mathrel{-}}
148%definemathcommand [minuscolon]       [rel] {\mathrel{-}\colonsep\centercolon} % native char
149%definemathcommand [colonequals]      [rel] {\centercolon\colonsep=}           % native char
150%definemathcommand [equalscolon]      [rel] {=\centercolon\colonsep}           % native char
151\definemathcommand [colonapprox]      [rel] {\centercolon\colonsep\approx}
152\definemathcommand [approxcolon]      [rel] {\approx\centercolon\colonsep}
153\definemathcommand [colonsim]         [rel] {\centercolon\colonsep\sim}
154\definemathcommand [simcolon]         [rel] {\sim\centercolon\colonsep}
155
156\definemathcommand [coloncolon]       [rel] {\centercolon\doublecolonsep\centercolon}
157\definemathcommand [coloncolonminus]  [rel] {\coloncolon\colonsep\mathrel{-}}
158\definemathcommand [minuscoloncolon]  [rel] {\mathrel{-}\colonsep\coloncolon}
159\definemathcommand [coloncolonequals] [rel] {\coloncolon\colonsep=}            % native char
160\definemathcommand [equalscoloncolon] [rel] {=\coloncolon\colonsep}
161\definemathcommand [coloncolonapprox] [rel] {\coloncolon\colonsep\approx}
162\definemathcommand [approxcoloncolon] [rel] {\approx\coloncolon\colonsep}
163\definemathcommand [coloncolonsim]    [rel] {\coloncolon\colonsep\sim}
164\definemathcommand [simcoloncolon]    [rel] {\sim\coloncolon\colonsep}
165
166\popoverloadmode
167
168% \appendtoks
169%     \def\over{\primitive\over}%
170% \to \everymathematics
171
172\protect \endinput
173