math-def.mkiv /size: 7815 b    last modification: 2023-12-21 09:44
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 [erf]     [nolop] {\mfunctionlabeltext{erf}}
51%definemathcommand [erfc]    [nolop] {\mfunctionlabeltext{erfc}}
52%definemathcommand [erfi]    [nolop] {\mfunctionlabeltext{erfi}}
53\definemathcommand [exp]     [nolop] {\mfunctionlabeltext{exp}}
54\definemathcommand [gcd]     [limop] {\mfunctionlabeltext{gcd}}
55\definemathcommand [hom]     [nolop] {\mfunctionlabeltext{hom}}
56\definemathcommand [inf]     [limop] {\mfunctionlabeltext{inf}}
57\definemathcommand [injlim]  [limop] {\mfunctionlabeltext{injlim}}
58\definemathcommand [ker]     [nolop] {\mfunctionlabeltext{ker}}
59\definemathcommand [lg]      [nolop] {\mfunctionlabeltext{lg}}
60\definemathcommand [liminf]  [limop] {\mfunctionlabeltext{liminf}}
61\definemathcommand [limsup]  [limop] {\mfunctionlabeltext{limsup}}
62\definemathcommand [lim]     [limop] {\mfunctionlabeltext{lim}}
63\definemathcommand [ln]      [nolop] {\mfunctionlabeltext{ln}}
64\definemathcommand [log]     [nolop] {\mfunctionlabeltext{log}}
65\definemathcommand [median]  [limop] {\mfunctionlabeltext{median}}
66\definemathcommand [max]     [limop] {\mfunctionlabeltext{max}}
67\definemathcommand [min]     [limop] {\mfunctionlabeltext{min}}
68\definemathcommand [mod]     [limop] {\mfunctionlabeltext{mod}}
69%definemathcommand [div]     [limop] {\mfunctionlabeltext{div}}      % overloads \div symbol
70\definemathcommand [projlim] [limop] {\mfunctionlabeltext{projlim}}
71\definemathcommand [Pr]      [limop] {\mfunctionlabeltext{Pr}}
72\definemathcommand [sec]     [nolop] {\mfunctionlabeltext{sec}}
73\definemathcommand [sinh]    [nolop] {\mfunctionlabeltext{sinh}}
74\definemathcommand [sin]     [nolop] {\mfunctionlabeltext{sin}}
75\definemathcommand [sup]     [limop] {\mfunctionlabeltext{sup}}
76\definemathcommand [tanh]    [nolop] {\mfunctionlabeltext{tanh}}
77\definemathcommand [tan]     [nolop] {\mfunctionlabeltext{tan}}
78\definemathcommand [diff]            {\mfunctionlabeltext{diff}}
79
80\let\normalmatharg\arg % todo: maybe automatically
81
82%D This needs checking:
83
84\unexpanded\def\setoperatorlimits#1#2% operator limits
85  {\savenormalmeaning{#1}%
86   \expandafter\def\expandafter#1\expandafter{\csname normal\csstring#1\endcsname#2}}
87
88\pushoverloadmode
89
90\setoperatorlimits \int              \intlimits
91\setoperatorlimits \iint             \intlimits
92\setoperatorlimits \iiint            \intlimits
93\setoperatorlimits \oint             \intlimits
94\setoperatorlimits \oiint            \intlimits
95\setoperatorlimits \oiiint           \intlimits
96\setoperatorlimits \intclockwise     \intlimits
97\setoperatorlimits \ointclockwise    \intlimits
98\setoperatorlimits \ointctrclockwise \intlimits
99
100\popoverloadmode
101
102%D \macros
103%D   {centercolon, colonminus, minuscolon, colonequals, equalscolon,
104%D    colonapprox, approxcolon, colonsim, simcolon, coloncolon,
105%D    coloncolonminus, minuscoloncolon, coloncolonequals,
106%D    equalscoloncolon, coloncolonapprox, approxcoloncolon,
107%D    colonsim, simcoloncolon}
108%D
109%D The following colon related definitions are provided by Aditya
110%D Mahajan who derived them from \type {mathtools.sty} and \type
111%D {colonequals.sty}. This will be redone as part of the overhaul
112%D and font updates.
113%D
114%D In $a := b$ the colon is not vertically centered with the equal
115%D to. Also the distance between colon and equal to is a bit large.
116%D So, we define a vertically centered colon \tex {centercolon} and
117%D a few macros for colon and double colon relation symbols.
118%D
119%D \startlines
120%D \formula {A \centercolon       B}
121%D \formula {A \colonminus        B}
122%D \formula {A \minuscolon        B}
123%D \formula {A \colonequals       B}
124%D \formula {A \equalscolon       B}
125%D \formula {A \colonapprox       B}
126%D \formula {A \approxcolon       B}
127%D \formula {A \colonsim          B}
128%D \formula {A \simcolon          B}
129%D \formula {A \coloncolon        B}
130%D \formula {A \coloncolonminus   B}
131%D \formula {A \minuscoloncolon   B}
132%D \formula {A \coloncolonequals  B}
133%D \formula {A \equalscoloncolon  B}
134%D \formula {A \coloncolonapprox  B}
135%D \formula {A \approxcoloncolon  B}
136%D \formula {A \colonsim          B}
137%D \formula {A \simcoloncolon     B}
138%D \stoplines
139%D
140%D The next macros take care of the space between the colon and the
141%D relation symbol.
142
143\pushoverloadmode
144
145\definemathcommand  [colonsep]        {\mkern-1.2mu}
146\definemathcommand  [doublecolonsep]  {\mkern-0.9mu}
147
148\definemathcommand [centercolon]      [rel] {\mathstylevcenteredhbox\colon}
149\definemathcommand [colonminus]       [rel] {\centercolon\colonsep\mathrel{-}}
150%definemathcommand [minuscolon]       [rel] {\mathrel{-}\colonsep\centercolon} % native char
151%definemathcommand [colonequals]      [rel] {\centercolon\colonsep=}           % native char
152%definemathcommand [equalscolon]      [rel] {=\centercolon\colonsep}           % native char
153\definemathcommand [colonapprox]      [rel] {\centercolon\colonsep\approx}
154\definemathcommand [approxcolon]      [rel] {\approx\centercolon\colonsep}
155\definemathcommand [colonsim]         [rel] {\centercolon\colonsep\sim}
156\definemathcommand [simcolon]         [rel] {\sim\centercolon\colonsep}
157
158\definemathcommand [coloncolon]       [rel] {\centercolon\doublecolonsep\centercolon}
159\definemathcommand [coloncolonminus]  [rel] {\coloncolon\colonsep\mathrel{-}}
160\definemathcommand [minuscoloncolon]  [rel] {\mathrel{-}\colonsep\coloncolon}
161\definemathcommand [coloncolonequals] [rel] {\coloncolon\colonsep=}            % native char
162\definemathcommand [equalscoloncolon] [rel] {=\coloncolon\colonsep}
163\definemathcommand [coloncolonapprox] [rel] {\coloncolon\colonsep\approx}
164\definemathcommand [approxcoloncolon] [rel] {\approx\coloncolon\colonsep}
165\definemathcommand [coloncolonsim]    [rel] {\coloncolon\colonsep\sim}
166\definemathcommand [simcoloncolon]    [rel] {\sim\coloncolon\colonsep}
167
168\popoverloadmode
169
170% \appendtoks
171%     \def\over{\primitive\over}%
172% \to \everymathematics
173
174\protect \endinput
175