summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/math-def.mkiv
blob: 8247ac008493a58e8085a453643198a6b7c5f35f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
%D \module
%D   [       file=math-tex,
%D        version=2001.04.12,
%D          title=\CONTEXT\ Math Macros,
%D       subtitle=Definitions,
%D         author={Hans Hagen, Taco Hoekwater \& Aditya Mahajan},
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\writestatus{loading}{ConTeXt Math Macros / Definitions}

\unprotect

%D Some day this will be done at the lua end.

\startluacode
    mathematics.define(\number\defaultmathfamily)
 -- mathematics.xml.registerentities()
\stopluacode

\activatemathcharacters

%D The \mfunction macro is an alternative for \hbox with a controlable font
%D switch.

\definemathcommand [arccos]  [nolop] {\mfunctionlabeltext{arccos}}
\definemathcommand [arcsin]  [nolop] {\mfunctionlabeltext{arcsin}}
\definemathcommand [arctan]  [nolop] {\mfunctionlabeltext{arctan}}
\definemathcommand [acos]    [nolop] {\mfunctionlabeltext{acos}}
\definemathcommand [asin]    [nolop] {\mfunctionlabeltext{asin}}
\definemathcommand [atan]    [nolop] {\mfunctionlabeltext{atan}}
\definemathcommand [arg]     [nolop] {\mfunctionlabeltext{arg}}
\definemathcommand [cosh]    [nolop] {\mfunctionlabeltext{cosh}}
\definemathcommand [cos]     [nolop] {\mfunctionlabeltext{cos}}
\definemathcommand [coth]    [nolop] {\mfunctionlabeltext{coth}}
\definemathcommand [cot]     [nolop] {\mfunctionlabeltext{cot}}
\definemathcommand [csc]     [nolop] {\mfunctionlabeltext{csc}}
\definemathcommand [deg]     [nolop] {\mfunctionlabeltext{deg}}
\definemathcommand [det]     [limop] {\mfunctionlabeltext{det}}
\definemathcommand [dim]     [nolop] {\mfunctionlabeltext{dim}}
\definemathcommand [exp]     [nolop] {\mfunctionlabeltext{exp}}
\definemathcommand [gcd]     [limop] {\mfunctionlabeltext{gcd}}
\definemathcommand [hom]     [nolop] {\mfunctionlabeltext{hom}}
\definemathcommand [inf]     [limop] {\mfunctionlabeltext{inf}}
\definemathcommand [injlim]  [limop] {\mfunctionlabeltext{injlim}}
\definemathcommand [ker]     [nolop] {\mfunctionlabeltext{ker}}
\definemathcommand [lg]      [nolop] {\mfunctionlabeltext{lg}}
\definemathcommand [liminf]  [limop] {\mfunctionlabeltext{liminf}}
\definemathcommand [limsup]  [limop] {\mfunctionlabeltext{limsup}}
\definemathcommand [lim]     [limop] {\mfunctionlabeltext{lim}}
\definemathcommand [ln]      [nolop] {\mfunctionlabeltext{ln}}
\definemathcommand [log]     [nolop] {\mfunctionlabeltext{log}}
\definemathcommand [median]  [limop] {\mfunctionlabeltext{median}}
\definemathcommand [max]     [limop] {\mfunctionlabeltext{max}}
\definemathcommand [min]     [limop] {\mfunctionlabeltext{min}}
\definemathcommand [mod]     [limop] {\mfunctionlabeltext{mod}}
%definemathcommand [div]     [limop] {\mfunctionlabeltext{div}}      % overloads \div symbol
\definemathcommand [projlim] [limop] {\mfunctionlabeltext{projlim}}
\definemathcommand [Pr]      [limop] {\mfunctionlabeltext{Pr}}
\definemathcommand [sec]     [nolop] {\mfunctionlabeltext{sec}}
\definemathcommand [sinh]    [nolop] {\mfunctionlabeltext{sinh}}
\definemathcommand [sin]     [nolop] {\mfunctionlabeltext{sin}}
\definemathcommand [sup]     [limop] {\mfunctionlabeltext{sup}}
\definemathcommand [tanh]    [nolop] {\mfunctionlabeltext{tanh}}
\definemathcommand [tan]     [nolop] {\mfunctionlabeltext{tan}}
\definemathcommand [diff]            {\mfunctionlabeltext{diff}}

\let\normalmatharg\arg % todo: maybe automatically

%D This needs checking:

\unexpanded\def\setoperatorlimits#1#2% operator limits
  {\savenormalmeaning{#1}%
   \expandafter\def\expandafter#1\expandafter{\csname normal\strippedcsname#1\endcsname#2}}

\setoperatorlimits \int              \intlimits
\setoperatorlimits \iint             \intlimits
\setoperatorlimits \iiint            \intlimits
\setoperatorlimits \oint             \intlimits
\setoperatorlimits \oiint            \intlimits
\setoperatorlimits \oiiint           \intlimits
\setoperatorlimits \intclockwise     \intlimits
\setoperatorlimits \ointclockwise    \intlimits
\setoperatorlimits \ointctrclockwise \intlimits

%D \macros
%D   {centercolon, colonminus, minuscolon, colonequals, equalscolon,
%D    colonapprox, approxcolon, colonsim, simcolon, coloncolon,
%D    coloncolonminus, minuscoloncolon, coloncolonequals,
%D    equalscoloncolon, coloncolonapprox, approxcoloncolon,
%D    colonsim, simcoloncolon}
%D
%D The following colon related definitions are provided by Aditya
%D Mahajan who derived them from \type {mathtools.sty} and \type
%D {colonequals.sty}. This will be redone as part of the overhaul
%D and font updates.
%D
%D In $a := b$ the colon is not vertically centered with the equal
%D to. Also the distance between colon and equal to is a bit large.
%D So, we define a vertically centered colon \tex {centercolon} and
%D a few macros for colon and double colon relation symbols.
%D
%D \startlines
%D \formula {A \centercolon       B}
%D \formula {A \colonminus        B}
%D \formula {A \minuscolon        B}
%D \formula {A \colonequals       B}
%D \formula {A \equalscolon       B}
%D \formula {A \colonapprox       B}
%D \formula {A \approxcolon       B}
%D \formula {A \colonsim          B}
%D \formula {A \simcolon          B}
%D \formula {A \coloncolon        B}
%D \formula {A \coloncolonminus   B}
%D \formula {A \minuscoloncolon   B}
%D \formula {A \coloncolonequals  B}
%D \formula {A \equalscoloncolon  B}
%D \formula {A \coloncolonapprox  B}
%D \formula {A \approxcoloncolon  B}
%D \formula {A \colonsim          B}
%D \formula {A \simcoloncolon     B}
%D \stoplines
%D
%D The next macros take care of the space between the colon and the
%D relation symbol.

\definemathcommand  [colonsep]        {\mkern-1.2mu}
\definemathcommand  [doublecolonsep]  {\mkern-0.9mu}

\definemathcommand [centercolon]      [rel] {\mathstylevcenteredhbox\colon}
\definemathcommand [colonminus]       [rel] {\centercolon\colonsep\mathrel{-}}
\definemathcommand [minuscolon]       [rel] {\mathrel{-}\colonsep\centercolon} % native char
\definemathcommand [colonequals]      [rel] {\centercolon\colonsep=}           % native char
\definemathcommand [equalscolon]      [rel] {=\centercolon\colonsep}           % native char
\definemathcommand [colonapprox]      [rel] {\centercolon\colonsep\approx}
\definemathcommand [approxcolon]      [rel] {\approx\centercolon\colonsep}
\definemathcommand [colonsim]         [rel] {\centercolon\colonsep\sim}
\definemathcommand [simcolon]         [rel] {\sim\centercolon\colonsep}

\definemathcommand [coloncolon]       [rel] {\centercolon\doublecolonsep\centercolon}
\definemathcommand [coloncolonminus]  [rel] {\coloncolon\colonsep\mathrel{-}}
\definemathcommand [minuscoloncolon]  [rel] {\mathrel{-}\colonsep\coloncolon}
\definemathcommand [coloncolonequals] [rel] {\coloncolon\colonsep=}            % native char
\definemathcommand [equalscoloncolon] [rel] {=\coloncolon\colonsep}
\definemathcommand [coloncolonapprox] [rel] {\coloncolon\colonsep\approx}
\definemathcommand [approxcoloncolon] [rel] {\approx\coloncolon\colonsep}
\definemathcommand [colonsim]         [rel] {\coloncolon\colonsep\sim}
\definemathcommand [simcoloncolon]    [rel] {\sim\coloncolon\colonsep}

% \appendtoks
%     \def\over{\primitive\over}%
% \to \everymathematics

\protect \endinput