| /************************************ |
| * Symbols for Advanced Mathematics |
| ***********************************/ |
| |
| LatexCmds.notin = |
| LatexCmds.cong = |
| LatexCmds.equiv = |
| LatexCmds.oplus = |
| LatexCmds.otimes = P(BinaryOperator, function(_, super_) { |
| _.init = function(latex) { |
| super_.init.call(this, '\\'+latex+' ', '&'+latex+';'); |
| }; |
| }); |
| |
| LatexCmds['≠'] = LatexCmds.ne = LatexCmds.neq = bind(BinaryOperator,'\\ne ','≠'); |
| |
| LatexCmds.ast = LatexCmds.star = LatexCmds.loast = LatexCmds.lowast = |
| bind(BinaryOperator,'\\ast ','∗'); |
| //case 'there4 = // a special exception for this one, perhaps? |
| LatexCmds.therefor = LatexCmds.therefore = |
| bind(BinaryOperator,'\\therefore ','∴'); |
| |
| LatexCmds.cuz = // l33t |
| LatexCmds.because = bind(BinaryOperator,'\\because ','∵'); |
| |
| LatexCmds.prop = LatexCmds.propto = bind(BinaryOperator,'\\propto ','∝'); |
| |
| LatexCmds['≈'] = LatexCmds.asymp = LatexCmds.approx = bind(BinaryOperator,'\\approx ','≈'); |
| |
| LatexCmds.isin = LatexCmds['in'] = bind(BinaryOperator,'\\in ','∈'); |
| |
| LatexCmds.ni = LatexCmds.contains = bind(BinaryOperator,'\\ni ','∋'); |
| |
| LatexCmds.notni = LatexCmds.niton = LatexCmds.notcontains = LatexCmds.doesnotcontain = |
| bind(BinaryOperator,'\\not\\ni ','∌'); |
| |
| LatexCmds.sub = LatexCmds.subset = bind(BinaryOperator,'\\subset ','⊂'); |
| |
| LatexCmds.sup = LatexCmds.supset = LatexCmds.superset = |
| bind(BinaryOperator,'\\supset ','⊃'); |
| |
| LatexCmds.nsub = LatexCmds.notsub = |
| LatexCmds.nsubset = LatexCmds.notsubset = |
| bind(BinaryOperator,'\\not\\subset ','⊄'); |
| |
| LatexCmds.nsup = LatexCmds.notsup = |
| LatexCmds.nsupset = LatexCmds.notsupset = |
| LatexCmds.nsuperset = LatexCmds.notsuperset = |
| bind(BinaryOperator,'\\not\\supset ','⊅'); |
| |
| LatexCmds.sube = LatexCmds.subeq = LatexCmds.subsete = LatexCmds.subseteq = |
| bind(BinaryOperator,'\\subseteq ','⊆'); |
| |
| LatexCmds.supe = LatexCmds.supeq = |
| LatexCmds.supsete = LatexCmds.supseteq = |
| LatexCmds.supersete = LatexCmds.superseteq = |
| bind(BinaryOperator,'\\supseteq ','⊇'); |
| |
| LatexCmds.nsube = LatexCmds.nsubeq = |
| LatexCmds.notsube = LatexCmds.notsubeq = |
| LatexCmds.nsubsete = LatexCmds.nsubseteq = |
| LatexCmds.notsubsete = LatexCmds.notsubseteq = |
| bind(BinaryOperator,'\\not\\subseteq ','⊈'); |
| |
| LatexCmds.nsupe = LatexCmds.nsupeq = |
| LatexCmds.notsupe = LatexCmds.notsupeq = |
| LatexCmds.nsupsete = LatexCmds.nsupseteq = |
| LatexCmds.notsupsete = LatexCmds.notsupseteq = |
| LatexCmds.nsupersete = LatexCmds.nsuperseteq = |
| LatexCmds.notsupersete = LatexCmds.notsuperseteq = |
| bind(BinaryOperator,'\\not\\supseteq ','⊉'); |
| |
| |
| //the canonical sets of numbers |
| LatexCmds.N = LatexCmds.naturals = LatexCmds.Naturals = |
| bind(VanillaSymbol,'\\mathbb{N}','ℕ'); |
| |
| LatexCmds.P = |
| LatexCmds.primes = LatexCmds.Primes = |
| LatexCmds.projective = LatexCmds.Projective = |
| LatexCmds.probability = LatexCmds.Probability = |
| bind(VanillaSymbol,'\\mathbb{P}','ℙ'); |
| |
| LatexCmds.Z = LatexCmds.integers = LatexCmds.Integers = |
| bind(VanillaSymbol,'\\mathbb{Z}','ℤ'); |
| |
| LatexCmds.Q = LatexCmds.rationals = LatexCmds.Rationals = |
| bind(VanillaSymbol,'\\mathbb{Q}','ℚ'); |
| |
| LatexCmds.R = LatexCmds.reals = LatexCmds.Reals = |
| bind(VanillaSymbol,'\\mathbb{R}','ℝ'); |
| |
| LatexCmds.C = |
| LatexCmds.complex = LatexCmds.Complex = |
| LatexCmds.complexes = LatexCmds.Complexes = |
| LatexCmds.complexplane = LatexCmds.Complexplane = LatexCmds.ComplexPlane = |
| bind(VanillaSymbol,'\\mathbb{C}','ℂ'); |
| |
| LatexCmds.H = LatexCmds.Hamiltonian = LatexCmds.quaternions = LatexCmds.Quaternions = |
| bind(VanillaSymbol,'\\mathbb{H}','ℍ'); |
| |
| //spacing |
| LatexCmds.quad = LatexCmds.emsp = bind(VanillaSymbol,'\\quad ',' '); |
| LatexCmds.qquad = bind(VanillaSymbol,'\\qquad ',' '); |
| /* spacing special characters, gonna have to implement this in LatexCommandInput::onText somehow |
| case ',': |
| return VanillaSymbol('\\, ',' '); |
| case ':': |
| return VanillaSymbol('\\: ',' '); |
| case ';': |
| return VanillaSymbol('\\; ',' '); |
| case '!': |
| return Symbol('\\! ','<span style="margin-right:-.2em"></span>'); |
| */ |
| |
| //binary operators |
| LatexCmds.diamond = bind(VanillaSymbol, '\\diamond ', '◇'); |
| LatexCmds.bigtriangleup = bind(VanillaSymbol, '\\bigtriangleup ', '△'); |
| LatexCmds.ominus = bind(VanillaSymbol, '\\ominus ', '⊖'); |
| LatexCmds.uplus = bind(VanillaSymbol, '\\uplus ', '⊎'); |
| LatexCmds.bigtriangledown = bind(VanillaSymbol, '\\bigtriangledown ', '▽'); |
| LatexCmds.sqcap = bind(VanillaSymbol, '\\sqcap ', '⊓'); |
| LatexCmds.triangleleft = bind(VanillaSymbol, '\\triangleleft ', '⊲'); |
| LatexCmds.sqcup = bind(VanillaSymbol, '\\sqcup ', '⊔'); |
| LatexCmds.triangleright = bind(VanillaSymbol, '\\triangleright ', '⊳'); |
| //circledot is not a not real LaTex command see https://github.com/mathquill/mathquill/pull/552 for more details |
| LatexCmds.odot = LatexCmds.circledot = bind(VanillaSymbol, '\\odot ', '⊙'); |
| LatexCmds.bigcirc = bind(VanillaSymbol, '\\bigcirc ', '◯'); |
| LatexCmds.dagger = bind(VanillaSymbol, '\\dagger ', '†'); |
| LatexCmds.ddagger = bind(VanillaSymbol, '\\ddagger ', '‡'); |
| LatexCmds.wr = bind(VanillaSymbol, '\\wr ', '≀'); |
| LatexCmds.amalg = bind(VanillaSymbol, '\\amalg ', '∐'); |
| |
| //relationship symbols |
| LatexCmds.models = bind(VanillaSymbol, '\\models ', '⊨'); |
| LatexCmds.prec = bind(VanillaSymbol, '\\prec ', '≺'); |
| LatexCmds.succ = bind(VanillaSymbol, '\\succ ', '≻'); |
| LatexCmds.preceq = bind(VanillaSymbol, '\\preceq ', '≼'); |
| LatexCmds.succeq = bind(VanillaSymbol, '\\succeq ', '≽'); |
| LatexCmds.simeq = bind(VanillaSymbol, '\\simeq ', '≃'); |
| LatexCmds.mid = bind(VanillaSymbol, '\\mid ', '∣'); |
| LatexCmds.ll = bind(VanillaSymbol, '\\ll ', '≪'); |
| LatexCmds.gg = bind(VanillaSymbol, '\\gg ', '≫'); |
| LatexCmds.parallel = bind(VanillaSymbol, '\\parallel ', '∥'); |
| LatexCmds.nparallel = bind(VanillaSymbol, '\\nparallel ', '∦'); |
| LatexCmds.bowtie = bind(VanillaSymbol, '\\bowtie ', '⋈'); |
| LatexCmds.sqsubset = bind(VanillaSymbol, '\\sqsubset ', '⊏'); |
| LatexCmds.sqsupset = bind(VanillaSymbol, '\\sqsupset ', '⊐'); |
| LatexCmds.smile = bind(VanillaSymbol, '\\smile ', '⌣'); |
| LatexCmds.sqsubseteq = bind(VanillaSymbol, '\\sqsubseteq ', '⊑'); |
| LatexCmds.sqsupseteq = bind(VanillaSymbol, '\\sqsupseteq ', '⊒'); |
| LatexCmds.doteq = bind(VanillaSymbol, '\\doteq ', '≐'); |
| LatexCmds.frown = bind(VanillaSymbol, '\\frown ', '⌢'); |
| LatexCmds.vdash = bind(VanillaSymbol, '\\vdash ', '⊦'); |
| LatexCmds.dashv = bind(VanillaSymbol, '\\dashv ', '⊣'); |
| LatexCmds.nless = bind(VanillaSymbol, '\\nless ', '≮'); |
| LatexCmds.ngtr = bind(VanillaSymbol, '\\ngtr ', '≯'); |
| |
| //arrows |
| LatexCmds.longleftarrow = bind(VanillaSymbol, '\\longleftarrow ', '←'); |
| LatexCmds.longrightarrow = bind(VanillaSymbol, '\\longrightarrow ', '→'); |
| LatexCmds.Longleftarrow = bind(VanillaSymbol, '\\Longleftarrow ', '⇐'); |
| LatexCmds.Longrightarrow = bind(VanillaSymbol, '\\Longrightarrow ', '⇒'); |
| LatexCmds.longleftrightarrow = bind(VanillaSymbol, '\\longleftrightarrow ', '↔'); |
| LatexCmds.updownarrow = bind(VanillaSymbol, '\\updownarrow ', '↕'); |
| LatexCmds.Longleftrightarrow = bind(VanillaSymbol, '\\Longleftrightarrow ', '⇔'); |
| LatexCmds.Updownarrow = bind(VanillaSymbol, '\\Updownarrow ', '⇕'); |
| LatexCmds.mapsto = bind(VanillaSymbol, '\\mapsto ', '↦'); |
| LatexCmds.nearrow = bind(VanillaSymbol, '\\nearrow ', '↗'); |
| LatexCmds.hookleftarrow = bind(VanillaSymbol, '\\hookleftarrow ', '↩'); |
| LatexCmds.hookrightarrow = bind(VanillaSymbol, '\\hookrightarrow ', '↪'); |
| LatexCmds.searrow = bind(VanillaSymbol, '\\searrow ', '↘'); |
| LatexCmds.leftharpoonup = bind(VanillaSymbol, '\\leftharpoonup ', '↼'); |
| LatexCmds.rightharpoonup = bind(VanillaSymbol, '\\rightharpoonup ', '⇀'); |
| LatexCmds.swarrow = bind(VanillaSymbol, '\\swarrow ', '↙'); |
| LatexCmds.leftharpoondown = bind(VanillaSymbol, '\\leftharpoondown ', '↽'); |
| LatexCmds.rightharpoondown = bind(VanillaSymbol, '\\rightharpoondown ', '⇁'); |
| LatexCmds.nwarrow = bind(VanillaSymbol, '\\nwarrow ', '↖'); |
| |
| //Misc |
| LatexCmds.ldots = bind(VanillaSymbol, '\\ldots ', '…'); |
| LatexCmds.cdots = bind(VanillaSymbol, '\\cdots ', '⋯'); |
| LatexCmds.vdots = bind(VanillaSymbol, '\\vdots ', '⋮'); |
| LatexCmds.ddots = bind(VanillaSymbol, '\\ddots ', '⋱'); |
| LatexCmds.surd = bind(VanillaSymbol, '\\surd ', '√'); |
| LatexCmds.triangle = bind(VanillaSymbol, '\\triangle ', '△'); |
| LatexCmds.ell = bind(VanillaSymbol, '\\ell ', 'ℓ'); |
| LatexCmds.top = bind(VanillaSymbol, '\\top ', '⊤'); |
| LatexCmds.flat = bind(VanillaSymbol, '\\flat ', '♭'); |
| LatexCmds.natural = bind(VanillaSymbol, '\\natural ', '♮'); |
| LatexCmds.sharp = bind(VanillaSymbol, '\\sharp ', '♯'); |
| LatexCmds.wp = bind(VanillaSymbol, '\\wp ', '℘'); |
| LatexCmds.bot = bind(VanillaSymbol, '\\bot ', '⊥'); |
| LatexCmds.clubsuit = bind(VanillaSymbol, '\\clubsuit ', '♣'); |
| LatexCmds.diamondsuit = bind(VanillaSymbol, '\\diamondsuit ', '♢'); |
| LatexCmds.heartsuit = bind(VanillaSymbol, '\\heartsuit ', '♡'); |
| LatexCmds.spadesuit = bind(VanillaSymbol, '\\spadesuit ', '♠'); |
| //not real LaTex command see https://github.com/mathquill/mathquill/pull/552 for more details |
| LatexCmds.parallelogram = bind(VanillaSymbol, '\\parallelogram ', '▱'); |
| LatexCmds.square = bind(VanillaSymbol, '\\square ', '⬜'); |
| |
| //variable-sized |
| LatexCmds.oint = bind(VanillaSymbol, '\\oint ', '∮'); |
| LatexCmds.bigcap = bind(VanillaSymbol, '\\bigcap ', '∩'); |
| LatexCmds.bigcup = bind(VanillaSymbol, '\\bigcup ', '∪'); |
| LatexCmds.bigsqcup = bind(VanillaSymbol, '\\bigsqcup ', '⊔'); |
| LatexCmds.bigvee = bind(VanillaSymbol, '\\bigvee ', '∨'); |
| LatexCmds.bigwedge = bind(VanillaSymbol, '\\bigwedge ', '∧'); |
| LatexCmds.bigodot = bind(VanillaSymbol, '\\bigodot ', '⊙'); |
| LatexCmds.bigotimes = bind(VanillaSymbol, '\\bigotimes ', '⊗'); |
| LatexCmds.bigoplus = bind(VanillaSymbol, '\\bigoplus ', '⊕'); |
| LatexCmds.biguplus = bind(VanillaSymbol, '\\biguplus ', '⊎'); |
| |
| //delimiters |
| LatexCmds.lfloor = bind(VanillaSymbol, '\\lfloor ', '⌊'); |
| LatexCmds.rfloor = bind(VanillaSymbol, '\\rfloor ', '⌋'); |
| LatexCmds.lceil = bind(VanillaSymbol, '\\lceil ', '⌈'); |
| LatexCmds.rceil = bind(VanillaSymbol, '\\rceil ', '⌉'); |
| LatexCmds.opencurlybrace = LatexCmds.lbrace = bind(VanillaSymbol, '\\lbrace ', '{'); |
| LatexCmds.closecurlybrace = LatexCmds.rbrace = bind(VanillaSymbol, '\\rbrace ', '}'); |
| LatexCmds.lbrack = bind(VanillaSymbol, '['); |
| LatexCmds.rbrack = bind(VanillaSymbol, ']'); |
| |
| //various symbols |
| LatexCmds.slash = bind(VanillaSymbol, '/'); |
| LatexCmds.vert = bind(VanillaSymbol,'|'); |
| LatexCmds.perp = LatexCmds.perpendicular = bind(VanillaSymbol,'\\perp ','⊥'); |
| LatexCmds.nabla = LatexCmds.del = bind(VanillaSymbol,'\\nabla ','∇'); |
| LatexCmds.hbar = bind(VanillaSymbol,'\\hbar ','ℏ'); |
| |
| LatexCmds.AA = LatexCmds.Angstrom = LatexCmds.angstrom = |
| bind(VanillaSymbol,'\\text\\AA ','Å'); |
| |
| LatexCmds.ring = LatexCmds.circ = LatexCmds.circle = |
| bind(VanillaSymbol,'\\circ ','∘'); |
| |
| LatexCmds.bull = LatexCmds.bullet = bind(VanillaSymbol,'\\bullet ','•'); |
| |
| LatexCmds.setminus = LatexCmds.smallsetminus = |
| bind(VanillaSymbol,'\\setminus ','∖'); |
| |
| LatexCmds.not = //bind(Symbol,'\\not ','<span class="not">/</span>'); |
| LatexCmds['¬'] = LatexCmds.neg = bind(VanillaSymbol,'\\neg ','¬'); |
| |
| LatexCmds['…'] = LatexCmds.dots = LatexCmds.ellip = LatexCmds.hellip = |
| LatexCmds.ellipsis = LatexCmds.hellipsis = |
| bind(VanillaSymbol,'\\dots ','…'); |
| |
| LatexCmds.converges = |
| LatexCmds.darr = LatexCmds.dnarr = LatexCmds.dnarrow = LatexCmds.downarrow = |
| bind(VanillaSymbol,'\\downarrow ','↓'); |
| |
| LatexCmds.dArr = LatexCmds.dnArr = LatexCmds.dnArrow = LatexCmds.Downarrow = |
| bind(VanillaSymbol,'\\Downarrow ','⇓'); |
| |
| LatexCmds.diverges = LatexCmds.uarr = LatexCmds.uparrow = |
| bind(VanillaSymbol,'\\uparrow ','↑'); |
| |
| LatexCmds.uArr = LatexCmds.Uparrow = bind(VanillaSymbol,'\\Uparrow ','⇑'); |
| |
| LatexCmds.to = bind(BinaryOperator,'\\to ','→'); |
| |
| LatexCmds.rarr = LatexCmds.rightarrow = bind(VanillaSymbol,'\\rightarrow ','→'); |
| |
| LatexCmds.implies = bind(BinaryOperator,'\\Rightarrow ','⇒'); |
| |
| LatexCmds.rArr = LatexCmds.Rightarrow = bind(VanillaSymbol,'\\Rightarrow ','⇒'); |
| |
| LatexCmds.gets = bind(BinaryOperator,'\\gets ','←'); |
| |
| LatexCmds.larr = LatexCmds.leftarrow = bind(VanillaSymbol,'\\leftarrow ','←'); |
| |
| LatexCmds.impliedby = bind(BinaryOperator,'\\Leftarrow ','⇐'); |
| |
| LatexCmds.lArr = LatexCmds.Leftarrow = bind(VanillaSymbol,'\\Leftarrow ','⇐'); |
| |
| LatexCmds.harr = LatexCmds.lrarr = LatexCmds.leftrightarrow = |
| bind(VanillaSymbol,'\\leftrightarrow ','↔'); |
| |
| LatexCmds.iff = bind(BinaryOperator,'\\Leftrightarrow ','⇔'); |
| |
| LatexCmds.hArr = LatexCmds.lrArr = LatexCmds.Leftrightarrow = |
| bind(VanillaSymbol,'\\Leftrightarrow ','⇔'); |
| |
| LatexCmds.Re = LatexCmds.Real = LatexCmds.real = bind(VanillaSymbol,'\\Re ','ℜ'); |
| |
| LatexCmds.Im = LatexCmds.imag = |
| LatexCmds.image = LatexCmds.imagin = LatexCmds.imaginary = LatexCmds.Imaginary = |
| bind(VanillaSymbol,'\\Im ','ℑ'); |
| |
| LatexCmds.part = LatexCmds.partial = bind(VanillaSymbol,'\\partial ','∂'); |
| |
| LatexCmds.infty = LatexCmds.infin = LatexCmds.infinity = |
| bind(VanillaSymbol,'\\infty ','∞'); |
| |
| LatexCmds.alef = LatexCmds.alefsym = LatexCmds.aleph = LatexCmds.alephsym = |
| bind(VanillaSymbol,'\\aleph ','ℵ'); |
| |
| LatexCmds.xist = //LOL |
| LatexCmds.xists = LatexCmds.exist = LatexCmds.exists = |
| bind(VanillaSymbol,'\\exists ','∃'); |
| |
| LatexCmds.nexists = LatexCmds.nexist = |
| bind(VanillaSymbol, '\\nexists ', '∄'); |
| |
| LatexCmds.and = LatexCmds.land = LatexCmds.wedge = |
| bind(VanillaSymbol,'\\wedge ','∧'); |
| |
| LatexCmds.or = LatexCmds.lor = LatexCmds.vee = bind(VanillaSymbol,'\\vee ','∨'); |
| |
| LatexCmds.o = LatexCmds.O = |
| LatexCmds.empty = LatexCmds.emptyset = |
| LatexCmds.oslash = LatexCmds.Oslash = |
| LatexCmds.nothing = LatexCmds.varnothing = |
| bind(BinaryOperator,'\\varnothing ','∅'); |
| |
| LatexCmds.cup = LatexCmds.union = bind(BinaryOperator,'\\cup ','∪'); |
| |
| LatexCmds.cap = LatexCmds.intersect = LatexCmds.intersection = |
| bind(BinaryOperator,'\\cap ','∩'); |
| |
| // FIXME: the correct LaTeX would be ^\circ but we can't parse that |
| LatexCmds.deg = LatexCmds.degree = bind(VanillaSymbol,'\\degree ','°'); |
| |
| LatexCmds.ang = LatexCmds.angle = bind(VanillaSymbol,'\\angle ','∠'); |
| LatexCmds.measuredangle = bind(VanillaSymbol,'\\measuredangle ','∡'); |