www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

symbols.js (32089B)


      1 /**
      2  * This file holds a list of all no-argument functions and single-character
      3  * symbols (like 'a' or ';').
      4  *
      5  * For each of the symbols, there are three properties they can have:
      6  * - font (required): the font to be used for this symbol. Either "main" (the
      7      normal font), or "ams" (the ams fonts).
      8  * - group (required): the ParseNode group type the symbol should have (i.e.
      9      "textord", "mathord", etc).
     10      See https://github.com/Khan/KaTeX/wiki/Examining-TeX#group-types
     11  * - replace: the character that this symbol or function should be
     12  *   replaced with (i.e. "\phi" has a replace value of "\u03d5", the phi
     13  *   character in the main font).
     14  *
     15  * The outermost map in the table indicates what mode the symbols should be
     16  * accepted in (e.g. "math" or "text").
     17  */
     18 
     19 module.exports = {
     20     math: {},
     21     text: {},
     22 };
     23 
     24 function defineSymbol(mode, font, group, replace, name) {
     25     module.exports[mode][name] = {
     26         font: font,
     27         group: group,
     28         replace: replace,
     29     };
     30 }
     31 
     32 // Some abbreviations for commonly used strings.
     33 // This helps minify the code, and also spotting typos using jshint.
     34 
     35 // modes:
     36 const math = "math";
     37 const text = "text";
     38 
     39 // fonts:
     40 const main = "main";
     41 const ams = "ams";
     42 
     43 // groups:
     44 const accent = "accent";
     45 const bin = "bin";
     46 const close = "close";
     47 const inner = "inner";
     48 const mathord = "mathord";
     49 const op = "op";
     50 const open = "open";
     51 const punct = "punct";
     52 const rel = "rel";
     53 const spacing = "spacing";
     54 const textord = "textord";
     55 
     56 // Now comes the symbol table
     57 
     58 // Relation Symbols
     59 defineSymbol(math, main, rel, "\u2261", "\\equiv");
     60 defineSymbol(math, main, rel, "\u227a", "\\prec");
     61 defineSymbol(math, main, rel, "\u227b", "\\succ");
     62 defineSymbol(math, main, rel, "\u223c", "\\sim");
     63 defineSymbol(math, main, rel, "\u22a5", "\\perp");
     64 defineSymbol(math, main, rel, "\u2aaf", "\\preceq");
     65 defineSymbol(math, main, rel, "\u2ab0", "\\succeq");
     66 defineSymbol(math, main, rel, "\u2243", "\\simeq");
     67 defineSymbol(math, main, rel, "\u2223", "\\mid");
     68 defineSymbol(math, main, rel, "\u226a", "\\ll");
     69 defineSymbol(math, main, rel, "\u226b", "\\gg");
     70 defineSymbol(math, main, rel, "\u224d", "\\asymp");
     71 defineSymbol(math, main, rel, "\u2225", "\\parallel");
     72 defineSymbol(math, main, rel, "\u22c8", "\\bowtie");
     73 defineSymbol(math, main, rel, "\u2323", "\\smile");
     74 defineSymbol(math, main, rel, "\u2291", "\\sqsubseteq");
     75 defineSymbol(math, main, rel, "\u2292", "\\sqsupseteq");
     76 defineSymbol(math, main, rel, "\u2250", "\\doteq");
     77 defineSymbol(math, main, rel, "\u2322", "\\frown");
     78 defineSymbol(math, main, rel, "\u220b", "\\ni");
     79 defineSymbol(math, main, rel, "\u221d", "\\propto");
     80 defineSymbol(math, main, rel, "\u22a2", "\\vdash");
     81 defineSymbol(math, main, rel, "\u22a3", "\\dashv");
     82 defineSymbol(math, main, rel, "\u220b", "\\owns");
     83 
     84 // Punctuation
     85 defineSymbol(math, main, punct, "\u002e", "\\ldotp");
     86 defineSymbol(math, main, punct, "\u22c5", "\\cdotp");
     87 
     88 // Misc Symbols
     89 defineSymbol(math, main, textord, "\u0023", "\\#");
     90 defineSymbol(text, main, textord, "\u0023", "\\#");
     91 defineSymbol(math, main, textord, "\u0026", "\\&");
     92 defineSymbol(text, main, textord, "\u0026", "\\&");
     93 defineSymbol(math, main, textord, "\u2135", "\\aleph");
     94 defineSymbol(math, main, textord, "\u2200", "\\forall");
     95 defineSymbol(math, main, textord, "\u210f", "\\hbar");
     96 defineSymbol(math, main, textord, "\u2203", "\\exists");
     97 defineSymbol(math, main, textord, "\u2207", "\\nabla");
     98 defineSymbol(math, main, textord, "\u266d", "\\flat");
     99 defineSymbol(math, main, textord, "\u2113", "\\ell");
    100 defineSymbol(math, main, textord, "\u266e", "\\natural");
    101 defineSymbol(math, main, textord, "\u2663", "\\clubsuit");
    102 defineSymbol(math, main, textord, "\u2118", "\\wp");
    103 defineSymbol(math, main, textord, "\u266f", "\\sharp");
    104 defineSymbol(math, main, textord, "\u2662", "\\diamondsuit");
    105 defineSymbol(math, main, textord, "\u211c", "\\Re");
    106 defineSymbol(math, main, textord, "\u2661", "\\heartsuit");
    107 defineSymbol(math, main, textord, "\u2111", "\\Im");
    108 defineSymbol(math, main, textord, "\u2660", "\\spadesuit");
    109 
    110 // Math and Text
    111 defineSymbol(math, main, textord, "\u2020", "\\dag");
    112 defineSymbol(math, main, textord, "\u2021", "\\ddag");
    113 
    114 // Large Delimiters
    115 defineSymbol(math, main, close, "\u23b1", "\\rmoustache");
    116 defineSymbol(math, main, open, "\u23b0", "\\lmoustache");
    117 defineSymbol(math, main, close, "\u27ef", "\\rgroup");
    118 defineSymbol(math, main, open, "\u27ee", "\\lgroup");
    119 
    120 // Binary Operators
    121 defineSymbol(math, main, bin, "\u2213", "\\mp");
    122 defineSymbol(math, main, bin, "\u2296", "\\ominus");
    123 defineSymbol(math, main, bin, "\u228e", "\\uplus");
    124 defineSymbol(math, main, bin, "\u2293", "\\sqcap");
    125 defineSymbol(math, main, bin, "\u2217", "\\ast");
    126 defineSymbol(math, main, bin, "\u2294", "\\sqcup");
    127 defineSymbol(math, main, bin, "\u25ef", "\\bigcirc");
    128 defineSymbol(math, main, bin, "\u2219", "\\bullet");
    129 defineSymbol(math, main, bin, "\u2021", "\\ddagger");
    130 defineSymbol(math, main, bin, "\u2240", "\\wr");
    131 defineSymbol(math, main, bin, "\u2a3f", "\\amalg");
    132 
    133 // Arrow Symbols
    134 defineSymbol(math, main, rel, "\u27f5", "\\longleftarrow");
    135 defineSymbol(math, main, rel, "\u21d0", "\\Leftarrow");
    136 defineSymbol(math, main, rel, "\u27f8", "\\Longleftarrow");
    137 defineSymbol(math, main, rel, "\u27f6", "\\longrightarrow");
    138 defineSymbol(math, main, rel, "\u21d2", "\\Rightarrow");
    139 defineSymbol(math, main, rel, "\u27f9", "\\Longrightarrow");
    140 defineSymbol(math, main, rel, "\u2194", "\\leftrightarrow");
    141 defineSymbol(math, main, rel, "\u27f7", "\\longleftrightarrow");
    142 defineSymbol(math, main, rel, "\u21d4", "\\Leftrightarrow");
    143 defineSymbol(math, main, rel, "\u27fa", "\\Longleftrightarrow");
    144 defineSymbol(math, main, rel, "\u21a6", "\\mapsto");
    145 defineSymbol(math, main, rel, "\u27fc", "\\longmapsto");
    146 defineSymbol(math, main, rel, "\u2197", "\\nearrow");
    147 defineSymbol(math, main, rel, "\u21a9", "\\hookleftarrow");
    148 defineSymbol(math, main, rel, "\u21aa", "\\hookrightarrow");
    149 defineSymbol(math, main, rel, "\u2198", "\\searrow");
    150 defineSymbol(math, main, rel, "\u21bc", "\\leftharpoonup");
    151 defineSymbol(math, main, rel, "\u21c0", "\\rightharpoonup");
    152 defineSymbol(math, main, rel, "\u2199", "\\swarrow");
    153 defineSymbol(math, main, rel, "\u21bd", "\\leftharpoondown");
    154 defineSymbol(math, main, rel, "\u21c1", "\\rightharpoondown");
    155 defineSymbol(math, main, rel, "\u2196", "\\nwarrow");
    156 defineSymbol(math, main, rel, "\u21cc", "\\rightleftharpoons");
    157 
    158 // AMS Negated Binary Relations
    159 defineSymbol(math, ams, rel, "\u226e", "\\nless");
    160 defineSymbol(math, ams, rel, "\ue010", "\\nleqslant");
    161 defineSymbol(math, ams, rel, "\ue011", "\\nleqq");
    162 defineSymbol(math, ams, rel, "\u2a87", "\\lneq");
    163 defineSymbol(math, ams, rel, "\u2268", "\\lneqq");
    164 defineSymbol(math, ams, rel, "\ue00c", "\\lvertneqq");
    165 defineSymbol(math, ams, rel, "\u22e6", "\\lnsim");
    166 defineSymbol(math, ams, rel, "\u2a89", "\\lnapprox");
    167 defineSymbol(math, ams, rel, "\u2280", "\\nprec");
    168 defineSymbol(math, ams, rel, "\u22e0", "\\npreceq");
    169 defineSymbol(math, ams, rel, "\u22e8", "\\precnsim");
    170 defineSymbol(math, ams, rel, "\u2ab9", "\\precnapprox");
    171 defineSymbol(math, ams, rel, "\u2241", "\\nsim");
    172 defineSymbol(math, ams, rel, "\ue006", "\\nshortmid");
    173 defineSymbol(math, ams, rel, "\u2224", "\\nmid");
    174 defineSymbol(math, ams, rel, "\u22ac", "\\nvdash");
    175 defineSymbol(math, ams, rel, "\u22ad", "\\nvDash");
    176 defineSymbol(math, ams, rel, "\u22ea", "\\ntriangleleft");
    177 defineSymbol(math, ams, rel, "\u22ec", "\\ntrianglelefteq");
    178 defineSymbol(math, ams, rel, "\u228a", "\\subsetneq");
    179 defineSymbol(math, ams, rel, "\ue01a", "\\varsubsetneq");
    180 defineSymbol(math, ams, rel, "\u2acb", "\\subsetneqq");
    181 defineSymbol(math, ams, rel, "\ue017", "\\varsubsetneqq");
    182 defineSymbol(math, ams, rel, "\u226f", "\\ngtr");
    183 defineSymbol(math, ams, rel, "\ue00f", "\\ngeqslant");
    184 defineSymbol(math, ams, rel, "\ue00e", "\\ngeqq");
    185 defineSymbol(math, ams, rel, "\u2a88", "\\gneq");
    186 defineSymbol(math, ams, rel, "\u2269", "\\gneqq");
    187 defineSymbol(math, ams, rel, "\ue00d", "\\gvertneqq");
    188 defineSymbol(math, ams, rel, "\u22e7", "\\gnsim");
    189 defineSymbol(math, ams, rel, "\u2a8a", "\\gnapprox");
    190 defineSymbol(math, ams, rel, "\u2281", "\\nsucc");
    191 defineSymbol(math, ams, rel, "\u22e1", "\\nsucceq");
    192 defineSymbol(math, ams, rel, "\u22e9", "\\succnsim");
    193 defineSymbol(math, ams, rel, "\u2aba", "\\succnapprox");
    194 defineSymbol(math, ams, rel, "\u2246", "\\ncong");
    195 defineSymbol(math, ams, rel, "\ue007", "\\nshortparallel");
    196 defineSymbol(math, ams, rel, "\u2226", "\\nparallel");
    197 defineSymbol(math, ams, rel, "\u22af", "\\nVDash");
    198 defineSymbol(math, ams, rel, "\u22eb", "\\ntriangleright");
    199 defineSymbol(math, ams, rel, "\u22ed", "\\ntrianglerighteq");
    200 defineSymbol(math, ams, rel, "\ue018", "\\nsupseteqq");
    201 defineSymbol(math, ams, rel, "\u228b", "\\supsetneq");
    202 defineSymbol(math, ams, rel, "\ue01b", "\\varsupsetneq");
    203 defineSymbol(math, ams, rel, "\u2acc", "\\supsetneqq");
    204 defineSymbol(math, ams, rel, "\ue019", "\\varsupsetneqq");
    205 defineSymbol(math, ams, rel, "\u22ae", "\\nVdash");
    206 defineSymbol(math, ams, rel, "\u2ab5", "\\precneqq");
    207 defineSymbol(math, ams, rel, "\u2ab6", "\\succneqq");
    208 defineSymbol(math, ams, rel, "\ue016", "\\nsubseteqq");
    209 defineSymbol(math, ams, bin, "\u22b4", "\\unlhd");
    210 defineSymbol(math, ams, bin, "\u22b5", "\\unrhd");
    211 
    212 // AMS Negated Arrows
    213 defineSymbol(math, ams, rel, "\u219a", "\\nleftarrow");
    214 defineSymbol(math, ams, rel, "\u219b", "\\nrightarrow");
    215 defineSymbol(math, ams, rel, "\u21cd", "\\nLeftarrow");
    216 defineSymbol(math, ams, rel, "\u21cf", "\\nRightarrow");
    217 defineSymbol(math, ams, rel, "\u21ae", "\\nleftrightarrow");
    218 defineSymbol(math, ams, rel, "\u21ce", "\\nLeftrightarrow");
    219 
    220 // AMS Misc
    221 defineSymbol(math, ams, rel, "\u25b3", "\\vartriangle");
    222 defineSymbol(math, ams, textord, "\u210f", "\\hslash");
    223 defineSymbol(math, ams, textord, "\u25bd", "\\triangledown");
    224 defineSymbol(math, ams, textord, "\u25ca", "\\lozenge");
    225 defineSymbol(math, ams, textord, "\u24c8", "\\circledS");
    226 defineSymbol(math, ams, textord, "\u00ae", "\\circledR");
    227 defineSymbol(math, ams, textord, "\u2221", "\\measuredangle");
    228 defineSymbol(math, ams, textord, "\u2204", "\\nexists");
    229 defineSymbol(math, ams, textord, "\u2127", "\\mho");
    230 defineSymbol(math, ams, textord, "\u2132", "\\Finv");
    231 defineSymbol(math, ams, textord, "\u2141", "\\Game");
    232 defineSymbol(math, ams, textord, "\u006b", "\\Bbbk");
    233 defineSymbol(math, ams, textord, "\u2035", "\\backprime");
    234 defineSymbol(math, ams, textord, "\u25b2", "\\blacktriangle");
    235 defineSymbol(math, ams, textord, "\u25bc", "\\blacktriangledown");
    236 defineSymbol(math, ams, textord, "\u25a0", "\\blacksquare");
    237 defineSymbol(math, ams, textord, "\u29eb", "\\blacklozenge");
    238 defineSymbol(math, ams, textord, "\u2605", "\\bigstar");
    239 defineSymbol(math, ams, textord, "\u2222", "\\sphericalangle");
    240 defineSymbol(math, ams, textord, "\u2201", "\\complement");
    241 defineSymbol(math, ams, textord, "\u00f0", "\\eth");
    242 defineSymbol(math, ams, textord, "\u2571", "\\diagup");
    243 defineSymbol(math, ams, textord, "\u2572", "\\diagdown");
    244 defineSymbol(math, ams, textord, "\u25a1", "\\square");
    245 defineSymbol(math, ams, textord, "\u25a1", "\\Box");
    246 defineSymbol(math, ams, textord, "\u25ca", "\\Diamond");
    247 defineSymbol(math, ams, textord, "\u00a5", "\\yen");
    248 defineSymbol(math, ams, textord, "\u2713", "\\checkmark");
    249 
    250 // AMS Hebrew
    251 defineSymbol(math, ams, textord, "\u2136", "\\beth");
    252 defineSymbol(math, ams, textord, "\u2138", "\\daleth");
    253 defineSymbol(math, ams, textord, "\u2137", "\\gimel");
    254 
    255 // AMS Greek
    256 defineSymbol(math, ams, textord, "\u03dd", "\\digamma");
    257 defineSymbol(math, ams, textord, "\u03f0", "\\varkappa");
    258 
    259 // AMS Delimiters
    260 defineSymbol(math, ams, open, "\u250c", "\\ulcorner");
    261 defineSymbol(math, ams, close, "\u2510", "\\urcorner");
    262 defineSymbol(math, ams, open, "\u2514", "\\llcorner");
    263 defineSymbol(math, ams, close, "\u2518", "\\lrcorner");
    264 
    265 // AMS Binary Relations
    266 defineSymbol(math, ams, rel, "\u2266", "\\leqq");
    267 defineSymbol(math, ams, rel, "\u2a7d", "\\leqslant");
    268 defineSymbol(math, ams, rel, "\u2a95", "\\eqslantless");
    269 defineSymbol(math, ams, rel, "\u2272", "\\lesssim");
    270 defineSymbol(math, ams, rel, "\u2a85", "\\lessapprox");
    271 defineSymbol(math, ams, rel, "\u224a", "\\approxeq");
    272 defineSymbol(math, ams, bin, "\u22d6", "\\lessdot");
    273 defineSymbol(math, ams, rel, "\u22d8", "\\lll");
    274 defineSymbol(math, ams, rel, "\u2276", "\\lessgtr");
    275 defineSymbol(math, ams, rel, "\u22da", "\\lesseqgtr");
    276 defineSymbol(math, ams, rel, "\u2a8b", "\\lesseqqgtr");
    277 defineSymbol(math, ams, rel, "\u2251", "\\doteqdot");
    278 defineSymbol(math, ams, rel, "\u2253", "\\risingdotseq");
    279 defineSymbol(math, ams, rel, "\u2252", "\\fallingdotseq");
    280 defineSymbol(math, ams, rel, "\u223d", "\\backsim");
    281 defineSymbol(math, ams, rel, "\u22cd", "\\backsimeq");
    282 defineSymbol(math, ams, rel, "\u2ac5", "\\subseteqq");
    283 defineSymbol(math, ams, rel, "\u22d0", "\\Subset");
    284 defineSymbol(math, ams, rel, "\u228f", "\\sqsubset");
    285 defineSymbol(math, ams, rel, "\u227c", "\\preccurlyeq");
    286 defineSymbol(math, ams, rel, "\u22de", "\\curlyeqprec");
    287 defineSymbol(math, ams, rel, "\u227e", "\\precsim");
    288 defineSymbol(math, ams, rel, "\u2ab7", "\\precapprox");
    289 defineSymbol(math, ams, rel, "\u22b2", "\\vartriangleleft");
    290 defineSymbol(math, ams, rel, "\u22b4", "\\trianglelefteq");
    291 defineSymbol(math, ams, rel, "\u22a8", "\\vDash");
    292 defineSymbol(math, ams, rel, "\u22aa", "\\Vvdash");
    293 defineSymbol(math, ams, rel, "\u2323", "\\smallsmile");
    294 defineSymbol(math, ams, rel, "\u2322", "\\smallfrown");
    295 defineSymbol(math, ams, rel, "\u224f", "\\bumpeq");
    296 defineSymbol(math, ams, rel, "\u224e", "\\Bumpeq");
    297 defineSymbol(math, ams, rel, "\u2267", "\\geqq");
    298 defineSymbol(math, ams, rel, "\u2a7e", "\\geqslant");
    299 defineSymbol(math, ams, rel, "\u2a96", "\\eqslantgtr");
    300 defineSymbol(math, ams, rel, "\u2273", "\\gtrsim");
    301 defineSymbol(math, ams, rel, "\u2a86", "\\gtrapprox");
    302 defineSymbol(math, ams, bin, "\u22d7", "\\gtrdot");
    303 defineSymbol(math, ams, rel, "\u22d9", "\\ggg");
    304 defineSymbol(math, ams, rel, "\u2277", "\\gtrless");
    305 defineSymbol(math, ams, rel, "\u22db", "\\gtreqless");
    306 defineSymbol(math, ams, rel, "\u2a8c", "\\gtreqqless");
    307 defineSymbol(math, ams, rel, "\u2256", "\\eqcirc");
    308 defineSymbol(math, ams, rel, "\u2257", "\\circeq");
    309 defineSymbol(math, ams, rel, "\u225c", "\\triangleq");
    310 defineSymbol(math, ams, rel, "\u223c", "\\thicksim");
    311 defineSymbol(math, ams, rel, "\u2248", "\\thickapprox");
    312 defineSymbol(math, ams, rel, "\u2ac6", "\\supseteqq");
    313 defineSymbol(math, ams, rel, "\u22d1", "\\Supset");
    314 defineSymbol(math, ams, rel, "\u2290", "\\sqsupset");
    315 defineSymbol(math, ams, rel, "\u227d", "\\succcurlyeq");
    316 defineSymbol(math, ams, rel, "\u22df", "\\curlyeqsucc");
    317 defineSymbol(math, ams, rel, "\u227f", "\\succsim");
    318 defineSymbol(math, ams, rel, "\u2ab8", "\\succapprox");
    319 defineSymbol(math, ams, rel, "\u22b3", "\\vartriangleright");
    320 defineSymbol(math, ams, rel, "\u22b5", "\\trianglerighteq");
    321 defineSymbol(math, ams, rel, "\u22a9", "\\Vdash");
    322 defineSymbol(math, ams, rel, "\u2223", "\\shortmid");
    323 defineSymbol(math, ams, rel, "\u2225", "\\shortparallel");
    324 defineSymbol(math, ams, rel, "\u226c", "\\between");
    325 defineSymbol(math, ams, rel, "\u22d4", "\\pitchfork");
    326 defineSymbol(math, ams, rel, "\u221d", "\\varpropto");
    327 defineSymbol(math, ams, rel, "\u25c0", "\\blacktriangleleft");
    328 defineSymbol(math, ams, rel, "\u2234", "\\therefore");
    329 defineSymbol(math, ams, rel, "\u220d", "\\backepsilon");
    330 defineSymbol(math, ams, rel, "\u25b6", "\\blacktriangleright");
    331 defineSymbol(math, ams, rel, "\u2235", "\\because");
    332 defineSymbol(math, ams, rel, "\u22d8", "\\llless");
    333 defineSymbol(math, ams, rel, "\u22d9", "\\gggtr");
    334 defineSymbol(math, ams, bin, "\u22b2", "\\lhd");
    335 defineSymbol(math, ams, bin, "\u22b3", "\\rhd");
    336 defineSymbol(math, ams, rel, "\u2242", "\\eqsim");
    337 defineSymbol(math, main, rel, "\u22c8", "\\Join");
    338 defineSymbol(math, ams, rel, "\u2251", "\\Doteq");
    339 
    340 // AMS Binary Operators
    341 defineSymbol(math, ams, bin, "\u2214", "\\dotplus");
    342 defineSymbol(math, ams, bin, "\u2216", "\\smallsetminus");
    343 defineSymbol(math, ams, bin, "\u22d2", "\\Cap");
    344 defineSymbol(math, ams, bin, "\u22d3", "\\Cup");
    345 defineSymbol(math, ams, bin, "\u2a5e", "\\doublebarwedge");
    346 defineSymbol(math, ams, bin, "\u229f", "\\boxminus");
    347 defineSymbol(math, ams, bin, "\u229e", "\\boxplus");
    348 defineSymbol(math, ams, bin, "\u22c7", "\\divideontimes");
    349 defineSymbol(math, ams, bin, "\u22c9", "\\ltimes");
    350 defineSymbol(math, ams, bin, "\u22ca", "\\rtimes");
    351 defineSymbol(math, ams, bin, "\u22cb", "\\leftthreetimes");
    352 defineSymbol(math, ams, bin, "\u22cc", "\\rightthreetimes");
    353 defineSymbol(math, ams, bin, "\u22cf", "\\curlywedge");
    354 defineSymbol(math, ams, bin, "\u22ce", "\\curlyvee");
    355 defineSymbol(math, ams, bin, "\u229d", "\\circleddash");
    356 defineSymbol(math, ams, bin, "\u229b", "\\circledast");
    357 defineSymbol(math, ams, bin, "\u22c5", "\\centerdot");
    358 defineSymbol(math, ams, bin, "\u22ba", "\\intercal");
    359 defineSymbol(math, ams, bin, "\u22d2", "\\doublecap");
    360 defineSymbol(math, ams, bin, "\u22d3", "\\doublecup");
    361 defineSymbol(math, ams, bin, "\u22a0", "\\boxtimes");
    362 
    363 // AMS Arrows
    364 defineSymbol(math, ams, rel, "\u21e2", "\\dashrightarrow");
    365 defineSymbol(math, ams, rel, "\u21e0", "\\dashleftarrow");
    366 defineSymbol(math, ams, rel, "\u21c7", "\\leftleftarrows");
    367 defineSymbol(math, ams, rel, "\u21c6", "\\leftrightarrows");
    368 defineSymbol(math, ams, rel, "\u21da", "\\Lleftarrow");
    369 defineSymbol(math, ams, rel, "\u219e", "\\twoheadleftarrow");
    370 defineSymbol(math, ams, rel, "\u21a2", "\\leftarrowtail");
    371 defineSymbol(math, ams, rel, "\u21ab", "\\looparrowleft");
    372 defineSymbol(math, ams, rel, "\u21cb", "\\leftrightharpoons");
    373 defineSymbol(math, ams, rel, "\u21b6", "\\curvearrowleft");
    374 defineSymbol(math, ams, rel, "\u21ba", "\\circlearrowleft");
    375 defineSymbol(math, ams, rel, "\u21b0", "\\Lsh");
    376 defineSymbol(math, ams, rel, "\u21c8", "\\upuparrows");
    377 defineSymbol(math, ams, rel, "\u21bf", "\\upharpoonleft");
    378 defineSymbol(math, ams, rel, "\u21c3", "\\downharpoonleft");
    379 defineSymbol(math, ams, rel, "\u22b8", "\\multimap");
    380 defineSymbol(math, ams, rel, "\u21ad", "\\leftrightsquigarrow");
    381 defineSymbol(math, ams, rel, "\u21c9", "\\rightrightarrows");
    382 defineSymbol(math, ams, rel, "\u21c4", "\\rightleftarrows");
    383 defineSymbol(math, ams, rel, "\u21a0", "\\twoheadrightarrow");
    384 defineSymbol(math, ams, rel, "\u21a3", "\\rightarrowtail");
    385 defineSymbol(math, ams, rel, "\u21ac", "\\looparrowright");
    386 defineSymbol(math, ams, rel, "\u21b7", "\\curvearrowright");
    387 defineSymbol(math, ams, rel, "\u21bb", "\\circlearrowright");
    388 defineSymbol(math, ams, rel, "\u21b1", "\\Rsh");
    389 defineSymbol(math, ams, rel, "\u21ca", "\\downdownarrows");
    390 defineSymbol(math, ams, rel, "\u21be", "\\upharpoonright");
    391 defineSymbol(math, ams, rel, "\u21c2", "\\downharpoonright");
    392 defineSymbol(math, ams, rel, "\u21dd", "\\rightsquigarrow");
    393 defineSymbol(math, ams, rel, "\u21dd", "\\leadsto");
    394 defineSymbol(math, ams, rel, "\u21db", "\\Rrightarrow");
    395 defineSymbol(math, ams, rel, "\u21be", "\\restriction");
    396 
    397 defineSymbol(math, main, textord, "\u2018", "`");
    398 defineSymbol(math, main, textord, "$", "\\$");
    399 defineSymbol(text, main, textord, "$", "\\$");
    400 defineSymbol(math, main, textord, "%", "\\%");
    401 defineSymbol(text, main, textord, "%", "\\%");
    402 defineSymbol(math, main, textord, "_", "\\_");
    403 defineSymbol(text, main, textord, "_", "\\_");
    404 defineSymbol(math, main, textord, "\u2220", "\\angle");
    405 defineSymbol(math, main, textord, "\u221e", "\\infty");
    406 defineSymbol(math, main, textord, "\u2032", "\\prime");
    407 defineSymbol(math, main, textord, "\u25b3", "\\triangle");
    408 defineSymbol(math, main, textord, "\u0393", "\\Gamma");
    409 defineSymbol(math, main, textord, "\u0394", "\\Delta");
    410 defineSymbol(math, main, textord, "\u0398", "\\Theta");
    411 defineSymbol(math, main, textord, "\u039b", "\\Lambda");
    412 defineSymbol(math, main, textord, "\u039e", "\\Xi");
    413 defineSymbol(math, main, textord, "\u03a0", "\\Pi");
    414 defineSymbol(math, main, textord, "\u03a3", "\\Sigma");
    415 defineSymbol(math, main, textord, "\u03a5", "\\Upsilon");
    416 defineSymbol(math, main, textord, "\u03a6", "\\Phi");
    417 defineSymbol(math, main, textord, "\u03a8", "\\Psi");
    418 defineSymbol(math, main, textord, "\u03a9", "\\Omega");
    419 defineSymbol(math, main, textord, "\u00ac", "\\neg");
    420 defineSymbol(math, main, textord, "\u00ac", "\\lnot");
    421 defineSymbol(math, main, textord, "\u22a4", "\\top");
    422 defineSymbol(math, main, textord, "\u22a5", "\\bot");
    423 defineSymbol(math, main, textord, "\u2205", "\\emptyset");
    424 defineSymbol(math, ams, textord, "\u2205", "\\varnothing");
    425 defineSymbol(math, main, mathord, "\u03b1", "\\alpha");
    426 defineSymbol(math, main, mathord, "\u03b2", "\\beta");
    427 defineSymbol(math, main, mathord, "\u03b3", "\\gamma");
    428 defineSymbol(math, main, mathord, "\u03b4", "\\delta");
    429 defineSymbol(math, main, mathord, "\u03f5", "\\epsilon");
    430 defineSymbol(math, main, mathord, "\u03b6", "\\zeta");
    431 defineSymbol(math, main, mathord, "\u03b7", "\\eta");
    432 defineSymbol(math, main, mathord, "\u03b8", "\\theta");
    433 defineSymbol(math, main, mathord, "\u03b9", "\\iota");
    434 defineSymbol(math, main, mathord, "\u03ba", "\\kappa");
    435 defineSymbol(math, main, mathord, "\u03bb", "\\lambda");
    436 defineSymbol(math, main, mathord, "\u03bc", "\\mu");
    437 defineSymbol(math, main, mathord, "\u03bd", "\\nu");
    438 defineSymbol(math, main, mathord, "\u03be", "\\xi");
    439 defineSymbol(math, main, mathord, "o", "\\omicron");
    440 defineSymbol(math, main, mathord, "\u03c0", "\\pi");
    441 defineSymbol(math, main, mathord, "\u03c1", "\\rho");
    442 defineSymbol(math, main, mathord, "\u03c3", "\\sigma");
    443 defineSymbol(math, main, mathord, "\u03c4", "\\tau");
    444 defineSymbol(math, main, mathord, "\u03c5", "\\upsilon");
    445 defineSymbol(math, main, mathord, "\u03d5", "\\phi");
    446 defineSymbol(math, main, mathord, "\u03c7", "\\chi");
    447 defineSymbol(math, main, mathord, "\u03c8", "\\psi");
    448 defineSymbol(math, main, mathord, "\u03c9", "\\omega");
    449 defineSymbol(math, main, mathord, "\u03b5", "\\varepsilon");
    450 defineSymbol(math, main, mathord, "\u03d1", "\\vartheta");
    451 defineSymbol(math, main, mathord, "\u03d6", "\\varpi");
    452 defineSymbol(math, main, mathord, "\u03f1", "\\varrho");
    453 defineSymbol(math, main, mathord, "\u03c2", "\\varsigma");
    454 defineSymbol(math, main, mathord, "\u03c6", "\\varphi");
    455 defineSymbol(math, main, bin, "\u2217", "*");
    456 defineSymbol(math, main, bin, "+", "+");
    457 defineSymbol(math, main, bin, "\u2212", "-");
    458 defineSymbol(math, main, bin, "\u22c5", "\\cdot");
    459 defineSymbol(math, main, bin, "\u2218", "\\circ");
    460 defineSymbol(math, main, bin, "\u00f7", "\\div");
    461 defineSymbol(math, main, bin, "\u00b1", "\\pm");
    462 defineSymbol(math, main, bin, "\u00d7", "\\times");
    463 defineSymbol(math, main, bin, "\u2229", "\\cap");
    464 defineSymbol(math, main, bin, "\u222a", "\\cup");
    465 defineSymbol(math, main, bin, "\u2216", "\\setminus");
    466 defineSymbol(math, main, bin, "\u2227", "\\land");
    467 defineSymbol(math, main, bin, "\u2228", "\\lor");
    468 defineSymbol(math, main, bin, "\u2227", "\\wedge");
    469 defineSymbol(math, main, bin, "\u2228", "\\vee");
    470 defineSymbol(math, main, textord, "\u221a", "\\surd");
    471 defineSymbol(math, main, open, "(", "(");
    472 defineSymbol(math, main, open, "[", "[");
    473 defineSymbol(math, main, open, "\u27e8", "\\langle");
    474 defineSymbol(math, main, open, "\u2223", "\\lvert");
    475 defineSymbol(math, main, open, "\u2225", "\\lVert");
    476 defineSymbol(math, main, close, ")", ")");
    477 defineSymbol(math, main, close, "]", "]");
    478 defineSymbol(math, main, close, "?", "?");
    479 defineSymbol(math, main, close, "!", "!");
    480 defineSymbol(math, main, close, "\u27e9", "\\rangle");
    481 defineSymbol(math, main, close, "\u2223", "\\rvert");
    482 defineSymbol(math, main, close, "\u2225", "\\rVert");
    483 defineSymbol(math, main, rel, "=", "=");
    484 defineSymbol(math, main, rel, "<", "<");
    485 defineSymbol(math, main, rel, ">", ">");
    486 defineSymbol(math, main, rel, ":", ":");
    487 defineSymbol(math, main, rel, "\u2248", "\\approx");
    488 defineSymbol(math, main, rel, "\u2245", "\\cong");
    489 defineSymbol(math, main, rel, "\u2265", "\\ge");
    490 defineSymbol(math, main, rel, "\u2265", "\\geq");
    491 defineSymbol(math, main, rel, "\u2190", "\\gets");
    492 defineSymbol(math, main, rel, ">", "\\gt");
    493 defineSymbol(math, main, rel, "\u2208", "\\in");
    494 defineSymbol(math, main, rel, "\u2209", "\\notin");
    495 defineSymbol(math, main, rel, "\u2282", "\\subset");
    496 defineSymbol(math, main, rel, "\u2283", "\\supset");
    497 defineSymbol(math, main, rel, "\u2286", "\\subseteq");
    498 defineSymbol(math, main, rel, "\u2287", "\\supseteq");
    499 defineSymbol(math, ams, rel, "\u2288", "\\nsubseteq");
    500 defineSymbol(math, ams, rel, "\u2289", "\\nsupseteq");
    501 defineSymbol(math, main, rel, "\u22a8", "\\models");
    502 defineSymbol(math, main, rel, "\u2190", "\\leftarrow");
    503 defineSymbol(math, main, rel, "\u2264", "\\le");
    504 defineSymbol(math, main, rel, "\u2264", "\\leq");
    505 defineSymbol(math, main, rel, "<", "\\lt");
    506 defineSymbol(math, main, rel, "\u2260", "\\ne");
    507 defineSymbol(math, main, rel, "\u2260", "\\neq");
    508 defineSymbol(math, main, rel, "\u2192", "\\rightarrow");
    509 defineSymbol(math, main, rel, "\u2192", "\\to");
    510 defineSymbol(math, ams, rel, "\u2271", "\\ngeq");
    511 defineSymbol(math, ams, rel, "\u2270", "\\nleq");
    512 defineSymbol(math, main, spacing, null, "\\!");
    513 defineSymbol(math, main, spacing, "\u00a0", "\\ ");
    514 defineSymbol(math, main, spacing, "\u00a0", "~");
    515 defineSymbol(math, main, spacing, null, "\\,");
    516 defineSymbol(math, main, spacing, null, "\\:");
    517 defineSymbol(math, main, spacing, null, "\\;");
    518 defineSymbol(math, main, spacing, null, "\\enspace");
    519 defineSymbol(math, main, spacing, null, "\\qquad");
    520 defineSymbol(math, main, spacing, null, "\\quad");
    521 defineSymbol(math, main, spacing, "\u00a0", "\\space");
    522 defineSymbol(math, main, punct, ",", ",");
    523 defineSymbol(math, main, punct, ";", ";");
    524 defineSymbol(math, main, punct, ":", "\\colon");
    525 defineSymbol(math, ams, bin, "\u22bc", "\\barwedge");
    526 defineSymbol(math, ams, bin, "\u22bb", "\\veebar");
    527 defineSymbol(math, main, bin, "\u2299", "\\odot");
    528 defineSymbol(math, main, bin, "\u2295", "\\oplus");
    529 defineSymbol(math, main, bin, "\u2297", "\\otimes");
    530 defineSymbol(math, main, textord, "\u2202", "\\partial");
    531 defineSymbol(math, main, bin, "\u2298", "\\oslash");
    532 defineSymbol(math, ams, bin, "\u229a", "\\circledcirc");
    533 defineSymbol(math, ams, bin, "\u22a1", "\\boxdot");
    534 defineSymbol(math, main, bin, "\u25b3", "\\bigtriangleup");
    535 defineSymbol(math, main, bin, "\u25bd", "\\bigtriangledown");
    536 defineSymbol(math, main, bin, "\u2020", "\\dagger");
    537 defineSymbol(math, main, bin, "\u22c4", "\\diamond");
    538 defineSymbol(math, main, bin, "\u22c6", "\\star");
    539 defineSymbol(math, main, bin, "\u25c3", "\\triangleleft");
    540 defineSymbol(math, main, bin, "\u25b9", "\\triangleright");
    541 defineSymbol(math, main, open, "{", "\\{");
    542 defineSymbol(text, main, textord, "{", "\\{");
    543 defineSymbol(math, main, close, "}", "\\}");
    544 defineSymbol(text, main, textord, "}", "\\}");
    545 defineSymbol(math, main, open, "{", "\\lbrace");
    546 defineSymbol(math, main, close, "}", "\\rbrace");
    547 defineSymbol(math, main, open, "[", "\\lbrack");
    548 defineSymbol(math, main, close, "]", "\\rbrack");
    549 defineSymbol(math, main, open, "\u230a", "\\lfloor");
    550 defineSymbol(math, main, close, "\u230b", "\\rfloor");
    551 defineSymbol(math, main, open, "\u2308", "\\lceil");
    552 defineSymbol(math, main, close, "\u2309", "\\rceil");
    553 defineSymbol(math, main, textord, "\\", "\\backslash");
    554 defineSymbol(math, main, textord, "\u2223", "|");
    555 defineSymbol(math, main, textord, "\u2223", "\\vert");
    556 defineSymbol(math, main, textord, "\u2225", "\\|");
    557 defineSymbol(math, main, textord, "\u2225", "\\Vert");
    558 defineSymbol(math, main, rel, "\u2191", "\\uparrow");
    559 defineSymbol(math, main, rel, "\u21d1", "\\Uparrow");
    560 defineSymbol(math, main, rel, "\u2193", "\\downarrow");
    561 defineSymbol(math, main, rel, "\u21d3", "\\Downarrow");
    562 defineSymbol(math, main, rel, "\u2195", "\\updownarrow");
    563 defineSymbol(math, main, rel, "\u21d5", "\\Updownarrow");
    564 defineSymbol(math, main, op, "\u2210", "\\coprod");
    565 defineSymbol(math, main, op, "\u22c1", "\\bigvee");
    566 defineSymbol(math, main, op, "\u22c0", "\\bigwedge");
    567 defineSymbol(math, main, op, "\u2a04", "\\biguplus");
    568 defineSymbol(math, main, op, "\u22c2", "\\bigcap");
    569 defineSymbol(math, main, op, "\u22c3", "\\bigcup");
    570 defineSymbol(math, main, op, "\u222b", "\\int");
    571 defineSymbol(math, main, op, "\u222b", "\\intop");
    572 defineSymbol(math, main, op, "\u222c", "\\iint");
    573 defineSymbol(math, main, op, "\u222d", "\\iiint");
    574 defineSymbol(math, main, op, "\u220f", "\\prod");
    575 defineSymbol(math, main, op, "\u2211", "\\sum");
    576 defineSymbol(math, main, op, "\u2a02", "\\bigotimes");
    577 defineSymbol(math, main, op, "\u2a01", "\\bigoplus");
    578 defineSymbol(math, main, op, "\u2a00", "\\bigodot");
    579 defineSymbol(math, main, op, "\u222e", "\\oint");
    580 defineSymbol(math, main, op, "\u2a06", "\\bigsqcup");
    581 defineSymbol(math, main, op, "\u222b", "\\smallint");
    582 defineSymbol(text, main, inner, "\u2026", "\\textellipsis");
    583 defineSymbol(math, main, inner, "\u2026", "\\mathellipsis");
    584 defineSymbol(text, main, inner, "\u2026", "\\ldots");
    585 defineSymbol(math, main, inner, "\u2026", "\\ldots");
    586 defineSymbol(math, main, inner, "\u22ef", "\\cdots");
    587 defineSymbol(math, main, inner, "\u22f1", "\\ddots");
    588 defineSymbol(math, main, textord, "\u22ee", "\\vdots");
    589 defineSymbol(math, main, accent, "\u00b4", "\\acute");
    590 defineSymbol(math, main, accent, "\u0060", "\\grave");
    591 defineSymbol(math, main, accent, "\u00a8", "\\ddot");
    592 defineSymbol(math, main, accent, "\u007e", "\\tilde");
    593 defineSymbol(math, main, accent, "\u00af", "\\bar");
    594 defineSymbol(math, main, accent, "\u02d8", "\\breve");
    595 defineSymbol(math, main, accent, "\u02c7", "\\check");
    596 defineSymbol(math, main, accent, "\u005e", "\\hat");
    597 defineSymbol(math, main, accent, "\u20d7", "\\vec");
    598 defineSymbol(math, main, accent, "\u02d9", "\\dot");
    599 defineSymbol(math, main, mathord, "\u0131", "\\imath");
    600 defineSymbol(math, main, mathord, "\u0237", "\\jmath");
    601 
    602 defineSymbol(text, main, textord, "\u2013", "--");
    603 defineSymbol(text, main, textord, "\u2014", "---");
    604 defineSymbol(text, main, textord, "\u2018", "`");
    605 defineSymbol(text, main, textord, "\u2019", "'");
    606 defineSymbol(text, main, textord, "\u201c", "``");
    607 defineSymbol(text, main, textord, "\u201d", "''");
    608 defineSymbol(math, main, textord, "\u00b0", "\\degree");
    609 defineSymbol(text, main, textord, "\u00b0", "\\degree");
    610 defineSymbol(math, main, mathord, "\u00a3", "\\pounds");
    611 defineSymbol(math, ams, textord, "\u2720", "\\maltese");
    612 defineSymbol(text, ams, textord, "\u2720", "\\maltese");
    613 
    614 defineSymbol(text, main, spacing, "\u00a0", "\\ ");
    615 defineSymbol(text, main, spacing, "\u00a0", " ");
    616 defineSymbol(text, main, spacing, "\u00a0", "~");
    617 
    618 // There are lots of symbols which are the same, so we add them in afterwards.
    619 
    620 // All of these are textords in math mode
    621 const mathTextSymbols = "0123456789/@.\"";
    622 for (let i = 0; i < mathTextSymbols.length; i++) {
    623     const ch = mathTextSymbols.charAt(i);
    624     defineSymbol(math, main, textord, ch, ch);
    625 }
    626 
    627 // All of these are textords in text mode
    628 const textSymbols = "0123456789!@*()-=+[]\";:?/.,";
    629 for (let i = 0; i < textSymbols.length; i++) {
    630     const ch = textSymbols.charAt(i);
    631     defineSymbol(text, main, textord, ch, ch);
    632 }
    633 
    634 // All of these are textords in text mode, and mathords in math mode
    635 const letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    636 for (let i = 0; i < letters.length; i++) {
    637     const ch = letters.charAt(i);
    638     defineSymbol(math, main, mathord, ch, ch);
    639     defineSymbol(text, main, textord, ch, ch);
    640 }
    641 
    642 // Latin-1 letters
    643 for (let i = 0x00C0; i <= 0x00D6; i++) {
    644     const ch = String.fromCharCode(i);
    645     defineSymbol(text, main, textord, ch, ch);
    646 }
    647 
    648 for (let i = 0x00D8; i <= 0x00F6; i++) {
    649     const ch = String.fromCharCode(i);
    650     defineSymbol(text, main, textord, ch, ch);
    651 }
    652 
    653 for (let i = 0x00F8; i <= 0x00FF; i++) {
    654     const ch = String.fromCharCode(i);
    655     defineSymbol(text, main, textord, ch, ch);
    656 }
    657 
    658 // Cyrillic
    659 for (let i = 0x0410; i <= 0x044F; i++) {
    660     const ch = String.fromCharCode(i);
    661     defineSymbol(text, main, textord, ch, ch);
    662 }
    663 
    664 // Unicode versions of existing characters
    665 defineSymbol(text, main, textord, "\u2013", "–");
    666 defineSymbol(text, main, textord, "\u2014", "—");
    667 defineSymbol(text, main, textord, "\u2018", "‘");
    668 defineSymbol(text, main, textord, "\u2019", "’");
    669 defineSymbol(text, main, textord, "\u201c", "“");
    670 defineSymbol(text, main, textord, "\u201d", "”");