summaryrefslogtreecommitdiff
path: root/tex/context/base/x-newmmo.mkii
blob: 97fdeb06c0ba1e6a9ea19f5d06ec0e8de2c320f1 (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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
%D \module
%D   [       file=x-newmmo,
%D        version=2006.05.17,
%D          title=\CONTEXT\ XML Macros,
%D       subtitle=MathML Renderer/Open Math Extensions,
%D         author=Hans Hagen,
%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.

%D Strange things, why not mapped onto normal content MathML and/or
%D onto processing instructions.

\unprotect

%D \startbuffer
%D <math xmlns="http://www.w3.org/1998/Math/MathML">
%D     <vector>
%D         <apply>
%D             <csymbol definitionURL="http://www.openmath.org/cd/nums1#rational"/>
%D             <ci>a</ci>
%D             <cn type="integer">2</cn>
%D         </apply>
%D         <ci>a</ci>
%D     </vector>
%D </math>
%D \stopbuffer
%D
%D \typebuffer \processXMLbuffer

\startsetups mmc:csymbol:http://www.openmath.org/cd/nums1\letterhash rational
    \MMLcreset
    \getXMLstackdata\plustwo/\getXMLstackdata\plusthree
\stopsetups

%D \startbuffer
%D <math xmlns="http://www.w3.org/1998/Math/MathML">
%D     <apply>
%D         <csymbol definitionURL="http://www.openmath.org/cd/math4all#diffquot"/>
%D         <ci>y</ci>
%D         <ci>x</ci>
%D     </apply>
%D </math>
%D \stopbuffer
%D
%D \typebuffer \processXMLbuffer

\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash diffquot
    \MMLcreset
    \frac {
        \Delta\getXMLstackdata\plustwo
    } {
        \Delta\getXMLstackdata\plusthree
    }
\stopsetups

%D \startbuffer
%D <math xmlns="http://www.w3.org/1998/Math/MathML">
%D     <apply>
%D         <csymbol definitionURL="http://www.openmath.org/cd/math4all#difference"/>
%D         <ci>y</ci>
%D     </apply>
%D </math>
%D \stopbuffer
%D
%D \typebuffer \processXMLbuffer
%D
%D \startbuffer
%D <math xmlns="http://www.w3.org/1998/Math/MathML">
%D     <apply>
%D         <csymbol definitionURL="http://www.openmath.org/cd/math4all#difference"/>
%D         <apply>
%D             <eq/>
%D             <ci>y</ci>
%D             <apply>
%D                 <minus/>
%D                 <apply>
%D                     <ci>f</ci>
%D                     <ci>x</ci>
%D                 </apply>
%D                 <apply>
%D                     <ci>f</ci>
%D                 <apply>
%D                     <minus/>
%D                     <ci>x</ci>
%D                     <cn type="integer">1</cn>
%D                 </apply>
%D             </apply>
%D         </apply>
%D     </apply>
%D </apply>
%D </math>
%D \stopbuffer
%D
%D \typebuffer \processXMLbuffer

\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash difference
    \MMLcreset
    \Delta\getXMLstackdata\plustwo
\stopsetups

%D \startbuffer
%D <math xmlns="http://www.w3.org/1998/Math/MathML">
%D     <apply>
%D         <csymbol definitionURL="http://www.openmath.org/cd/math4all#diff"/>
%D         <ci>s</ci>
%D         <ci>t</ci>
%D     </apply>
%D </math>
%D \stopbuffer
%D
%D \typebuffer \processXMLbuffer

\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash diff
    \MMLcreset
    \frac {
        \mfunction{\getXMLentity{mathematicald}}\getXMLstackdata\plustwo
    } {
        \mfunction{\getXMLentity{mathematicald}}\getXMLstackdata\plusthree
    }
\stopsetups

%D A unit mess.

\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_time1@second        {\mr s}\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_time1@minute        {\mr m}\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_time1@hour          {\mr h}\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_time1@day           {\mr d}\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_time1@week          {\mr w}\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_time1@month         {\mr m}\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_time1@year          {\mr y}\stopsetups

\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_metric1@meter       {\mr m}\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_metric1@gram        {\mr g}\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_metric1@liter       {\mr l}\stopsetups

\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_metric1@watt        {\mr W}\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_metric1@pascal      {\mr P}\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_metric1@kelvin      {\mr K}\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_metric1@celsius     {\mr C}\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_metric1@newton      {\mr N}\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_metric1@byte        {\mr B}\stopsetups

\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_siprefix1@pico  {\mr p}\getXMLstackdata\plustwo\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_siprefix1@micro     \mu\getXMLstackdata\plustwo\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_siprefix1@milli {\mr m}\getXMLstackdata\plustwo\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_siprefix1@centi {\mr c}\getXMLstackdata\plustwo\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_siprefix1@deci  {\mr d}\getXMLstackdata\plustwo\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_siprefix1@deca  {\mr d}\getXMLstackdata\plustwo\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_siprefix1@hecto {\mr h}\getXMLstackdata\plustwo\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_siprefix1@kilo  {\mr k}\getXMLstackdata\plustwo\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_siprefix1@mega  {\mr m}\getXMLstackdata\plustwo\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_siprefix1@giga  {\mr g}\getXMLstackdata\plustwo\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_siprefix1@tera  {\mr t}\getXMLstackdata\plustwo\stopsetups

\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash procent   \procent\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash promille \promille\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash degree      ^\circ\stopsetups

% whatever

\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash triangle
    \Delta\,
\stopsetups

% crap

\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_metric1@degree_celsius
    \directsetup{mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_metric1@celsius}
\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_metric1@degree_kelvin
    \directsetup{mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_metric1@kelvin}
\stopsetups

\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_metric1@metre
    \directsetup{mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_metric1@meter}
\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_metric1@gramme
    \directsetup{mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_metric1@gram}
\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_metric1@litre
    \directsetup{mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_metric1@liter}
\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_time1@calendar_month
    \directsetup{mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_time1@month}
\stopsetups
\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_time1@calendar_year
    \directsetup{mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash units_time1@year}
\stopsetups

\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash degree_angle
    \directsetup{mmc:csymbol:http://www.openmath.org/cd/mathadore\letterhash degree}
\stopsetups

\defineXMLargument
    [ci]
    {\checkMMLciSYMBOL}

\def\checkMMLciSYMBOL#1%
   {\defconvertedargument\ascii{#1}%
    \executeifdefined{ci:symbol:crap:\ascii}{#1}}

\setvalue{ci:symbol:crap:alpha}{\alpha}
\setvalue{ci:symbol:crap:beta}{\beta}
\setvalue{ci:symbol:crap:gamma}{\gamma}

\protect \endinput