Brunobkr/llama.cpp_AlgMor24_github
ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.
03.1k
1/**2 * This file holds a list of all no-argument functions and single-character3 * 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" (the7 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/KaTeX/KaTeX/wiki/Examining-TeX#group-types11 * - replace: the character that this symbol or function should be12 * replaced with (i.e. "\phi" has a replace value of "\u03d5", the phi13 * character in the main font).14 *15 * The outermost map in the table indicates what mode the symbols should be16 * accepted in (e.g. "math" or "text").17 */18 19import type {Group} from "./atoms";20import type {Mode} from "./types";21import type {SymbolFont} from "./types/fonts";22 23// Some of these have a "-token" suffix since these are also used as `ParseNode`24// types for raw text tokens, and we want to avoid conflicts with higher-level25// `ParseNode` types. These `ParseNode`s are constructed within `Parser` by26// looking up the `symbols` map.27 28type CharInfoMap = Record<29 string,30 {font: SymbolFont; group: Group; replace: string | null | undefined}31>;32 33const symbols: Record<Mode, CharInfoMap> = {34 "math": {},35 "text": {},36};37export default symbols;38 39/** `acceptUnicodeChar = true` is only applicable if `replace` is set. */40export function defineSymbol(41 mode: Mode,42 font: SymbolFont,43 group: Group,44 replace: string,45 name: string,46 acceptUnicodeChar?: boolean,47) {48 symbols[mode][name] = {font, group, replace};49 50 if (acceptUnicodeChar && replace) {51 symbols[mode][replace] = symbols[mode][name];52 }53}54 55// Some abbreviations for commonly used strings.56// This helps minify the code, and also spotting typos using jshint.57 58// modes:59const math = "math";60const text = "text";61 62// fonts:63const main = "main";64const ams = "ams";65 66// groups:67const accent = "accent-token";68const bin = "bin";69const close = "close";70const inner = "inner";71const mathord = "mathord";72const op = "op-token";73const open = "open";74const punct = "punct";75const rel = "rel";76const spacing = "spacing";77const textord = "textord";78 79// Now comes the symbol table80 81// Relation Symbols82defineSymbol(math, main, rel, "\u2261", "\\equiv", true);83defineSymbol(math, main, rel, "\u227a", "\\prec", true);84defineSymbol(math, main, rel, "\u227b", "\\succ", true);85defineSymbol(math, main, rel, "\u223c", "\\sim", true);86defineSymbol(math, main, rel, "\u22a5", "\\perp");87defineSymbol(math, main, rel, "\u2aaf", "\\preceq", true);88defineSymbol(math, main, rel, "\u2ab0", "\\succeq", true);89defineSymbol(math, main, rel, "\u2243", "\\simeq", true);90defineSymbol(math, main, rel, "\u2223", "\\mid", true);91defineSymbol(math, main, rel, "\u226a", "\\ll", true);92defineSymbol(math, main, rel, "\u226b", "\\gg", true);93defineSymbol(math, main, rel, "\u224d", "\\asymp", true);94defineSymbol(math, main, rel, "\u2225", "\\parallel");95defineSymbol(math, main, rel, "\u22c8", "\\bowtie", true);96defineSymbol(math, main, rel, "\u2323", "\\smile", true);97defineSymbol(math, main, rel, "\u2291", "\\sqsubseteq", true);98defineSymbol(math, main, rel, "\u2292", "\\sqsupseteq", true);99defineSymbol(math, main, rel, "\u2250", "\\doteq", true);100defineSymbol(math, main, rel, "\u2322", "\\frown", true);101defineSymbol(math, main, rel, "\u220b", "\\ni", true);102defineSymbol(math, main, rel, "\u221d", "\\propto", true);103defineSymbol(math, main, rel, "\u22a2", "\\vdash", true);104defineSymbol(math, main, rel, "\u22a3", "\\dashv", true);105defineSymbol(math, main, rel, "\u220b", "\\owns");106 107// Punctuation108defineSymbol(math, main, punct, "\u002e", "\\ldotp");109defineSymbol(math, main, punct, "\u22c5", "\\cdotp");110// The KaTeX fonts do not contain U+00B7. Use the centered dot glyph at U+22C5111// in both modes, but keep math-mode punctuation spacing only in math mode.112defineSymbol(math, main, punct, "\u22c5", "\u00b7");113defineSymbol(text, main, textord, "\u22c5", "\u00b7");114 115// Misc Symbols116defineSymbol(math, main, textord, "\u0023", "\\#");117defineSymbol(text, main, textord, "\u0023", "\\#");118defineSymbol(math, main, textord, "\u0026", "\\&");119defineSymbol(text, main, textord, "\u0026", "\\&");120defineSymbol(math, main, textord, "\u2135", "\\aleph", true);121defineSymbol(math, main, textord, "\u2200", "\\forall", true);122defineSymbol(math, main, textord, "\u210f", "\\hbar", true);123defineSymbol(math, main, textord, "\u2203", "\\exists", true);124defineSymbol(math, main, textord, "\u2207", "\\nabla", true);125defineSymbol(math, main, textord, "\u266d", "\\flat", true);126defineSymbol(math, main, textord, "\u2113", "\\ell", true);127defineSymbol(math, main, textord, "\u266e", "\\natural", true);128defineSymbol(math, main, textord, "\u2663", "\\clubsuit", true);129defineSymbol(math, main, textord, "\u2118", "\\wp", true);130defineSymbol(math, main, textord, "\u266f", "\\sharp", true);131defineSymbol(math, main, textord, "\u2662", "\\diamondsuit", true);132defineSymbol(math, main, textord, "\u211c", "\\Re", true);133defineSymbol(math, main, textord, "\u2661", "\\heartsuit", true);134defineSymbol(math, main, textord, "\u2111", "\\Im", true);135defineSymbol(math, main, textord, "\u2660", "\\spadesuit", true);136defineSymbol(math, main, textord, "\u00a7", "\\S", true);137defineSymbol(text, main, textord, "\u00a7", "\\S");138defineSymbol(math, main, textord, "\u00b6", "\\P", true);139defineSymbol(text, main, textord, "\u00b6", "\\P");140 141// Math and Text142defineSymbol(math, main, textord, "\u2020", "\\dag");143defineSymbol(text, main, textord, "\u2020", "\\dag");144defineSymbol(text, main, textord, "\u2020", "\\textdagger");145defineSymbol(math, main, textord, "\u2021", "\\ddag");146defineSymbol(text, main, textord, "\u2021", "\\ddag");147defineSymbol(text, main, textord, "\u2021", "\\textdaggerdbl");148 149// Large Delimiters150defineSymbol(math, main, close, "\u23b1", "\\rmoustache", true);151defineSymbol(math, main, open, "\u23b0", "\\lmoustache", true);152defineSymbol(math, main, close, "\u27ef", "\\rgroup", true);153defineSymbol(math, main, open, "\u27ee", "\\lgroup", true);154 155// Binary Operators156defineSymbol(math, main, bin, "\u2213", "\\mp", true);157defineSymbol(math, main, bin, "\u2296", "\\ominus", true);158defineSymbol(math, main, bin, "\u228e", "\\uplus", true);159defineSymbol(math, main, bin, "\u2293", "\\sqcap", true);160defineSymbol(math, main, bin, "\u2217", "\\ast");161defineSymbol(math, main, bin, "\u2294", "\\sqcup", true);162defineSymbol(math, main, bin, "\u25ef", "\\bigcirc", true);163defineSymbol(math, main, bin, "\u2219", "\\bullet", true);164defineSymbol(math, main, bin, "\u2021", "\\ddagger");165defineSymbol(math, main, bin, "\u2240", "\\wr", true);166defineSymbol(math, main, bin, "\u2a3f", "\\amalg");167defineSymbol(math, main, bin, "\u0026", "\\And"); // from amsmath168 169// Arrow Symbols170defineSymbol(math, main, rel, "\u27f5", "\\longleftarrow", true);171defineSymbol(math, main, rel, "\u21d0", "\\Leftarrow", true);172defineSymbol(math, main, rel, "\u27f8", "\\Longleftarrow", true);173defineSymbol(math, main, rel, "\u27f6", "\\longrightarrow", true);174defineSymbol(math, main, rel, "\u21d2", "\\Rightarrow", true);175defineSymbol(math, main, rel, "\u27f9", "\\Longrightarrow", true);176defineSymbol(math, main, rel, "\u2194", "\\leftrightarrow", true);177defineSymbol(math, main, rel, "\u27f7", "\\longleftrightarrow", true);178defineSymbol(math, main, rel, "\u21d4", "\\Leftrightarrow", true);179defineSymbol(math, main, rel, "\u27fa", "\\Longleftrightarrow", true);180defineSymbol(math, main, rel, "\u21a6", "\\mapsto", true);181defineSymbol(math, main, rel, "\u27fc", "\\longmapsto", true);182defineSymbol(math, main, rel, "\u2197", "\\nearrow", true);183defineSymbol(math, main, rel, "\u21a9", "\\hookleftarrow", true);184defineSymbol(math, main, rel, "\u21aa", "\\hookrightarrow", true);185defineSymbol(math, main, rel, "\u2198", "\\searrow", true);186defineSymbol(math, main, rel, "\u21bc", "\\leftharpoonup", true);187defineSymbol(math, main, rel, "\u21c0", "\\rightharpoonup", true);188defineSymbol(math, main, rel, "\u2199", "\\swarrow", true);189defineSymbol(math, main, rel, "\u21bd", "\\leftharpoondown", true);190defineSymbol(math, main, rel, "\u21c1", "\\rightharpoondown", true);191defineSymbol(math, main, rel, "\u2196", "\\nwarrow", true);192defineSymbol(math, main, rel, "\u21cc", "\\rightleftharpoons", true);193 194// AMS Negated Binary Relations195defineSymbol(math, ams, rel, "\u226e", "\\nless", true);196// Symbol names preceded by "@" each have a corresponding macro.197defineSymbol(math, ams, rel, "\ue010", "\\@nleqslant");198defineSymbol(math, ams, rel, "\ue011", "\\@nleqq");199defineSymbol(math, ams, rel, "\u2a87", "\\lneq", true);200defineSymbol(math, ams, rel, "\u2268", "\\lneqq", true);201defineSymbol(math, ams, rel, "\ue00c", "\\@lvertneqq");202defineSymbol(math, ams, rel, "\u22e6", "\\lnsim", true);203defineSymbol(math, ams, rel, "\u2a89", "\\lnapprox", true);204defineSymbol(math, ams, rel, "\u2280", "\\nprec", true);205// unicode-math maps \u22e0 to \npreccurlyeq. We'll use the AMS synonym.206defineSymbol(math, ams, rel, "\u22e0", "\\npreceq", true);207defineSymbol(math, ams, rel, "\u22e8", "\\precnsim", true);208defineSymbol(math, ams, rel, "\u2ab9", "\\precnapprox", true);209defineSymbol(math, ams, rel, "\u2241", "\\nsim", true);210defineSymbol(math, ams, rel, "\ue006", "\\@nshortmid");211defineSymbol(math, ams, rel, "\u2224", "\\nmid", true);212defineSymbol(math, ams, rel, "\u22ac", "\\nvdash", true);213defineSymbol(math, ams, rel, "\u22ad", "\\nvDash", true);214defineSymbol(math, ams, rel, "\u22ea", "\\ntriangleleft");215defineSymbol(math, ams, rel, "\u22ec", "\\ntrianglelefteq", true);216defineSymbol(math, ams, rel, "\u228a", "\\subsetneq", true);217defineSymbol(math, ams, rel, "\ue01a", "\\@varsubsetneq");218defineSymbol(math, ams, rel, "\u2acb", "\\subsetneqq", true);219defineSymbol(math, ams, rel, "\ue017", "\\@varsubsetneqq");220defineSymbol(math, ams, rel, "\u226f", "\\ngtr", true);221defineSymbol(math, ams, rel, "\ue00f", "\\@ngeqslant");222defineSymbol(math, ams, rel, "\ue00e", "\\@ngeqq");223defineSymbol(math, ams, rel, "\u2a88", "\\gneq", true);224defineSymbol(math, ams, rel, "\u2269", "\\gneqq", true);225defineSymbol(math, ams, rel, "\ue00d", "\\@gvertneqq");226defineSymbol(math, ams, rel, "\u22e7", "\\gnsim", true);227defineSymbol(math, ams, rel, "\u2a8a", "\\gnapprox", true);228defineSymbol(math, ams, rel, "\u2281", "\\nsucc", true);229// unicode-math maps \u22e1 to \nsucccurlyeq. We'll use the AMS synonym.230defineSymbol(math, ams, rel, "\u22e1", "\\nsucceq", true);231defineSymbol(math, ams, rel, "\u22e9", "\\succnsim", true);232defineSymbol(math, ams, rel, "\u2aba", "\\succnapprox", true);233// unicode-math maps \u2246 to \simneqq. We'll use the AMS synonym.234defineSymbol(math, ams, rel, "\u2246", "\\ncong", true);235defineSymbol(math, ams, rel, "\ue007", "\\@nshortparallel");236defineSymbol(math, ams, rel, "\u2226", "\\nparallel", true);237defineSymbol(math, ams, rel, "\u22af", "\\nVDash", true);238defineSymbol(math, ams, rel, "\u22eb", "\\ntriangleright");239defineSymbol(math, ams, rel, "\u22ed", "\\ntrianglerighteq", true);240defineSymbol(math, ams, rel, "\ue018", "\\@nsupseteqq");241defineSymbol(math, ams, rel, "\u228b", "\\supsetneq", true);242defineSymbol(math, ams, rel, "\ue01b", "\\@varsupsetneq");243defineSymbol(math, ams, rel, "\u2acc", "\\supsetneqq", true);244defineSymbol(math, ams, rel, "\ue019", "\\@varsupsetneqq");245defineSymbol(math, ams, rel, "\u22ae", "\\nVdash", true);246defineSymbol(math, ams, rel, "\u2ab5", "\\precneqq", true);247defineSymbol(math, ams, rel, "\u2ab6", "\\succneqq", true);248defineSymbol(math, ams, rel, "\ue016", "\\@nsubseteqq");249defineSymbol(math, ams, bin, "\u22b4", "\\unlhd");250defineSymbol(math, ams, bin, "\u22b5", "\\unrhd");251 252// AMS Negated Arrows253defineSymbol(math, ams, rel, "\u219a", "\\nleftarrow", true);254defineSymbol(math, ams, rel, "\u219b", "\\nrightarrow", true);255defineSymbol(math, ams, rel, "\u21cd", "\\nLeftarrow", true);256defineSymbol(math, ams, rel, "\u21cf", "\\nRightarrow", true);257defineSymbol(math, ams, rel, "\u21ae", "\\nleftrightarrow", true);258defineSymbol(math, ams, rel, "\u21ce", "\\nLeftrightarrow", true);259 260// AMS Misc261defineSymbol(math, ams, rel, "\u25b3", "\\vartriangle");262defineSymbol(math, ams, textord, "\u210f", "\\hslash");263defineSymbol(math, ams, textord, "\u25bd", "\\triangledown");264defineSymbol(math, ams, textord, "\u25ca", "\\lozenge");265defineSymbol(math, ams, textord, "\u24c8", "\\circledS");266defineSymbol(math, ams, textord, "\u00ae", "\\circledR");267defineSymbol(text, ams, textord, "\u00ae", "\\circledR");268defineSymbol(math, ams, textord, "\u2221", "\\measuredangle", true);269defineSymbol(math, ams, textord, "\u2204", "\\nexists");270defineSymbol(math, ams, textord, "\u2127", "\\mho");271defineSymbol(math, ams, textord, "\u2132", "\\Finv", true);272defineSymbol(math, ams, textord, "\u2141", "\\Game", true);273defineSymbol(math, ams, textord, "\u2035", "\\backprime");274defineSymbol(math, ams, textord, "\u25b2", "\\blacktriangle");275defineSymbol(math, ams, textord, "\u25bc", "\\blacktriangledown");276defineSymbol(math, ams, textord, "\u25a0", "\\blacksquare");277defineSymbol(math, ams, textord, "\u29eb", "\\blacklozenge");278defineSymbol(math, ams, textord, "\u2605", "\\bigstar");279defineSymbol(math, ams, textord, "\u2222", "\\sphericalangle", true);280defineSymbol(math, ams, textord, "\u2201", "\\complement", true);281// unicode-math maps U+F0 to \matheth. We map to AMS function \eth282defineSymbol(math, ams, textord, "\u00f0", "\\eth", true);283defineSymbol(text, main, textord, "\u00f0", "\u00f0");284defineSymbol(math, ams, textord, "\u2571", "\\diagup");285defineSymbol(math, ams, textord, "\u2572", "\\diagdown");286defineSymbol(math, ams, textord, "\u25a1", "\\square");287defineSymbol(math, ams, textord, "\u25a1", "\\Box");288defineSymbol(math, ams, textord, "\u25ca", "\\Diamond");289// unicode-math maps U+A5 to \mathyen. We map to AMS function \yen290defineSymbol(math, ams, textord, "\u00a5", "\\yen", true);291defineSymbol(text, ams, textord, "\u00a5", "\\yen", true);292defineSymbol(math, ams, textord, "\u2713", "\\checkmark", true);293defineSymbol(text, ams, textord, "\u2713", "\\checkmark");294 295// AMS Hebrew296defineSymbol(math, ams, textord, "\u2136", "\\beth", true);297defineSymbol(math, ams, textord, "\u2138", "\\daleth", true);298defineSymbol(math, ams, textord, "\u2137", "\\gimel", true);299 300// AMS Greek301defineSymbol(math, ams, textord, "\u03dd", "\\digamma", true);302defineSymbol(math, ams, textord, "\u03f0", "\\varkappa");303 304// AMS Delimiters305defineSymbol(math, ams, open, "\u250c", "\\@ulcorner", true);306defineSymbol(math, ams, close, "\u2510", "\\@urcorner", true);307defineSymbol(math, ams, open, "\u2514", "\\@llcorner", true);308defineSymbol(math, ams, close, "\u2518", "\\@lrcorner", true);309 310// AMS Binary Relations311defineSymbol(math, ams, rel, "\u2266", "\\leqq", true);312defineSymbol(math, ams, rel, "\u2a7d", "\\leqslant", true);313defineSymbol(math, ams, rel, "\u2a95", "\\eqslantless", true);314defineSymbol(math, ams, rel, "\u2272", "\\lesssim", true);315defineSymbol(math, ams, rel, "\u2a85", "\\lessapprox", true);316defineSymbol(math, ams, rel, "\u224a", "\\approxeq", true);317defineSymbol(math, ams, bin, "\u22d6", "\\lessdot");318defineSymbol(math, ams, rel, "\u22d8", "\\lll", true);319defineSymbol(math, ams, rel, "\u2276", "\\lessgtr", true);320defineSymbol(math, ams, rel, "\u22da", "\\lesseqgtr", true);321defineSymbol(math, ams, rel, "\u2a8b", "\\lesseqqgtr", true);322defineSymbol(math, ams, rel, "\u2251", "\\doteqdot");323defineSymbol(math, ams, rel, "\u2253", "\\risingdotseq", true);324defineSymbol(math, ams, rel, "\u2252", "\\fallingdotseq", true);325defineSymbol(math, ams, rel, "\u223d", "\\backsim", true);326defineSymbol(math, ams, rel, "\u22cd", "\\backsimeq", true);327defineSymbol(math, ams, rel, "\u2ac5", "\\subseteqq", true);328defineSymbol(math, ams, rel, "\u22d0", "\\Subset", true);329defineSymbol(math, ams, rel, "\u228f", "\\sqsubset", true);330defineSymbol(math, ams, rel, "\u227c", "\\preccurlyeq", true);331defineSymbol(math, ams, rel, "\u22de", "\\curlyeqprec", true);332defineSymbol(math, ams, rel, "\u227e", "\\precsim", true);333defineSymbol(math, ams, rel, "\u2ab7", "\\precapprox", true);334defineSymbol(math, ams, rel, "\u22b2", "\\vartriangleleft");335defineSymbol(math, ams, rel, "\u22b4", "\\trianglelefteq");336defineSymbol(math, ams, rel, "\u22a8", "\\vDash", true);337defineSymbol(math, ams, rel, "\u22aa", "\\Vvdash", true);338defineSymbol(math, ams, rel, "\u2323", "\\smallsmile");339defineSymbol(math, ams, rel, "\u2322", "\\smallfrown");340defineSymbol(math, ams, rel, "\u224f", "\\bumpeq", true);341defineSymbol(math, ams, rel, "\u224e", "\\Bumpeq", true);342defineSymbol(math, ams, rel, "\u2267", "\\geqq", true);343defineSymbol(math, ams, rel, "\u2a7e", "\\geqslant", true);344defineSymbol(math, ams, rel, "\u2a96", "\\eqslantgtr", true);345defineSymbol(math, ams, rel, "\u2273", "\\gtrsim", true);346defineSymbol(math, ams, rel, "\u2a86", "\\gtrapprox", true);347defineSymbol(math, ams, bin, "\u22d7", "\\gtrdot");348defineSymbol(math, ams, rel, "\u22d9", "\\ggg", true);349defineSymbol(math, ams, rel, "\u2277", "\\gtrless", true);350defineSymbol(math, ams, rel, "\u22db", "\\gtreqless", true);351defineSymbol(math, ams, rel, "\u2a8c", "\\gtreqqless", true);352defineSymbol(math, ams, rel, "\u2256", "\\eqcirc", true);353defineSymbol(math, ams, rel, "\u2257", "\\circeq", true);354defineSymbol(math, ams, rel, "\u225c", "\\triangleq", true);355defineSymbol(math, ams, rel, "\u223c", "\\thicksim");356defineSymbol(math, ams, rel, "\u2248", "\\thickapprox");357defineSymbol(math, ams, rel, "\u2ac6", "\\supseteqq", true);358defineSymbol(math, ams, rel, "\u22d1", "\\Supset", true);359defineSymbol(math, ams, rel, "\u2290", "\\sqsupset", true);360defineSymbol(math, ams, rel, "\u227d", "\\succcurlyeq", true);361defineSymbol(math, ams, rel, "\u22df", "\\curlyeqsucc", true);362defineSymbol(math, ams, rel, "\u227f", "\\succsim", true);363defineSymbol(math, ams, rel, "\u2ab8", "\\succapprox", true);364defineSymbol(math, ams, rel, "\u22b3", "\\vartriangleright");365defineSymbol(math, ams, rel, "\u22b5", "\\trianglerighteq");366defineSymbol(math, ams, rel, "\u22a9", "\\Vdash", true);367defineSymbol(math, ams, rel, "\u2223", "\\shortmid");368defineSymbol(math, ams, rel, "\u2225", "\\shortparallel");369defineSymbol(math, ams, rel, "\u226c", "\\between", true);370defineSymbol(math, ams, rel, "\u22d4", "\\pitchfork", true);371defineSymbol(math, ams, rel, "\u221d", "\\varpropto");372defineSymbol(math, ams, rel, "\u25c0", "\\blacktriangleleft");373// unicode-math says that \therefore is a mathord atom.374// We kept the amssymb atom type, which is rel.375defineSymbol(math, ams, rel, "\u2234", "\\therefore", true);376defineSymbol(math, ams, rel, "\u220d", "\\backepsilon");377defineSymbol(math, ams, rel, "\u25b6", "\\blacktriangleright");378// unicode-math says that \because is a mathord atom.379// We kept the amssymb atom type, which is rel.380defineSymbol(math, ams, rel, "\u2235", "\\because", true);381defineSymbol(math, ams, rel, "\u22d8", "\\llless");382defineSymbol(math, ams, rel, "\u22d9", "\\gggtr");383defineSymbol(math, ams, bin, "\u22b2", "\\lhd");384defineSymbol(math, ams, bin, "\u22b3", "\\rhd");385defineSymbol(math, ams, rel, "\u2242", "\\eqsim", true);386defineSymbol(math, main, rel, "\u22c8", "\\Join");387defineSymbol(math, ams, rel, "\u2251", "\\Doteq", true);388 389// AMS Binary Operators390defineSymbol(math, ams, bin, "\u2214", "\\dotplus", true);391defineSymbol(math, ams, bin, "\u2216", "\\smallsetminus");392defineSymbol(math, ams, bin, "\u22d2", "\\Cap", true);393defineSymbol(math, ams, bin, "\u22d3", "\\Cup", true);394defineSymbol(math, ams, bin, "\u2a5e", "\\doublebarwedge", true);395defineSymbol(math, ams, bin, "\u229f", "\\boxminus", true);396defineSymbol(math, ams, bin, "\u229e", "\\boxplus", true);397defineSymbol(math, ams, bin, "\u22c7", "\\divideontimes", true);398defineSymbol(math, ams, bin, "\u22c9", "\\ltimes", true);399defineSymbol(math, ams, bin, "\u22ca", "\\rtimes", true);400defineSymbol(math, ams, bin, "\u22cb", "\\leftthreetimes", true);401defineSymbol(math, ams, bin, "\u22cc", "\\rightthreetimes", true);402defineSymbol(math, ams, bin, "\u22cf", "\\curlywedge", true);403defineSymbol(math, ams, bin, "\u22ce", "\\curlyvee", true);404defineSymbol(math, ams, bin, "\u229d", "\\circleddash", true);405defineSymbol(math, ams, bin, "\u229b", "\\circledast", true);406defineSymbol(math, ams, bin, "\u22c5", "\\centerdot");407defineSymbol(math, ams, bin, "\u22ba", "\\intercal", true);408defineSymbol(math, ams, bin, "\u22d2", "\\doublecap");409defineSymbol(math, ams, bin, "\u22d3", "\\doublecup");410defineSymbol(math, ams, bin, "\u22a0", "\\boxtimes", true);411 412// AMS Arrows413// Note: unicode-math maps \u21e2 to their own function \rightdasharrow.414// We'll map it to AMS function \dashrightarrow. It produces the same atom.415defineSymbol(math, ams, rel, "\u21e2", "\\dashrightarrow", true);416// unicode-math maps \u21e0 to \leftdasharrow. We'll use the AMS synonym.417defineSymbol(math, ams, rel, "\u21e0", "\\dashleftarrow", true);418defineSymbol(math, ams, rel, "\u21c7", "\\leftleftarrows", true);419defineSymbol(math, ams, rel, "\u21c6", "\\leftrightarrows", true);420defineSymbol(math, ams, rel, "\u21da", "\\Lleftarrow", true);421defineSymbol(math, ams, rel, "\u219e", "\\twoheadleftarrow", true);422defineSymbol(math, ams, rel, "\u21a2", "\\leftarrowtail", true);423defineSymbol(math, ams, rel, "\u21ab", "\\looparrowleft", true);424defineSymbol(math, ams, rel, "\u21cb", "\\leftrightharpoons", true);425defineSymbol(math, ams, rel, "\u21b6", "\\curvearrowleft", true);426// unicode-math maps \u21ba to \acwopencirclearrow. We'll use the AMS synonym.427defineSymbol(math, ams, rel, "\u21ba", "\\circlearrowleft", true);428defineSymbol(math, ams, rel, "\u21b0", "\\Lsh", true);429defineSymbol(math, ams, rel, "\u21c8", "\\upuparrows", true);430defineSymbol(math, ams, rel, "\u21bf", "\\upharpoonleft", true);431defineSymbol(math, ams, rel, "\u21c3", "\\downharpoonleft", true);432defineSymbol(math, main, rel, "\u22b6", "\\origof", true); // not in font433defineSymbol(math, main, rel, "\u22b7", "\\imageof", true); // not in font434defineSymbol(math, ams, rel, "\u22b8", "\\multimap", true);435defineSymbol(math, ams, rel, "\u21ad", "\\leftrightsquigarrow", true);436defineSymbol(math, ams, rel, "\u21c9", "\\rightrightarrows", true);437defineSymbol(math, ams, rel, "\u21c4", "\\rightleftarrows", true);438defineSymbol(math, ams, rel, "\u21a0", "\\twoheadrightarrow", true);439defineSymbol(math, ams, rel, "\u21a3", "\\rightarrowtail", true);440defineSymbol(math, ams, rel, "\u21ac", "\\looparrowright", true);441defineSymbol(math, ams, rel, "\u21b7", "\\curvearrowright", true);442// unicode-math maps \u21bb to \cwopencirclearrow. We'll use the AMS synonym.443defineSymbol(math, ams, rel, "\u21bb", "\\circlearrowright", true);444defineSymbol(math, ams, rel, "\u21b1", "\\Rsh", true);445defineSymbol(math, ams, rel, "\u21ca", "\\downdownarrows", true);446defineSymbol(math, ams, rel, "\u21be", "\\upharpoonright", true);447defineSymbol(math, ams, rel, "\u21c2", "\\downharpoonright", true);448defineSymbol(math, ams, rel, "\u21dd", "\\rightsquigarrow", true);449defineSymbol(math, ams, rel, "\u21dd", "\\leadsto");450defineSymbol(math, ams, rel, "\u21db", "\\Rrightarrow", true);451defineSymbol(math, ams, rel, "\u21be", "\\restriction");452 453defineSymbol(math, main, textord, "\u2018", "`");454defineSymbol(math, main, textord, "$", "\\$");455defineSymbol(text, main, textord, "$", "\\$");456defineSymbol(text, main, textord, "$", "\\textdollar");457defineSymbol(math, main, textord, "%", "\\%");458defineSymbol(text, main, textord, "%", "\\%");459defineSymbol(math, main, textord, "_", "\\_");460defineSymbol(text, main, textord, "_", "\\_");461defineSymbol(text, main, textord, "_", "\\textunderscore");462defineSymbol(math, main, textord, "\u2220", "\\angle", true);463defineSymbol(math, main, textord, "\u221e", "\\infty", true);464defineSymbol(math, main, textord, "\u2032", "\\prime");465defineSymbol(math, main, textord, "\u25b3", "\\triangle");466defineSymbol(math, main, textord, "\u0393", "\\Gamma", true);467defineSymbol(math, main, textord, "\u0394", "\\Delta", true);468defineSymbol(math, main, textord, "\u0398", "\\Theta", true);469defineSymbol(math, main, textord, "\u039b", "\\Lambda", true);470defineSymbol(math, main, textord, "\u039e", "\\Xi", true);471defineSymbol(math, main, textord, "\u03a0", "\\Pi", true);472defineSymbol(math, main, textord, "\u03a3", "\\Sigma", true);473defineSymbol(math, main, textord, "\u03a5", "\\Upsilon", true);474defineSymbol(math, main, textord, "\u03a6", "\\Phi", true);475defineSymbol(math, main, textord, "\u03a8", "\\Psi", true);476defineSymbol(math, main, textord, "\u03a9", "\\Omega", true);477defineSymbol(math, main, textord, "A", "\u0391");478defineSymbol(math, main, textord, "B", "\u0392");479defineSymbol(math, main, textord, "E", "\u0395");480defineSymbol(math, main, textord, "Z", "\u0396");481defineSymbol(math, main, textord, "H", "\u0397");482defineSymbol(math, main, textord, "I", "\u0399");483defineSymbol(math, main, textord, "K", "\u039A");484defineSymbol(math, main, textord, "M", "\u039C");485defineSymbol(math, main, textord, "N", "\u039D");486defineSymbol(math, main, textord, "O", "\u039F");487defineSymbol(math, main, textord, "P", "\u03A1");488defineSymbol(math, main, textord, "T", "\u03A4");489defineSymbol(math, main, textord, "X", "\u03A7");490defineSymbol(math, main, textord, "\u00ac", "\\neg", true);491defineSymbol(math, main, textord, "\u00ac", "\\lnot");492defineSymbol(math, main, textord, "\u22a4", "\\top");493defineSymbol(math, main, textord, "\u22a5", "\\bot");494defineSymbol(math, main, textord, "\u2205", "\\emptyset");495defineSymbol(math, ams, textord, "\u2205", "\\varnothing");496defineSymbol(math, main, mathord, "\u03b1", "\\alpha", true);497defineSymbol(math, main, mathord, "\u03b2", "\\beta", true);498defineSymbol(math, main, mathord, "\u03b3", "\\gamma", true);499defineSymbol(math, main, mathord, "\u03b4", "\\delta", true);500defineSymbol(math, main, mathord, "\u03f5", "\\epsilon", true);501defineSymbol(math, main, mathord, "\u03b6", "\\zeta", true);502defineSymbol(math, main, mathord, "\u03b7", "\\eta", true);503defineSymbol(math, main, mathord, "\u03b8", "\\theta", true);504defineSymbol(math, main, mathord, "\u03b9", "\\iota", true);505defineSymbol(math, main, mathord, "\u03ba", "\\kappa", true);506defineSymbol(math, main, mathord, "\u03bb", "\\lambda", true);507defineSymbol(math, main, mathord, "\u03bc", "\\mu", true);508defineSymbol(math, main, mathord, "\u03bd", "\\nu", true);509defineSymbol(math, main, mathord, "\u03be", "\\xi", true);510defineSymbol(math, main, mathord, "\u03bf", "\\omicron", true);511defineSymbol(math, main, mathord, "\u03c0", "\\pi", true);512defineSymbol(math, main, mathord, "\u03c1", "\\rho", true);513defineSymbol(math, main, mathord, "\u03c3", "\\sigma", true);514defineSymbol(math, main, mathord, "\u03c4", "\\tau", true);515defineSymbol(math, main, mathord, "\u03c5", "\\upsilon", true);516defineSymbol(math, main, mathord, "\u03d5", "\\phi", true);517defineSymbol(math, main, mathord, "\u03c7", "\\chi", true);518defineSymbol(math, main, mathord, "\u03c8", "\\psi", true);519defineSymbol(math, main, mathord, "\u03c9", "\\omega", true);520defineSymbol(math, main, mathord, "\u03b5", "\\varepsilon", true);521defineSymbol(math, main, mathord, "\u03d1", "\\vartheta", true);522defineSymbol(math, main, mathord, "\u03d6", "\\varpi", true);523defineSymbol(math, main, mathord, "\u03f1", "\\varrho", true);524defineSymbol(math, main, mathord, "\u03c2", "\\varsigma", true);525defineSymbol(math, main, mathord, "\u03c6", "\\varphi", true);526defineSymbol(math, main, bin, "\u2217", "*", true);527defineSymbol(math, main, bin, "+", "+");528defineSymbol(math, main, bin, "\u2212", "-", true);529defineSymbol(math, main, bin, "\u22c5", "\\cdot", true);530defineSymbol(math, main, bin, "\u2218", "\\circ", true);531defineSymbol(math, main, bin, "\u00f7", "\\div", true);532defineSymbol(math, main, bin, "\u00b1", "\\pm", true);533defineSymbol(math, main, bin, "\u00d7", "\\times", true);534defineSymbol(math, main, bin, "\u2229", "\\cap", true);535defineSymbol(math, main, bin, "\u222a", "\\cup", true);536defineSymbol(math, main, bin, "\u2216", "\\setminus", true);537defineSymbol(math, main, bin, "\u2227", "\\land");538defineSymbol(math, main, bin, "\u2228", "\\lor");539defineSymbol(math, main, bin, "\u2227", "\\wedge", true);540defineSymbol(math, main, bin, "\u2228", "\\vee", true);541defineSymbol(math, main, textord, "\u221a", "\\surd");542defineSymbol(math, main, open, "\u27e8", "\\langle", true);543defineSymbol(math, main, open, "\u2223", "\\lvert");544defineSymbol(math, main, open, "\u2225", "\\lVert");545defineSymbol(math, main, close, "?", "?");546defineSymbol(math, main, close, "!", "!");547defineSymbol(math, main, close, "\u27e9", "\\rangle", true);548defineSymbol(math, main, close, "\u2223", "\\rvert");549defineSymbol(math, main, close, "\u2225", "\\rVert");550defineSymbol(math, main, rel, "=", "=");551defineSymbol(math, main, rel, ":", ":");552defineSymbol(math, main, rel, "\u2248", "\\approx", true);553defineSymbol(math, main, rel, "\u2245", "\\cong", true);554defineSymbol(math, main, rel, "\u2265", "\\ge");555defineSymbol(math, main, rel, "\u2265", "\\geq", true);556defineSymbol(math, main, rel, "\u2190", "\\gets");557defineSymbol(math, main, rel, ">", "\\gt", true);558defineSymbol(math, main, rel, "\u2208", "\\in", true);559defineSymbol(math, main, rel, "\ue020", "\\@not");560defineSymbol(math, main, rel, "\u2282", "\\subset", true);561defineSymbol(math, main, rel, "\u2283", "\\supset", true);562defineSymbol(math, main, rel, "\u2286", "\\subseteq", true);563defineSymbol(math, main, rel, "\u2287", "\\supseteq", true);564defineSymbol(math, ams, rel, "\u2288", "\\nsubseteq", true);565defineSymbol(math, ams, rel, "\u2289", "\\nsupseteq", true);566defineSymbol(math, main, rel, "\u22a8", "\\models");567defineSymbol(math, main, rel, "\u2190", "\\leftarrow", true);568defineSymbol(math, main, rel, "\u2264", "\\le");569defineSymbol(math, main, rel, "\u2264", "\\leq", true);570defineSymbol(math, main, rel, "<", "\\lt", true);571defineSymbol(math, main, rel, "\u2192", "\\rightarrow", true);572defineSymbol(math, main, rel, "\u2192", "\\to");573defineSymbol(math, ams, rel, "\u2271", "\\ngeq", true);574defineSymbol(math, ams, rel, "\u2270", "\\nleq", true);575defineSymbol(math, main, spacing, "\u00a0", "\\ ");576defineSymbol(math, main, spacing, "\u00a0", "\\space");577// Ref: LaTeX Source 2e: \DeclareRobustCommand{\nobreakspace}{%578defineSymbol(math, main, spacing, "\u00a0", "\\nobreakspace");579defineSymbol(text, main, spacing, "\u00a0", "\\ ");580defineSymbol(text, main, spacing, "\u00a0", " ");581defineSymbol(text, main, spacing, "\u00a0", "\\space");582defineSymbol(text, main, spacing, "\u00a0", "\\nobreakspace");583defineSymbol(math, main, spacing, "", "\\nobreak");584defineSymbol(math, main, spacing, "", "\\allowbreak");585defineSymbol(math, main, punct, ",", ",");586defineSymbol(math, main, punct, ";", ";");587defineSymbol(math, ams, bin, "\u22bc", "\\barwedge", true);588defineSymbol(math, ams, bin, "\u22bb", "\\veebar", true);589defineSymbol(math, main, bin, "\u2299", "\\odot", true);590defineSymbol(math, main, bin, "\u2295", "\\oplus", true);591defineSymbol(math, main, bin, "\u2297", "\\otimes", true);592defineSymbol(math, main, textord, "\u2202", "\\partial", true);593defineSymbol(math, main, bin, "\u2298", "\\oslash", true);594defineSymbol(math, ams, bin, "\u229a", "\\circledcirc", true);595defineSymbol(math, ams, bin, "\u22a1", "\\boxdot", true);596defineSymbol(math, main, bin, "\u25b3", "\\bigtriangleup");597defineSymbol(math, main, bin, "\u25bd", "\\bigtriangledown");598defineSymbol(math, main, bin, "\u2020", "\\dagger");599defineSymbol(math, main, bin, "\u22c4", "\\diamond");600defineSymbol(math, main, bin, "\u22c6", "\\star");601defineSymbol(math, main, bin, "\u25c3", "\\triangleleft");602defineSymbol(math, main, bin, "\u25b9", "\\triangleright");603defineSymbol(math, main, open, "{", "\\{");604defineSymbol(text, main, textord, "{", "\\{");605defineSymbol(text, main, textord, "{", "\\textbraceleft");606defineSymbol(math, main, close, "}", "\\}");607defineSymbol(text, main, textord, "}", "\\}");608defineSymbol(text, main, textord, "}", "\\textbraceright");609defineSymbol(math, main, open, "{", "\\lbrace");610defineSymbol(math, main, close, "}", "\\rbrace");611defineSymbol(math, main, open, "[", "\\lbrack", true);612defineSymbol(text, main, textord, "[", "\\lbrack", true);613defineSymbol(math, main, close, "]", "\\rbrack", true);614defineSymbol(text, main, textord, "]", "\\rbrack", true);615defineSymbol(math, main, open, "(", "\\lparen", true);616defineSymbol(math, main, close, ")", "\\rparen", true);617defineSymbol(text, main, textord, "<", "\\textless", true); // in T1 fontenc618defineSymbol(text, main, textord, ">", "\\textgreater", true); // in T1 fontenc619defineSymbol(math, main, open, "\u230a", "\\lfloor", true);620defineSymbol(math, main, close, "\u230b", "\\rfloor", true);621defineSymbol(math, main, open, "\u2308", "\\lceil", true);622defineSymbol(math, main, close, "\u2309", "\\rceil", true);623defineSymbol(math, main, textord, "\\", "\\backslash");624defineSymbol(math, main, textord, "\u2223", "|");625defineSymbol(math, main, textord, "\u2223", "\\vert");626defineSymbol(text, main, textord, "|", "\\textbar", true); // in T1 fontenc627defineSymbol(math, main, textord, "\u2225", "\\|");628defineSymbol(math, main, textord, "\u2225", "\\Vert");629defineSymbol(text, main, textord, "\u2225", "\\textbardbl");630defineSymbol(text, main, textord, "~", "\\textasciitilde");631defineSymbol(text, main, textord, "\\", "\\textbackslash");632defineSymbol(text, main, textord, "^", "\\textasciicircum");633defineSymbol(math, main, rel, "\u2191", "\\uparrow", true);634defineSymbol(math, main, rel, "\u21d1", "\\Uparrow", true);635defineSymbol(math, main, rel, "\u2193", "\\downarrow", true);636defineSymbol(math, main, rel, "\u21d3", "\\Downarrow", true);637defineSymbol(math, main, rel, "\u2195", "\\updownarrow", true);638defineSymbol(math, main, rel, "\u21d5", "\\Updownarrow", true);639defineSymbol(math, main, op, "\u2210", "\\coprod");640defineSymbol(math, main, op, "\u22c1", "\\bigvee");641defineSymbol(math, main, op, "\u22c0", "\\bigwedge");642defineSymbol(math, main, op, "\u2a04", "\\biguplus");643defineSymbol(math, main, op, "\u22c2", "\\bigcap");644defineSymbol(math, main, op, "\u22c3", "\\bigcup");645defineSymbol(math, main, op, "\u222b", "\\int");646defineSymbol(math, main, op, "\u222b", "\\intop");647defineSymbol(math, main, op, "\u222c", "\\iint");648defineSymbol(math, main, op, "\u222d", "\\iiint");649defineSymbol(math, main, op, "\u220f", "\\prod");650defineSymbol(math, main, op, "\u2211", "\\sum");651defineSymbol(math, main, op, "\u2a02", "\\bigotimes");652defineSymbol(math, main, op, "\u2a01", "\\bigoplus");653defineSymbol(math, main, op, "\u2a00", "\\bigodot");654defineSymbol(math, main, op, "\u222e", "\\oint");655defineSymbol(math, main, op, "\u222f", "\\oiint");656defineSymbol(math, main, op, "\u2230", "\\oiiint");657defineSymbol(math, main, op, "\u2a06", "\\bigsqcup");658defineSymbol(math, main, op, "\u222b", "\\smallint");659defineSymbol(text, main, inner, "\u2026", "\\textellipsis");660defineSymbol(math, main, inner, "\u2026", "\\mathellipsis");661defineSymbol(text, main, inner, "\u2026", "\\ldots", true);662defineSymbol(math, main, inner, "\u2026", "\\ldots", true);663defineSymbol(math, main, inner, "\u22ef", "\\@cdots", true);664defineSymbol(math, main, inner, "\u22f1", "\\ddots", true);665// \vdots is a macro that uses one of these two symbols (with made-up names):666defineSymbol(math, main, textord, "\u22ee", "\\varvdots");667defineSymbol(text, main, textord, "\u22ee", "\\varvdots");668defineSymbol(math, main, accent, "\u02ca", "\\acute");669defineSymbol(math, main, accent, "\u02cb", "\\grave");670defineSymbol(math, main, accent, "\u00a8", "\\ddot");671defineSymbol(math, main, accent, "\u007e", "\\tilde");672defineSymbol(math, main, accent, "\u02c9", "\\bar");673defineSymbol(math, main, accent, "\u02d8", "\\breve");674defineSymbol(math, main, accent, "\u02c7", "\\check");675defineSymbol(math, main, accent, "\u005e", "\\hat");676defineSymbol(math, main, accent, "\u20d7", "\\vec");677defineSymbol(math, main, accent, "\u02d9", "\\dot");678defineSymbol(math, main, accent, "\u02da", "\\mathring");679// \imath and \jmath should be invariant to \mathrm, \mathbf, etc., so use PUA680defineSymbol(math, main, mathord, "\ue131", "\\@imath");681defineSymbol(math, main, mathord, "\ue237", "\\@jmath");682defineSymbol(math, main, textord, "\u0131", "\u0131");683defineSymbol(math, main, textord, "\u0237", "\u0237");684defineSymbol(text, main, textord, "\u0131", "\\i", true);685defineSymbol(text, main, textord, "\u0237", "\\j", true);686defineSymbol(text, main, textord, "\u00df", "\\ss", true);687defineSymbol(text, main, textord, "\u00e6", "\\ae", true);688defineSymbol(text, main, textord, "\u0153", "\\oe", true);689defineSymbol(text, main, textord, "\u00f8", "\\o", true);690defineSymbol(text, main, textord, "\u00c6", "\\AE", true);691defineSymbol(text, main, textord, "\u0152", "\\OE", true);692defineSymbol(text, main, textord, "\u00d8", "\\O", true);693defineSymbol(text, main, accent, "\u02ca", "\\'"); // acute694defineSymbol(text, main, accent, "\u02cb", "\\`"); // grave695defineSymbol(text, main, accent, "\u02c6", "\\^"); // circumflex696defineSymbol(text, main, accent, "\u02dc", "\\~"); // tilde697defineSymbol(text, main, accent, "\u02c9", "\\="); // macron698defineSymbol(text, main, accent, "\u02d8", "\\u"); // breve699defineSymbol(text, main, accent, "\u02d9", "\\."); // dot above700defineSymbol(text, main, accent, "\u00b8", "\\c"); // cedilla701defineSymbol(text, main, accent, "\u02da", "\\r"); // ring above702defineSymbol(text, main, accent, "\u02c7", "\\v"); // caron703defineSymbol(text, main, accent, "\u00a8", '\\"'); // diaeresis704defineSymbol(text, main, accent, "\u02dd", "\\H"); // double acute705defineSymbol(text, main, accent, "\u25ef", "\\textcircled"); // \bigcirc glyph706 707// These ligatures are detected and created in Parser.js's `formLigatures`.708export const ligatures = {709 "--": true,710 "---": true,711 "``": true,712 "''": true,713};714 715defineSymbol(text, main, textord, "\u2013", "--", true);716defineSymbol(text, main, textord, "\u2013", "\\textendash");717defineSymbol(text, main, textord, "\u2014", "---", true);718defineSymbol(text, main, textord, "\u2014", "\\textemdash");719defineSymbol(text, main, textord, "\u2018", "`", true);720defineSymbol(text, main, textord, "\u2018", "\\textquoteleft");721defineSymbol(text, main, textord, "\u2019", "'", true);722defineSymbol(text, main, textord, "\u2019", "\\textquoteright");723defineSymbol(text, main, textord, "\u201c", "``", true);724defineSymbol(text, main, textord, "\u201c", "\\textquotedblleft");725defineSymbol(text, main, textord, "\u201d", "''", true);726defineSymbol(text, main, textord, "\u201d", "\\textquotedblright");727// \degree from gensymb package728defineSymbol(math, main, textord, "\u00b0", "\\degree", true);729defineSymbol(text, main, textord, "\u00b0", "\\degree");730// \textdegree from inputenc package731defineSymbol(text, main, textord, "\u00b0", "\\textdegree", true);732// TODO: In LaTeX, \pounds can generate a different character in text and math733// mode, but among our fonts, only Main-Regular defines this character "163".734defineSymbol(math, main, textord, "\u00a3", "\\pounds");735defineSymbol(math, main, textord, "\u00a3", "\\mathsterling", true);736defineSymbol(text, main, textord, "\u00a3", "\\pounds");737defineSymbol(text, main, textord, "\u00a3", "\\textsterling", true);738defineSymbol(math, ams, textord, "\u2720", "\\maltese");739defineSymbol(text, ams, textord, "\u2720", "\\maltese");740 741// There are lots of symbols which are the same, so we add them in afterwards.742// All of these are textords in math mode743const mathTextSymbols = "0123456789/@.\"";744for (let i = 0; i < mathTextSymbols.length; i++) {745 const ch = mathTextSymbols.charAt(i);746 defineSymbol(math, main, textord, ch, ch);747}748 749// All of these are textords in text mode750const textSymbols = "0123456789!@*()-=+\";:?/.,";751for (let i = 0; i < textSymbols.length; i++) {752 const ch = textSymbols.charAt(i);753 defineSymbol(text, main, textord, ch, ch);754}755 756// All of these are textords in text mode, and mathords in math mode757const letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";758for (let i = 0; i < letters.length; i++) {759 const ch = letters.charAt(i);760 defineSymbol(math, main, mathord, ch, ch);761 defineSymbol(text, main, textord, ch, ch);762}763 764// Blackboard bold and script letters in Unicode range765defineSymbol(math, ams, textord, "C", "\u2102"); // blackboard bold766defineSymbol(text, ams, textord, "C", "\u2102");767defineSymbol(math, ams, textord, "H", "\u210D");768defineSymbol(text, ams, textord, "H", "\u210D");769defineSymbol(math, ams, textord, "N", "\u2115");770defineSymbol(text, ams, textord, "N", "\u2115");771defineSymbol(math, ams, textord, "P", "\u2119");772defineSymbol(text, ams, textord, "P", "\u2119");773defineSymbol(math, ams, textord, "Q", "\u211A");774defineSymbol(text, ams, textord, "Q", "\u211A");775defineSymbol(math, ams, textord, "R", "\u211D");776defineSymbol(text, ams, textord, "R", "\u211D");777defineSymbol(math, ams, textord, "Z", "\u2124");778defineSymbol(text, ams, textord, "Z", "\u2124");779defineSymbol(math, main, mathord, "h", "\u210E"); // italic h, Planck constant780defineSymbol(text, main, mathord, "h", "\u210E");781 782// The next loop loads wide (surrogate pair) characters.783// We support some letters in the Unicode range U+1D400 to U+1D7FF,784// Mathematical Alphanumeric Symbols.785// Some editors do not deal well with wide characters. So don't write the786// string into this file. Instead, create the string from the surrogate pair.787let wideChar;788for (let i = 0; i < letters.length; i++) {789 const ch = letters.charAt(i);790 791 // The hex numbers in the next line are a surrogate pair.792 // 0xD835 is the high surrogate for all letters in the range we support.793 // 0xDC00 is the low surrogate for bold A.794 wideChar = String.fromCharCode(0xD835, 0xDC00 + i); // A-Z a-z bold795 defineSymbol(math, main, mathord, ch, wideChar);796 defineSymbol(text, main, textord, ch, wideChar);797 798 wideChar = String.fromCharCode(0xD835, 0xDC34 + i); // A-Z a-z italic799 defineSymbol(math, main, mathord, ch, wideChar);800 defineSymbol(text, main, textord, ch, wideChar);801 802 wideChar = String.fromCharCode(0xD835, 0xDC68 + i); // A-Z a-z bold italic803 defineSymbol(math, main, mathord, ch, wideChar);804 defineSymbol(text, main, textord, ch, wideChar);805 806 wideChar = String.fromCharCode(0xD835, 0xDD04 + i); // A-Z a-z Fraktur807 defineSymbol(math, main, mathord, ch, wideChar);808 defineSymbol(text, main, textord, ch, wideChar);809 810 wideChar = String.fromCharCode(0xD835, 0xDD6C + i); // A-Z a-z bold Fraktur811 defineSymbol(math, main, mathord, ch, wideChar);812 defineSymbol(text, main, textord, ch, wideChar);813 814 wideChar = String.fromCharCode(0xD835, 0xDDA0 + i); // A-Z a-z sans-serif815 defineSymbol(math, main, mathord, ch, wideChar);816 defineSymbol(text, main, textord, ch, wideChar);817 818 wideChar = String.fromCharCode(0xD835, 0xDDD4 + i); // A-Z a-z sans bold819 defineSymbol(math, main, mathord, ch, wideChar);820 defineSymbol(text, main, textord, ch, wideChar);821 822 wideChar = String.fromCharCode(0xD835, 0xDE08 + i); // A-Z a-z sans italic823 defineSymbol(math, main, mathord, ch, wideChar);824 defineSymbol(text, main, textord, ch, wideChar);825 826 wideChar = String.fromCharCode(0xD835, 0xDE70 + i); // A-Z a-z monospace827 defineSymbol(math, main, mathord, ch, wideChar);828 defineSymbol(text, main, textord, ch, wideChar);829 830 if (i < 26) {831 // KaTeX fonts have only capital letters for blackboard bold and script.832 // See exception for k below.833 wideChar = String.fromCharCode(0xD835, 0xDD38 + i); // A-Z double struck834 defineSymbol(math, main, mathord, ch, wideChar);835 defineSymbol(text, main, textord, ch, wideChar);836 837 wideChar = String.fromCharCode(0xD835, 0xDC9C + i); // A-Z script838 defineSymbol(math, main, mathord, ch, wideChar);839 defineSymbol(text, main, textord, ch, wideChar);840 }841 842 // TODO: Add bold script when it is supported by a KaTeX font.843}844// "k" is the only double struck lower case letter in the KaTeX fonts.845wideChar = String.fromCharCode(0xD835, 0xDD5C); // k double struck846defineSymbol(math, main, mathord, "k", wideChar);847defineSymbol(text, main, textord, "k", wideChar);848 849// Next, some wide character numerals850for (let i = 0; i < 10; i++) {851 const ch = i.toString();852 853 wideChar = String.fromCharCode(0xD835, 0xDFCE + i); // 0-9 bold854 defineSymbol(math, main, mathord, ch, wideChar);855 defineSymbol(text, main, textord, ch, wideChar);856 857 wideChar = String.fromCharCode(0xD835, 0xDFE2 + i); // 0-9 sans serif858 defineSymbol(math, main, mathord, ch, wideChar);859 defineSymbol(text, main, textord, ch, wideChar);860 861 wideChar = String.fromCharCode(0xD835, 0xDFEC + i); // 0-9 bold sans862 defineSymbol(math, main, mathord, ch, wideChar);863 defineSymbol(text, main, textord, ch, wideChar);864 865 wideChar = String.fromCharCode(0xD835, 0xDFF6 + i); // 0-9 monospace866 defineSymbol(math, main, mathord, ch, wideChar);867 defineSymbol(text, main, textord, ch, wideChar);868}869 870// We add these Latin-1 letters as symbols for backwards-compatibility,871// but they are not actually in the font, nor are they supported by the872// Unicode accent mechanism, so they fall back to Times font and look ugly.873// TODO(edemaine): Fix this.874export const extraLatin = "\u00d0\u00de\u00fe";875for (let i = 0; i < extraLatin.length; i++) {876 const ch = extraLatin.charAt(i);877 defineSymbol(math, main, mathord, ch, ch);878 defineSymbol(text, main, textord, ch, ch);879}880 