added math templates
[lambda.git] / jsMath / extensions / AMSsymbols.js
1 /*
2  *  extensions/AMSsymbol.js
3  *  
4  *  Part of the jsMath package for mathematics on the web.
5  *
6  *  This file defines the macros needed to access the AMS symbol fonts
7  *  available in msam10 and msbm10.  You can activate it by calling
8  *  
9  *    jsMath.Extension.Require('AMSsymbols');
10  *  
11  *  once jsMath.js has been loaded.
12  *  
13  *  Note that you will need to install the msam10 and msbm10 fonts
14  *  that are available from the jsMath extra font page at
15  *  
16  *      http://www.math.union.edu/locate/jsMath/download/extra-fonts/
17  *  
18  *  in order to make this work in image mode.  Note that there is no
19  *  unicode fallback mode for these fonts at this time.
20  *  
21  *  ---------------------------------------------------------------------
22  *
23  *  Copyright 2006 by Davide P. Cervone
24  * 
25  *  Licensed under the Apache License, Version 2.0 (the "License");
26  *  you may not use this file except in compliance with the License.
27  *  You may obtain a copy of the License at
28  * 
29  *      http://www.apache.org/licenses/LICENSE-2.0
30  * 
31  *  Unless required by applicable law or agreed to in writing, software
32  *  distributed under the License is distributed on an "AS IS" BASIS,
33  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34  *  See the License for the specific language governing permissions and
35  *  limitations under the License.
36  */
37
38 /********************************************************************/
39
40
41 delete jsMath.Parser.prototype.macros['hbar'];
42 delete jsMath.Parser.prototype.macros['angle'];
43 delete jsMath.Parser.prototype.macros['rightleftharpoons'];
44
45 jsMath.Extension.MathChar("msam10",{
46   // Miscellaneous symbols
47   vartriangle:        [3,0x4D],
48   triangledown:       [0,0x4F],
49   square:             [0,0x03],
50   lozenge:            [0,0x06],
51   circledS:           [0,0x73],
52   angle:              [0,0x5C],
53   measuredangle:      [0,0x5D],
54   backprime:          [0,0x38],
55   blacktriangle:      [0,0x4E],
56   blacktriangledown:  [0,0x48],
57   blacksquare:        [0,0x04],
58   blacklozenge:       [0,0x07],
59   bigstar:            [0,0x46],
60   sphericalangle:     [0,0x5E],
61   complement:         [0,0x7B],
62
63   // Binary operators
64   dotplus:            [2,0x75],
65   Cap:                [2,0x65],
66   doublecap:          [2,0x65],
67   Cup:                [2,0x64],
68   doublecup:          [2,0x64],
69   barwedge:           [2,0x5A],
70   veebar:             [2,0x59],
71   doublebarwedge:     [2,0x5B],
72   boxminus:           [2,0x0C],
73   boxtimes:           [2,0x02],
74   boxdot:             [2,0x00],
75   boxplus:            [2,0x01],
76   leftthreetimes:     [2,0x68],
77   rightthreetimes:    [2,0x69],
78   curlywedge:         [2,0x66],
79   curlyvee:           [2,0x67],
80   circleddash:        [2,0x7F],
81   circledast:         [2,0x7E],
82   circledcirc:        [2,0x7D],
83   centerdot:          [2,0x05],
84   intercal:           [2,0x7C],
85
86   // Binary relations
87   leqq:               [3,0x35],
88   leqslant:           [3,0x36],
89   eqslantless:        [3,0x30],
90   lesssim:            [3,0x2E],
91   lessapprox:         [3,0x2F],
92   lll:                [3,0x6E],
93   llless:             [3,0x6E],
94   lessgtr:            [3,0x37],
95   lesseqgtr:          [3,0x51],
96   lesseqqgtr:         [3,0x53],
97   doteqdot:           [3,0x2B],
98   Doteq:              [3,0x2B],
99   risingdotseq:       [3,0x3A],
100   fallingdotseq:      [3,0x3B],
101   backsim:            [3,0x76],
102   backsimeq:          [3,0x77],
103   subseteqq:          [3,0x6A],
104   Subset:             [3,0x62],
105   sqsubset:           [3,0x40],
106   preccurlyeq:        [3,0x34],
107   curlyeqprec:        [3,0x32],
108   precsim:            [3,0x2D],
109   vartriangleleft:    [3,0x43],
110   trianglelefteq:     [3,0x45],
111   vDash:              [3,0x0F],
112   Vvdash:             [3,0x0E],
113   smallsmile:         [3,0x60],
114   smallfrown:         [3,0x61],
115   bumpeq:             [3,0x6C],
116   Bumpeq:             [3,0x6D],
117   varpropto:          [3,0x5F],
118   blacktriangleleft:  [3,0x4A],
119   therefore:          [3,0x29],
120   geqq:               [3,0x3D],
121   geqslant:           [3,0x3E],
122   eqslantgtr:         [3,0x31],
123   gtrsim:             [3,0x26],
124   gtrapprox:          [3,0x27],
125   ggg:                [3,0x6F],
126   gggtr:              [3,0x6F],
127   gtrless:            [3,0x3F],
128   gtreqless:          [3,0x52],
129   gtreqqless:         [3,0x54],
130   eqcirc:             [3,0x50],
131   circeq:             [3,0x24],
132   triangleq:          [3,0x2C],
133   supseteqq:          [3,0x6B],
134   Supset:             [3,0x63],
135   sqsupset:           [3,0x41],
136   succcurlyeq:        [3,0x3C],
137   curlyeqsucc:        [3,0x33],
138   succsim:            [3,0x25],
139   vartriangleright:   [3,0x42],
140   trianglerighteq:    [3,0x44],
141   Vdash:              [3,0x0D],
142   between:            [3,0x47],
143   pitchfork:          [3,0x74],
144   blacktriangleright: [3,0x49],
145   because:            [3,0x2A],
146
147   // Arrows
148   leftleftarrows:     [3,0x12],
149   leftrightarrows:    [3,0x1C],
150   Lleftarrow:         [3,0x57],
151   twoheadleftarrow:   [3,0x11],
152   leftarrowtail:      [3,0x1B],
153   looparrowleft:      [3,0x22],
154   leftrightharpoons:  [3,0x0B],
155   circlearrowleft:    [3,0x09],
156   Lsh:                [3,0x1E],
157   upuparrows:         [3,0x14],
158   upharpoonleft:      [3,0x18],
159   downharpoonleft:    [3,0x19],
160   multimap:           [3,0x28],
161   leftrightsquigarrow:[3,0x21],
162   rightrightarrows:   [3,0x13],
163   rightleftarrows:    [3,0x1D],
164   Rrightarrow:        [3,0x56],
165   twoheadrightarrow:  [3,0x10],
166   rightarrowtail:     [3,0x1A],
167   looparrowright:     [3,0x23],
168   rightleftharpoons:  [3,0x0A],
169   circlearrowright:   [3,0x08],
170   Rsh:                [3,0x1F],
171   downdownarrows:     [3,0x15],
172   upharpoonright:     [3,0x16],
173   downharpoonright:   [3,0x17],
174   rightsquigarrow:    [3,0x20]
175 });
176
177 jsMath.Extension.MathChar("msbm10",{
178   // Lowercase Greek letters
179   digamma:            [0,0x7A],
180   varkappa:           [0,0x7B],
181
182   // Hebrew letters
183   beth:               [0,0x69],
184   daleth:             [0,0x6B],
185   gimel:              [0,0x6A],
186
187   // Miscellaneous symbols
188   hbar:               [0,0x7E],
189   hslash:             [0,0x7D],
190   nexists:            [0,0x40],
191   mho:                [0,0x66],
192   Finv:               [0,0x60],
193   Game:               [0,0x61],
194   Bbbk:               [0,0x7C],
195   varnothing:         [0,0x3F],
196   eth:                [0,0x67],
197   diagup:             [0,0x1E],
198   diagdown:           [0,0x1F],
199
200   // Binary operators
201   smallsetminus:      [2,0x72],
202   divideontimes:      [2,0x3E],
203   ltimes:             [2,0x6E],
204   rtimes:             [2,0x6F],
205
206   // Binary relations
207   approxeq:           [3,0x75],
208   lessdot:            [3,0x6C],
209   precapprox:         [3,0x77],
210   gtrdot:             [3,0x6D],
211   thicksim:           [3,0x73],
212   thickapprox:        [3,0x74],
213   succapprox:         [3,0x76],
214   shortmid:           [3,0x70],
215   shortparallel:      [3,0x71],
216   backepsilon:        [3,0x7F],
217
218   // Negated relations
219   nless:              [3,0x04],
220   nleq:               [3,0x02],
221   nleqslant:          [3,0x0A],
222   nleqq:              [3,0x14],
223   lneq:               [3,0x0C],
224   lneqq:              [3,0x08],
225   lvertneqq:          [3,0x00],
226   lnsim:              [3,0x12],
227   lnapprox:           [3,0x1A],
228   nprec:              [3,0x06],
229   npreceq:            [3,0x0E],
230   precneqq:           [3,0x16],
231   precnsim:           [3,0x10],
232   precnapprox:        [3,0x18],
233   nsim:               [3,0x1C],
234   nshortmid:          [3,0x2E],
235   nmid:               [3,0x2D],
236   nvdash:             [3,0x30],
237   nVdash:             [3,0x31],
238   ntriangleleft:      [3,0x36],
239   ntrianglelefteq:    [3,0x35],
240   nsubseteq:          [3,0x2A],
241   nsubseteqq:         [3,0x22],
242   subsetneq:          [3,0x28],
243   varsubsetneq:       [3,0x20],
244   subsetneqq:         [3,0x24],
245   varsubsetneqq:      [3,0x26],
246   ngtr:               [3,0x05],
247   ngeq:               [3,0x03],
248   ngeqslant:          [3,0x0B],
249   ngeqq:              [3,0x15],
250   gneq:               [3,0x0D],
251   gneqq:              [3,0x09],
252   gvertneqq:          [3,0x01],
253   gnsim:              [3,0x13],
254   gnapprox:           [3,0x1B],
255   nsucc:              [3,0x07],
256   nsucceq:            [3,0x0F],
257   succneqq:           [3,0x17],
258   succnsim:           [3,0x11],
259   succnapprox:        [3,0x19],
260   ncong:              [3,0x1D],
261   nshortparallel:     [3,0x2F],
262   nparallel:          [3,0x2C],
263   nvDash:             [3,0x32],
264   nVDash:             [3,0x33],
265   ntriangleright:     [3,0x37],
266   ntrianglerighteq:   [3,0x34],
267   nsupseteq:          [3,0x2B],
268   nsupseteqq:         [3,0x23],
269   supsetneq:          [3,0x29],
270   varsupsetneq:       [3,0x21],
271   supsetneqq:         [3,0x25],
272   varsupsetneqq:      [3,0x27],
273
274   // Arrows
275   curvearrowleft:     [3,0x78],
276   curvearrowright:    [3,0x79],
277
278   // Negated arrows
279   nleftarrow:         [3,0x38],
280   nLeftarrow:         [3,0x3A],
281   nleftrightarrow:    [3,0x3D],
282   nrightarrow:        [3,0x39],
283   nRightarrow:        [3,0x3B],
284   nLeftrightarrow:    [3,0x3C]
285 });
286
287 jsMath.Macro('Bbb','{\\msbm #1}',1);
288 jsMath.Macro('mathbb','{\\msbm #1}',1);
289 jsMath.Extension.Font('msbm');
290 jsMath.Extension.Font('msam');