math-def.mkiv /size: 7621 b    last modification: 2021-10-28 13:50
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(\number\defaultmathfamily)
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\let\normalmatharg\arg % todo: maybe automatically
78
79%D This needs checking:
80
81\unexpanded\def\setoperatorlimits#1#2% operator limits
82  {\savenormalmeaning{#1}%
83   \expandafter\def\expandafter#1\expandafter{\csname normal\csstring#1\endcsname#2}}
84
85\pushoverloadmode
86
87\setoperatorlimits \int              \intlimits
88\setoperatorlimits \iint             \intlimits
89\setoperatorlimits \iiint            \intlimits
90\setoperatorlimits \oint             \intlimits
91\setoperatorlimits \oiint            \intlimits
92\setoperatorlimits \oiiint           \intlimits
93\setoperatorlimits \intclockwise     \intlimits
94\setoperatorlimits \ointclockwise    \intlimits
95\setoperatorlimits \ointctrclockwise \intlimits
96
97\popoverloadmode
98
99%D \macros
100%D   {centercolon, colonminus, minuscolon, colonequals, equalscolon,
101%D    colonapprox, approxcolon, colonsim, simcolon, coloncolon,
102%D    coloncolonminus, minuscoloncolon, coloncolonequals,
103%D    equalscoloncolon, coloncolonapprox, approxcoloncolon,
104%D    colonsim, simcoloncolon}
105%D
106%D The following colon related definitions are provided by Aditya
107%D Mahajan who derived them from \type {mathtools.sty} and \type
108%D {colonequals.sty}. This will be redone as part of the overhaul
109%D and font updates.
110%D
111%D In $a := b$ the colon is not vertically centered with the equal
112%D to. Also the distance between colon and equal to is a bit large.
113%D So, we define a vertically centered colon \tex {centercolon} and
114%D a few macros for colon and double colon relation symbols.
115%D
116%D \startlines
117%D \formula {A \centercolon       B}
118%D \formula {A \colonminus        B}
119%D \formula {A \minuscolon        B}
120%D \formula {A \colonequals       B}
121%D \formula {A \equalscolon       B}
122%D \formula {A \colonapprox       B}
123%D \formula {A \approxcolon       B}
124%D \formula {A \colonsim          B}
125%D \formula {A \simcolon          B}
126%D \formula {A \coloncolon        B}
127%D \formula {A \coloncolonminus   B}
128%D \formula {A \minuscoloncolon   B}
129%D \formula {A \coloncolonequals  B}
130%D \formula {A \equalscoloncolon  B}
131%D \formula {A \coloncolonapprox  B}
132%D \formula {A \approxcoloncolon  B}
133%D \formula {A \colonsim          B}
134%D \formula {A \simcoloncolon     B}
135%D \stoplines
136%D
137%D The next macros take care of the space between the colon and the
138%D relation symbol.
139
140\pushoverloadmode
141
142\definemathcommand  [colonsep]        {\mkern-1.2mu}
143\definemathcommand  [doublecolonsep]  {\mkern-0.9mu}
144
145\definemathcommand [centercolon]      [rel] {\mathstylevcenteredhbox\colon}
146\definemathcommand [colonminus]       [rel] {\centercolon\colonsep\mathrel{-}}
147%definemathcommand [minuscolon]       [rel] {\mathrel{-}\colonsep\centercolon} % native char
148%definemathcommand [colonequals]      [rel] {\centercolon\colonsep=}           % native char
149%definemathcommand [equalscolon]      [rel] {=\centercolon\colonsep}           % native char
150\definemathcommand [colonapprox]      [rel] {\centercolon\colonsep\approx}
151\definemathcommand [approxcolon]      [rel] {\approx\centercolon\colonsep}
152\definemathcommand [colonsim]         [rel] {\centercolon\colonsep\sim}
153\definemathcommand [simcolon]         [rel] {\sim\centercolon\colonsep}
154
155\definemathcommand [coloncolon]       [rel] {\centercolon\doublecolonsep\centercolon}
156\definemathcommand [coloncolonminus]  [rel] {\coloncolon\colonsep\mathrel{-}}
157\definemathcommand [minuscoloncolon]  [rel] {\mathrel{-}\colonsep\coloncolon}
158\definemathcommand [coloncolonequals] [rel] {\coloncolon\colonsep=}            % native char
159\definemathcommand [equalscoloncolon] [rel] {=\coloncolon\colonsep}
160\definemathcommand [coloncolonapprox] [rel] {\coloncolon\colonsep\approx}
161\definemathcommand [approxcoloncolon] [rel] {\approx\coloncolon\colonsep}
162\definemathcommand [coloncolonsim]    [rel] {\coloncolon\colonsep\sim}
163\definemathcommand [simcoloncolon]    [rel] {\sim\coloncolon\colonsep}
164
165\popoverloadmode
166
167% \appendtoks
168%     \def\over{\primitive\over}%
169% \to \everymathematics
170
171\protect \endinput
172