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 * Predefined macros for KaTeX.3 * This can be used to define some commands in terms of others.4 */5 6// Export global macros object from defineMacro7import defineMacro, {_macros} from "./defineMacro";8const macros = _macros;9export default macros;10 11import fontMetricsData from "./fontMetricsData";12import functions from "./functions";13import symbols from "./symbols";14import {makeEm} from "./units";15import ParseError from "./ParseError";16 17import type {MacroContextInterface} from "./defineMacro";18 19//////////////////////////////////////////////////////////////////////20// macro tools21 22defineMacro("\\noexpand", function(context) {23 // The expansion is the token itself; but that token is interpreted24 // as if its meaning were ‘\relax’ if it is a control sequence that25 // would ordinarily be expanded by TeX’s expansion rules.26 const t = context.popToken();27 if (context.isExpandable(t.text)) {28 t.noexpand = true;29 t.treatAsRelax = true;30 }31 return {tokens: [t], numArgs: 0};32});33 34defineMacro("\\expandafter", function(context) {35 // TeX first reads the token that comes immediately after \expandafter,36 // without expanding it; let’s call this token t. Then TeX reads the37 // token that comes after t (and possibly more tokens, if that token38 // has an argument), replacing it by its expansion. Finally TeX puts39 // t back in front of that expansion.40 const t = context.popToken();41 context.expandOnce(true); // expand only an expandable token42 return {tokens: [t], numArgs: 0};43});44 45// LaTeX's \@firstoftwo{#1}{#2} expands to #1, skipping #246// TeX source: \long\def\@firstoftwo#1#2{#1}47defineMacro("\\@firstoftwo", function(context) {48 const args = context.consumeArgs(2);49 return {tokens: args[0], numArgs: 0};50});51 52// LaTeX's \@secondoftwo{#1}{#2} expands to #2, skipping #153// TeX source: \long\def\@secondoftwo#1#2{#2}54defineMacro("\\@secondoftwo", function(context) {55 const args = context.consumeArgs(2);56 return {tokens: args[1], numArgs: 0};57});58 59// LaTeX's \@ifnextchar{#1}{#2}{#3} looks ahead to the next (unexpanded)60// symbol that isn't a space, consuming any spaces but not consuming the61// first nonspace character. If that nonspace character matches #1, then62// the macro expands to #2; otherwise, it expands to #3.63defineMacro("\\@ifnextchar", function(context) {64 const args = context.consumeArgs(3); // symbol, if, else65 context.consumeSpaces();66 const nextToken = context.future();67 if (args[0].length === 1 && args[0][0].text === nextToken.text) {68 return {tokens: args[1], numArgs: 0};69 } else {70 return {tokens: args[2], numArgs: 0};71 }72});73 74// LaTeX's \@ifstar{#1}{#2} looks ahead to the next (unexpanded) symbol.75// If it is `*`, then it consumes the symbol, and the macro expands to #1;76// otherwise, the macro expands to #2 (without consuming the symbol).77// TeX source: \def\@ifstar#1{\@ifnextchar *{\@firstoftwo{#1}}}78defineMacro("\\@ifstar", "\\@ifnextchar *{\\@firstoftwo{#1}}");79 80// LaTeX's \TextOrMath{#1}{#2} expands to #1 in text mode, #2 in math mode81defineMacro("\\TextOrMath", function(context) {82 const args = context.consumeArgs(2);83 if (context.mode === 'text') {84 return {tokens: args[0], numArgs: 0};85 } else {86 return {tokens: args[1], numArgs: 0};87 }88});89 90// Lookup table for parsing numbers in base 8 through 1691const digitToNumber: Record<string, number> = {92 "0": 0, "1": 1, "2": 2, "3": 3, "4": 4, "5": 5, "6": 6, "7": 7, "8": 8,93 "9": 9, "a": 10, "A": 10, "b": 11, "B": 11, "c": 12, "C": 12,94 "d": 13, "D": 13, "e": 14, "E": 14, "f": 15, "F": 15,95};96 97// TeX \char makes a literal character (catcode 12) using the following forms:98// (see The TeXBook, p. 43)99// \char123 -- decimal100// \char'123 -- octal101// \char"123 -- hex102// \char`x -- character that can be written (i.e. isn't active)103// \char`\x -- character that cannot be written (e.g. %)104// These all refer to characters from the font, so we turn them into special105// calls to a function \@char dealt with in the Parser.106defineMacro("\\char", function(context) {107 let token = context.popToken();108 let base;109 let number = 0;110 if (token.text === "'") {111 base = 8;112 token = context.popToken();113 } else if (token.text === '"') {114 base = 16;115 token = context.popToken();116 } else if (token.text === "`") {117 token = context.popToken();118 if (token.text[0] === "\\") {119 number = token.text.charCodeAt(1);120 } else if (token.text === "EOF") {121 throw new ParseError("\\char` missing argument");122 } else {123 number = token.text.charCodeAt(0);124 }125 } else {126 base = 10;127 }128 if (base) {129 // Parse a number in the given base, starting with first `token`.130 number = digitToNumber[token.text];131 if (number == null || number >= base) {132 throw new ParseError(`Invalid base-${base} digit ${token.text}`);133 }134 let digit;135 while ((digit = digitToNumber[context.future().text]) != null &&136 digit < base) {137 number *= base;138 number += digit;139 context.popToken();140 }141 }142 return `\\@char{${number}}`;143});144 145// \newcommand{\macro}[args]{definition}146// \renewcommand{\macro}[args]{definition}147// TODO: Optional arguments: \newcommand{\macro}[args][default]{definition}148const newcommand = (149 context: MacroContextInterface,150 existsOK: boolean,151 nonexistsOK: boolean,152 skipIfExists: boolean,153) => {154 let arg = context.consumeArg().tokens;155 if (arg.length !== 1) {156 throw new ParseError(157 "\\newcommand's first argument must be a macro name");158 }159 const name = arg[0].text;160 161 const exists = context.isDefined(name);162 if (exists && !existsOK) {163 throw new ParseError(`\\newcommand{${name}} attempting to redefine ` +164 `${name}; use \\renewcommand`);165 }166 if (!exists && !nonexistsOK) {167 throw new ParseError(`\\renewcommand{${name}} when command ${name} ` +168 `does not yet exist; use \\newcommand`);169 }170 171 let numArgs = 0;172 arg = context.consumeArg().tokens;173 if (arg.length === 1 && arg[0].text === "[") {174 let argText = '';175 let token = context.expandNextToken();176 while (token.text !== "]" && token.text !== "EOF") {177 // TODO: Should properly expand arg, e.g., ignore {}s178 argText += token.text;179 token = context.expandNextToken();180 }181 if (!argText.match(/^\s*[0-9]+\s*$/)) {182 throw new ParseError(`Invalid number of arguments: ${argText}`);183 }184 numArgs = parseInt(argText);185 arg = context.consumeArg().tokens;186 }187 188 if (!(exists && skipIfExists)) {189 // Final arg is the expansion of the macro190 context.macros.set(name, {191 tokens: arg,192 numArgs,193 });194 }195 return '';196};197defineMacro("\\newcommand",198 (context) => newcommand(context, false, true, false));199defineMacro("\\renewcommand",200 (context) => newcommand(context, true, false, false));201defineMacro("\\providecommand",202 (context) => newcommand(context, true, true, true));203 204// terminal (console) tools205defineMacro("\\message", (context) => {206 const arg = context.consumeArgs(1)[0];207 // eslint-disable-next-line no-console208 console.log(arg.reverse().map(token => token.text).join(""));209 return '';210});211defineMacro("\\errmessage", (context) => {212 const arg = context.consumeArgs(1)[0];213 // eslint-disable-next-line no-console214 console.error(arg.reverse().map(token => token.text).join(""));215 return '';216});217defineMacro("\\show", (context) => {218 const tok = context.popToken();219 const name = tok.text;220 // eslint-disable-next-line no-console221 console.log(tok, context.macros.get(name), functions[name],222 symbols.math[name], symbols.text[name]);223 return '';224});225 226//////////////////////////////////////////////////////////////////////227// Grouping228// \let\bgroup={ \let\egroup=}229defineMacro("\\bgroup", "{");230defineMacro("\\egroup", "}");231 232// Symbols from latex.ltx:233// \def~{\nobreakspace{}}234// \def\lq{`}235// \def\rq{'}236// \def \aa {\r a}237// \def \AA {\r A}238defineMacro("~", "\\nobreakspace");239defineMacro("\\lq", "`");240defineMacro("\\rq", "'");241defineMacro("\\aa", "\\r a");242defineMacro("\\AA", "\\r A");243 244// Copyright (C) and registered (R) symbols. Use raw symbol in MathML.245// \DeclareTextCommandDefault{\textcopyright}{\textcircled{c}}246// \DeclareTextCommandDefault{\textregistered}{\textcircled{%247// \check@mathfonts\fontsize\sf@size\z@\math@fontsfalse\selectfont R}}248// \DeclareRobustCommand{\copyright}{%249// \ifmmode{\nfss@text{\textcopyright}}\else\textcopyright\fi}250defineMacro("\\textcopyright", "\\html@mathml{\\textcircled{c}}{\\char`©}");251defineMacro("\\copyright",252 "\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");253defineMacro("\\textregistered",254 "\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");255 256// Characters omitted from Unicode range 1D400–1D7FF257defineMacro("\u212C", "\\mathscr{B}"); // script258defineMacro("\u2130", "\\mathscr{E}");259defineMacro("\u2131", "\\mathscr{F}");260defineMacro("\u210B", "\\mathscr{H}");261defineMacro("\u2110", "\\mathscr{I}");262defineMacro("\u2112", "\\mathscr{L}");263defineMacro("\u2133", "\\mathscr{M}");264defineMacro("\u211B", "\\mathscr{R}");265defineMacro("\u212D", "\\mathfrak{C}"); // Fraktur266defineMacro("\u210C", "\\mathfrak{H}");267defineMacro("\u2128", "\\mathfrak{Z}");268 269// Define \Bbbk with a macro that works in both HTML and MathML.270defineMacro("\\Bbbk", "\\Bbb{k}");271 272// \llap and \rlap render their contents in text mode273defineMacro("\\llap", "\\mathllap{\\textrm{#1}}");274defineMacro("\\rlap", "\\mathrlap{\\textrm{#1}}");275defineMacro("\\clap", "\\mathclap{\\textrm{#1}}");276 277// \mathstrut from the TeXbook, p 360278defineMacro("\\mathstrut", "\\vphantom{(}");279 280// \underbar from TeXbook p 353281defineMacro("\\underbar", "\\underline{\\text{#1}}");282 283// \not is defined by base/fontmath.ltx via284// \DeclareMathSymbol{\not}{\mathrel}{symbols}{"36}285// It's thus treated like a \mathrel, but defined by a symbol that has zero286// width but extends to the right. We use \rlap to get that spacing.287// For MathML we write U+0338 here. buildMathML.js will then do the overlay.288defineMacro("\\not", "\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}" +289 "{\\char\"338}");290 291// Negated symbols from base/fontmath.ltx:292// \def\neq{\not=} \let\ne=\neq293// \DeclareRobustCommand294// \notin{\mathrel{\m@th\mathpalette\c@ncel\in}}295// \def\c@ncel#1#2{\m@th\ooalign{$\hfil#1\mkern1mu/\hfil$\crcr$#1#2$}}296defineMacro("\\neq", "\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");297defineMacro("\\ne", "\\neq");298defineMacro("\u2260", "\\neq");299defineMacro("\\notin", "\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}"300 + "{\\mathrel{\\char`∉}}");301defineMacro("\u2209", "\\notin");302 303// Unicode stacked relations304defineMacro("\u2258", "\\html@mathml{" +305 "\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}" +306 "}{\\mathrel{\\char`\u2258}}");307defineMacro("\u2259",308 "\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}");309defineMacro("\u225A",310 "\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225A}}");311defineMacro("\u225B",312 "\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}" +313 "{\\mathrel{\\char`\u225B}}");314defineMacro("\u225D",315 "\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}" +316 "{\\mathrel{\\char`\u225D}}");317defineMacro("\u225E",318 "\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}" +319 "{\\mathrel{\\char`\u225E}}");320defineMacro("\u225F",321 "\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225F}}");322 323// Misc Unicode324defineMacro("\u27C2", "\\perp");325defineMacro("\u203C", "\\mathclose{!\\mkern-0.8mu!}");326defineMacro("\u220C", "\\notni");327defineMacro("\u231C", "\\ulcorner");328defineMacro("\u231D", "\\urcorner");329defineMacro("\u231E", "\\llcorner");330defineMacro("\u231F", "\\lrcorner");331defineMacro("\u00A9", "\\copyright");332defineMacro("\u00AE", "\\textregistered");333 334// The KaTeX fonts have corners at codepoints that don't match Unicode.335// For MathML purposes, use the Unicode code point.336defineMacro("\\ulcorner", "\\html@mathml{\\@ulcorner}{\\mathop{\\char\"231c}}");337defineMacro("\\urcorner", "\\html@mathml{\\@urcorner}{\\mathop{\\char\"231d}}");338defineMacro("\\llcorner", "\\html@mathml{\\@llcorner}{\\mathop{\\char\"231e}}");339defineMacro("\\lrcorner", "\\html@mathml{\\@lrcorner}{\\mathop{\\char\"231f}}");340 341//////////////////////////////////////////////////////////////////////342// LaTeX_2ε343 344// \vdots{\vbox{\baselineskip4\p@ \lineskiplimit\z@345// \kern6\p@\hbox{.}\hbox{.}\hbox{.}}}346// We'll call \varvdots, which gets a glyph from symbols.js.347// The zero-width rule gets us an equivalent to the vertical 6pt kern.348defineMacro("\\vdots", "{\\varvdots\\rule{0pt}{15pt}}");349defineMacro("\u22ee", "\\vdots");350 351//////////////////////////////////////////////////////////////////////352// amsmath.sty353// http://mirrors.concertpass.com/tex-archive/macros/latex/required/amsmath/amsmath.pdf354 355// Italic Greek capital letters. AMS defines these with \DeclareMathSymbol,356// but they are equivalent to \mathit{\Letter}.357defineMacro("\\varGamma", "\\mathit{\\Gamma}");358defineMacro("\\varDelta", "\\mathit{\\Delta}");359defineMacro("\\varTheta", "\\mathit{\\Theta}");360defineMacro("\\varLambda", "\\mathit{\\Lambda}");361defineMacro("\\varXi", "\\mathit{\\Xi}");362defineMacro("\\varPi", "\\mathit{\\Pi}");363defineMacro("\\varSigma", "\\mathit{\\Sigma}");364defineMacro("\\varUpsilon", "\\mathit{\\Upsilon}");365defineMacro("\\varPhi", "\\mathit{\\Phi}");366defineMacro("\\varPsi", "\\mathit{\\Psi}");367defineMacro("\\varOmega", "\\mathit{\\Omega}");368 369//\newcommand{\substack}[1]{\subarray{c}#1\endsubarray}370defineMacro("\\substack", "\\begin{subarray}{c}#1\\end{subarray}");371 372// \renewcommand{\colon}{\nobreak\mskip2mu\mathpunct{}\nonscript373// \mkern-\thinmuskip{:}\mskip6muplus1mu\relax}374defineMacro("\\colon", "\\nobreak\\mskip2mu\\mathpunct{}" +375 "\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");376 377// \newcommand{\boxed}[1]{\fbox{\m@th$\displaystyle#1$}}378defineMacro("\\boxed", "\\fbox{$\\displaystyle{#1}$}");379 380// \def\iff{\DOTSB\;\Longleftrightarrow\;}381// \def\implies{\DOTSB\;\Longrightarrow\;}382// \def\impliedby{\DOTSB\;\Longleftarrow\;}383defineMacro("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;");384defineMacro("\\implies", "\\DOTSB\\;\\Longrightarrow\\;");385defineMacro("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;");386 387// \def\dddot#1{{\mathop{#1}\limits^{\vbox to-1.4\ex@{\kern-\tw@\ex@388// \hbox{\normalfont ...}\vss}}}}389// We use \overset which avoids the vertical shift of \mathop.390defineMacro("\\dddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");391defineMacro("\\ddddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");392 393// AMSMath's automatic \dots, based on \mdots@@ macro.394const dotsByToken: Record<string, string> = {395 ',': '\\dotsc',396 '\\not': '\\dotsb',397 // \keybin@ checks for the following:398 '+': '\\dotsb',399 '=': '\\dotsb',400 '<': '\\dotsb',401 '>': '\\dotsb',402 '-': '\\dotsb',403 '*': '\\dotsb',404 ':': '\\dotsb',405 // Symbols whose definition starts with \DOTSB:406 '\\DOTSB': '\\dotsb',407 '\\coprod': '\\dotsb',408 '\\bigvee': '\\dotsb',409 '\\bigwedge': '\\dotsb',410 '\\biguplus': '\\dotsb',411 '\\bigcap': '\\dotsb',412 '\\bigcup': '\\dotsb',413 '\\prod': '\\dotsb',414 '\\sum': '\\dotsb',415 '\\bigotimes': '\\dotsb',416 '\\bigoplus': '\\dotsb',417 '\\bigodot': '\\dotsb',418 '\\bigsqcup': '\\dotsb',419 '\\And': '\\dotsb',420 '\\longrightarrow': '\\dotsb',421 '\\Longrightarrow': '\\dotsb',422 '\\longleftarrow': '\\dotsb',423 '\\Longleftarrow': '\\dotsb',424 '\\longleftrightarrow': '\\dotsb',425 '\\Longleftrightarrow': '\\dotsb',426 '\\mapsto': '\\dotsb',427 '\\longmapsto': '\\dotsb',428 '\\hookrightarrow': '\\dotsb',429 '\\doteq': '\\dotsb',430 // Symbols whose definition starts with \mathbin:431 '\\mathbin': '\\dotsb',432 // Symbols whose definition starts with \mathrel:433 '\\mathrel': '\\dotsb',434 '\\relbar': '\\dotsb',435 '\\Relbar': '\\dotsb',436 '\\xrightarrow': '\\dotsb',437 '\\xleftarrow': '\\dotsb',438 // Symbols whose definition starts with \DOTSI:439 '\\DOTSI': '\\dotsi',440 '\\int': '\\dotsi',441 '\\oint': '\\dotsi',442 '\\iint': '\\dotsi',443 '\\iiint': '\\dotsi',444 '\\iiiint': '\\dotsi',445 '\\idotsint': '\\dotsi',446 // Symbols whose definition starts with \DOTSX:447 '\\DOTSX': '\\dotsx',448};449 450const dotsbGroups = new Set(['bin', 'rel']);451 452defineMacro("\\dots", function(context) {453 // TODO: If used in text mode, should expand to \textellipsis.454 // However, in KaTeX, \textellipsis and \ldots behave the same455 // (in text mode), and it's unlikely we'd see any of the math commands456 // that affect the behavior of \dots when in text mode. So fine for now457 // (until we support \ifmmode ... \else ... \fi).458 let thedots = '\\dotso';459 const next = context.expandAfterFuture().text;460 if (next in dotsByToken) {461 thedots = dotsByToken[next];462 } else if (next.slice(0, 4) === '\\not') {463 thedots = '\\dotsb';464 } else if (next in symbols.math) {465 if (dotsbGroups.has(symbols.math[next].group)) {466 thedots = '\\dotsb';467 }468 }469 return thedots;470});471 472const spaceAfterDots = {473 // \rightdelim@ checks for the following:474 ')': true,475 ']': true,476 '\\rbrack': true,477 '\\}': true,478 '\\rbrace': true,479 '\\rangle': true,480 '\\rceil': true,481 '\\rfloor': true,482 '\\rgroup': true,483 '\\rmoustache': true,484 '\\right': true,485 '\\bigr': true,486 '\\biggr': true,487 '\\Bigr': true,488 '\\Biggr': true,489 // \extra@ also tests for the following:490 '$': true,491 // \extrap@ checks for the following:492 ';': true,493 '.': true,494 ',': true,495};496 497defineMacro("\\dotso", function(context) {498 const next = context.future().text;499 if (next in spaceAfterDots) {500 return "\\ldots\\,";501 } else {502 return "\\ldots";503 }504});505 506defineMacro("\\dotsc", function(context) {507 const next = context.future().text;508 // \dotsc uses \extra@ but not \extrap@, instead specially checking for509 // ';' and '.', but doesn't check for ','.510 if (next in spaceAfterDots && next !== ',') {511 return "\\ldots\\,";512 } else {513 return "\\ldots";514 }515});516 517defineMacro("\\cdots", function(context) {518 const next = context.future().text;519 if (next in spaceAfterDots) {520 return "\\@cdots\\,";521 } else {522 return "\\@cdots";523 }524});525 526defineMacro("\\dotsb", "\\cdots");527defineMacro("\\dotsm", "\\cdots");528defineMacro("\\dotsi", "\\!\\cdots");529// amsmath doesn't actually define \dotsx, but \dots followed by a macro530// starting with \DOTSX implies \dotso, and then \extra@ detects this case531// and forces the added `\,`.532defineMacro("\\dotsx", "\\ldots\\,");533 534// \let\DOTSI\relax535// \let\DOTSB\relax536// \let\DOTSX\relax537defineMacro("\\DOTSI", "\\relax");538defineMacro("\\DOTSB", "\\relax");539defineMacro("\\DOTSX", "\\relax");540 541// Spacing, based on amsmath.sty's override of LaTeX defaults542// \DeclareRobustCommand{\tmspace}[3]{%543// \ifmmode\mskip#1#2\else\kern#1#3\fi\relax}544defineMacro("\\tmspace", "\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");545// \renewcommand{\,}{\tmspace+\thinmuskip{.1667em}}546// TODO: math mode should use \thinmuskip547defineMacro("\\,", "\\tmspace+{3mu}{.1667em}");548// \let\thinspace\,549defineMacro("\\thinspace", "\\,");550// \def\>{\mskip\medmuskip}551// \renewcommand{\:}{\tmspace+\medmuskip{.2222em}}552// TODO: \> and math mode of \: should use \medmuskip = 4mu plus 2mu minus 4mu553defineMacro("\\>", "\\mskip{4mu}");554defineMacro("\\:", "\\tmspace+{4mu}{.2222em}");555// \let\medspace\:556defineMacro("\\medspace", "\\:");557// \renewcommand{\;}{\tmspace+\thickmuskip{.2777em}}558// TODO: math mode should use \thickmuskip = 5mu plus 5mu559defineMacro("\\;", "\\tmspace+{5mu}{.2777em}");560// \let\thickspace\;561defineMacro("\\thickspace", "\\;");562// \renewcommand{\!}{\tmspace-\thinmuskip{.1667em}}563// TODO: math mode should use \thinmuskip564defineMacro("\\!", "\\tmspace-{3mu}{.1667em}");565// \let\negthinspace\!566defineMacro("\\negthinspace", "\\!");567// \newcommand{\negmedspace}{\tmspace-\medmuskip{.2222em}}568// TODO: math mode should use \medmuskip569defineMacro("\\negmedspace", "\\tmspace-{4mu}{.2222em}");570// \newcommand{\negthickspace}{\tmspace-\thickmuskip{.2777em}}571// TODO: math mode should use \thickmuskip572defineMacro("\\negthickspace", "\\tmspace-{5mu}{.277em}");573// \def\enspace{\kern.5em }574defineMacro("\\enspace", "\\kern.5em ");575// \def\enskip{\hskip.5em\relax}576defineMacro("\\enskip", "\\hskip.5em\\relax");577// \def\quad{\hskip1em\relax}578defineMacro("\\quad", "\\hskip1em\\relax");579// \def\qquad{\hskip2em\relax}580defineMacro("\\qquad", "\\hskip2em\\relax");581 582// \tag@in@display form of \tag583defineMacro("\\tag", "\\@ifstar\\tag@literal\\tag@paren");584defineMacro("\\tag@paren", "\\tag@literal{({#1})}");585defineMacro("\\tag@literal", (context) => {586 if (context.macros.get("\\df@tag")) {587 throw new ParseError("Multiple \\tag");588 }589 return "\\gdef\\df@tag{\\text{#1}}";590});591 592// \renewcommand{\bmod}{\nonscript\mskip-\medmuskip\mkern5mu\mathbin593// {\operator@font mod}\penalty900594// \mkern5mu\nonscript\mskip-\medmuskip}595// \newcommand{\pod}[1]{\allowbreak596// \if@display\mkern18mu\else\mkern8mu\fi(#1)}597// \renewcommand{\pmod}[1]{\pod{{\operator@font mod}\mkern6mu#1}}598// \newcommand{\mod}[1]{\allowbreak\if@display\mkern18mu599// \else\mkern12mu\fi{\operator@font mod}\,\,#1}600// TODO: math mode should use \medmuskip = 4mu plus 2mu minus 4mu601defineMacro("\\bmod",602 "\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}" +603 "\\mathbin{\\rm mod}" +604 "\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");605defineMacro("\\pod", "\\allowbreak" +606 "\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");607defineMacro("\\pmod", "\\pod{{\\rm mod}\\mkern6mu#1}");608defineMacro("\\mod", "\\allowbreak" +609 "\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}" +610 "{\\rm mod}\\,\\,#1");611 612//////////////////////////////////////////////////////////////////////613// LaTeX source2e614 615// \expandafter\let\expandafter\@normalcr616// \csname\expandafter\@gobble\string\\ \endcsname617// \DeclareRobustCommand\newline{\@normalcr\relax}618defineMacro("\\newline", "\\\\\\relax");619 620// \def\TeX{T\kern-.1667em\lower.5ex\hbox{E}\kern-.125emX\@}621// TODO: Doesn't normally work in math mode because \@ fails. KaTeX doesn't622// support \@ yet, so that's omitted, and we add \text so that the result623// doesn't look funny in math mode.624defineMacro("\\TeX", "\\textrm{\\html@mathml{" +625 "T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX" +626 "}{TeX}}");627 628// \DeclareRobustCommand{\LaTeX}{L\kern-.36em%629// {\sbox\z@ T%630// \vbox to\ht\z@{\hbox{\check@mathfonts631// \fontsize\sf@size\z@632// \math@fontsfalse\selectfont633// A}%634// \vss}%635// }%636// \kern-.15em%637// \TeX}638// This code aligns the top of the A with the T (from the perspective of TeX's639// boxes, though visually the A appears to extend above slightly).640// We compute the corresponding \raisebox when A is rendered in \normalsize641// \scriptstyle, which has a scale factor of 0.7 (see Options.js).642const latexRaiseA = makeEm(fontMetricsData['Main-Regular']["T".charCodeAt(0)][1] -643 0.7 * fontMetricsData['Main-Regular']["A".charCodeAt(0)][1]);644defineMacro("\\LaTeX", "\\textrm{\\html@mathml{" +645 `L\\kern-.36em\\raisebox{${latexRaiseA}}{\\scriptstyle A}` +646 "\\kern-.15em\\TeX}{LaTeX}}");647 648// New KaTeX logo based on tweaking LaTeX logo649defineMacro("\\KaTeX", "\\textrm{\\html@mathml{" +650 `K\\kern-.17em\\raisebox{${latexRaiseA}}{\\scriptstyle A}` +651 "\\kern-.15em\\TeX}{KaTeX}}");652 653// \DeclareRobustCommand\hspace{\@ifstar\@hspacer\@hspace}654// \def\@hspace#1{\hskip #1\relax}655// \def\@hspacer#1{\vrule \@width\z@\nobreak656// \hskip #1\hskip \z@skip}657defineMacro("\\hspace", "\\@ifstar\\@hspacer\\@hspace");658defineMacro("\\@hspace", "\\hskip #1\\relax");659defineMacro("\\@hspacer", "\\rule{0pt}{0pt}\\hskip #1\\relax");660 661//////////////////////////////////////////////////////////////////////662// mathtools.sty663 664//\providecommand\ordinarycolon{:}665defineMacro("\\ordinarycolon", ":");666//\def\vcentcolon{\mathrel{\mathop\ordinarycolon}}667//TODO(edemaine): Not yet centered. Fix via \raisebox or #726668defineMacro("\\vcentcolon", "\\mathrel{\\mathop\\ordinarycolon}");669// \providecommand*\dblcolon{\vcentcolon\mathrel{\mkern-.9mu}\vcentcolon}670defineMacro("\\dblcolon", "\\html@mathml{" +671 "\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}" +672 "{\\mathop{\\char\"2237}}");673// \providecommand*\coloneqq{\vcentcolon\mathrel{\mkern-1.2mu}=}674defineMacro("\\coloneqq", "\\html@mathml{" +675 "\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}" +676 "{\\mathop{\\char\"2254}}"); // ≔677// \providecommand*\Coloneqq{\dblcolon\mathrel{\mkern-1.2mu}=}678defineMacro("\\Coloneqq", "\\html@mathml{" +679 "\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}" +680 "{\\mathop{\\char\"2237\\char\"3d}}");681// \providecommand*\coloneq{\vcentcolon\mathrel{\mkern-1.2mu}\mathrel{-}}682defineMacro("\\coloneq", "\\html@mathml{" +683 "\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}" +684 "{\\mathop{\\char\"3a\\char\"2212}}");685// \providecommand*\Coloneq{\dblcolon\mathrel{\mkern-1.2mu}\mathrel{-}}686defineMacro("\\Coloneq", "\\html@mathml{" +687 "\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}" +688 "{\\mathop{\\char\"2237\\char\"2212}}");689// \providecommand*\eqqcolon{=\mathrel{\mkern-1.2mu}\vcentcolon}690defineMacro("\\eqqcolon", "\\html@mathml{" +691 "\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}" +692 "{\\mathop{\\char\"2255}}"); // ≕693// \providecommand*\Eqqcolon{=\mathrel{\mkern-1.2mu}\dblcolon}694defineMacro("\\Eqqcolon", "\\html@mathml{" +695 "\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}" +696 "{\\mathop{\\char\"3d\\char\"2237}}");697// \providecommand*\eqcolon{\mathrel{-}\mathrel{\mkern-1.2mu}\vcentcolon}698defineMacro("\\eqcolon", "\\html@mathml{" +699 "\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}" +700 "{\\mathop{\\char\"2239}}");701// \providecommand*\Eqcolon{\mathrel{-}\mathrel{\mkern-1.2mu}\dblcolon}702defineMacro("\\Eqcolon", "\\html@mathml{" +703 "\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}" +704 "{\\mathop{\\char\"2212\\char\"2237}}");705// \providecommand*\colonapprox{\vcentcolon\mathrel{\mkern-1.2mu}\approx}706defineMacro("\\colonapprox", "\\html@mathml{" +707 "\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}" +708 "{\\mathop{\\char\"3a\\char\"2248}}");709// \providecommand*\Colonapprox{\dblcolon\mathrel{\mkern-1.2mu}\approx}710defineMacro("\\Colonapprox", "\\html@mathml{" +711 "\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}" +712 "{\\mathop{\\char\"2237\\char\"2248}}");713// \providecommand*\colonsim{\vcentcolon\mathrel{\mkern-1.2mu}\sim}714defineMacro("\\colonsim", "\\html@mathml{" +715 "\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}" +716 "{\\mathop{\\char\"3a\\char\"223c}}");717// \providecommand*\Colonsim{\dblcolon\mathrel{\mkern-1.2mu}\sim}718defineMacro("\\Colonsim", "\\html@mathml{" +719 "\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}" +720 "{\\mathop{\\char\"2237\\char\"223c}}");721 722// Some Unicode characters are implemented with macros to mathtools functions.723defineMacro("\u2237", "\\dblcolon"); // ::724defineMacro("\u2239", "\\eqcolon"); // -:725defineMacro("\u2254", "\\coloneqq"); // :=726defineMacro("\u2255", "\\eqqcolon"); // =:727defineMacro("\u2A74", "\\Coloneqq"); // ::=728 729//////////////////////////////////////////////////////////////////////730// colonequals.sty731 732// Alternate names for mathtools's macros:733defineMacro("\\ratio", "\\vcentcolon");734defineMacro("\\coloncolon", "\\dblcolon");735defineMacro("\\colonequals", "\\coloneqq");736defineMacro("\\coloncolonequals", "\\Coloneqq");737defineMacro("\\equalscolon", "\\eqqcolon");738defineMacro("\\equalscoloncolon", "\\Eqqcolon");739defineMacro("\\colonminus", "\\coloneq");740defineMacro("\\coloncolonminus", "\\Coloneq");741defineMacro("\\minuscolon", "\\eqcolon");742defineMacro("\\minuscoloncolon", "\\Eqcolon");743// \colonapprox name is same in mathtools and colonequals.744defineMacro("\\coloncolonapprox", "\\Colonapprox");745// \colonsim name is same in mathtools and colonequals.746defineMacro("\\coloncolonsim", "\\Colonsim");747 748// Additional macros, implemented by analogy with mathtools definitions:749defineMacro("\\simcolon",750 "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");751defineMacro("\\simcoloncolon",752 "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");753defineMacro("\\approxcolon",754 "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");755defineMacro("\\approxcoloncolon",756 "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");757 758// Present in newtxmath, pxfonts and txfonts759defineMacro("\\notni", "\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220C}}");760defineMacro("\\limsup", "\\DOTSB\\operatorname*{lim\\,sup}");761defineMacro("\\liminf", "\\DOTSB\\operatorname*{lim\\,inf}");762 763//////////////////////////////////////////////////////////////////////764// From amsopn.sty765defineMacro("\\injlim", "\\DOTSB\\operatorname*{inj\\,lim}");766defineMacro("\\projlim", "\\DOTSB\\operatorname*{proj\\,lim}");767defineMacro("\\varlimsup", "\\DOTSB\\operatorname*{\\overline{lim}}");768defineMacro("\\varliminf", "\\DOTSB\\operatorname*{\\underline{lim}}");769defineMacro("\\varinjlim", "\\DOTSB\\operatorname*{\\underrightarrow{lim}}");770defineMacro("\\varprojlim", "\\DOTSB\\operatorname*{\\underleftarrow{lim}}");771 772//////////////////////////////////////////////////////////////////////773// MathML alternates for KaTeX glyphs in the Unicode private area774defineMacro("\\gvertneqq", "\\html@mathml{\\@gvertneqq}{\u2269}");775defineMacro("\\lvertneqq", "\\html@mathml{\\@lvertneqq}{\u2268}");776defineMacro("\\ngeqq", "\\html@mathml{\\@ngeqq}{\u2271}");777defineMacro("\\ngeqslant", "\\html@mathml{\\@ngeqslant}{\u2271}");778defineMacro("\\nleqq", "\\html@mathml{\\@nleqq}{\u2270}");779defineMacro("\\nleqslant", "\\html@mathml{\\@nleqslant}{\u2270}");780defineMacro("\\nshortmid", "\\html@mathml{\\@nshortmid}{∤}");781defineMacro("\\nshortparallel", "\\html@mathml{\\@nshortparallel}{∦}");782defineMacro("\\nsubseteqq", "\\html@mathml{\\@nsubseteqq}{\u2288}");783defineMacro("\\nsupseteqq", "\\html@mathml{\\@nsupseteqq}{\u2289}");784defineMacro("\\varsubsetneq", "\\html@mathml{\\@varsubsetneq}{⊊}");785defineMacro("\\varsubsetneqq", "\\html@mathml{\\@varsubsetneqq}{⫋}");786defineMacro("\\varsupsetneq", "\\html@mathml{\\@varsupsetneq}{⊋}");787defineMacro("\\varsupsetneqq", "\\html@mathml{\\@varsupsetneqq}{⫌}");788defineMacro("\\imath", "\\html@mathml{\\@imath}{\u0131}");789defineMacro("\\jmath", "\\html@mathml{\\@jmath}{\u0237}");790 791//////////////////////////////////////////////////////////////////////792// stmaryrd and semantic793 794// The stmaryrd and semantic packages render the next four items by calling a795// glyph. Those glyphs do not exist in the KaTeX fonts. Hence the macros.796 797defineMacro("\\llbracket", "\\html@mathml{" +798 "\\mathopen{[\\mkern-3.2mu[}}" +799 "{\\mathopen{\\char`\u27e6}}");800defineMacro("\\rrbracket", "\\html@mathml{" +801 "\\mathclose{]\\mkern-3.2mu]}}" +802 "{\\mathclose{\\char`\u27e7}}");803 804defineMacro("\u27e6", "\\llbracket"); // blackboard bold [805defineMacro("\u27e7", "\\rrbracket"); // blackboard bold ]806 807defineMacro("\\lBrace", "\\html@mathml{" +808 "\\mathopen{\\{\\mkern-3.2mu[}}" +809 "{\\mathopen{\\char`\u2983}}");810defineMacro("\\rBrace", "\\html@mathml{" +811 "\\mathclose{]\\mkern-3.2mu\\}}}" +812 "{\\mathclose{\\char`\u2984}}");813 814defineMacro("\u2983", "\\lBrace"); // blackboard bold {815defineMacro("\u2984", "\\rBrace"); // blackboard bold }816 817// TODO: Create variable sized versions of the last two items. I believe that818// will require new font glyphs.819 820// The stmaryrd function `\minuso` provides a "Plimsoll" symbol that821// superimposes the characters \circ and \mathminus. Used in chemistry.822defineMacro("\\minuso", "\\mathbin{\\html@mathml{" +823 "{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}" +824 "{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}" +825 "{\\char`⦵}}");826defineMacro("⦵", "\\minuso");827 828//////////////////////////////////////////////////////////////////////829// texvc.sty830 831// The texvc package contains macros available in mediawiki pages.832// We omit the functions deprecated at833// https://en.wikipedia.org/wiki/Help:Displaying_a_formula#Deprecated_syntax834 835// We also omit texvc's \O, which conflicts with \text{\O}836 837defineMacro("\\darr", "\\downarrow");838defineMacro("\\dArr", "\\Downarrow");839defineMacro("\\Darr", "\\Downarrow");840defineMacro("\\lang", "\\langle");841defineMacro("\\rang", "\\rangle");842defineMacro("\\uarr", "\\uparrow");843defineMacro("\\uArr", "\\Uparrow");844defineMacro("\\Uarr", "\\Uparrow");845defineMacro("\\N", "\\mathbb{N}");846defineMacro("\\R", "\\mathbb{R}");847defineMacro("\\Z", "\\mathbb{Z}");848defineMacro("\\alef", "\\aleph");849defineMacro("\\alefsym", "\\aleph");850defineMacro("\\Alpha", "\\mathrm{A}");851defineMacro("\\Beta", "\\mathrm{B}");852defineMacro("\\bull", "\\bullet");853defineMacro("\\Chi", "\\mathrm{X}");854defineMacro("\\clubs", "\\clubsuit");855defineMacro("\\cnums", "\\mathbb{C}");856defineMacro("\\Complex", "\\mathbb{C}");857defineMacro("\\Dagger", "\\ddagger");858defineMacro("\\diamonds", "\\diamondsuit");859defineMacro("\\empty", "\\emptyset");860defineMacro("\\Epsilon", "\\mathrm{E}");861defineMacro("\\Eta", "\\mathrm{H}");862defineMacro("\\exist", "\\exists");863defineMacro("\\harr", "\\leftrightarrow");864defineMacro("\\hArr", "\\Leftrightarrow");865defineMacro("\\Harr", "\\Leftrightarrow");866defineMacro("\\hearts", "\\heartsuit");867defineMacro("\\image", "\\Im");868defineMacro("\\infin", "\\infty");869defineMacro("\\Iota", "\\mathrm{I}");870defineMacro("\\isin", "\\in");871defineMacro("\\Kappa", "\\mathrm{K}");872defineMacro("\\larr", "\\leftarrow");873defineMacro("\\lArr", "\\Leftarrow");874defineMacro("\\Larr", "\\Leftarrow");875defineMacro("\\lrarr", "\\leftrightarrow");876defineMacro("\\lrArr", "\\Leftrightarrow");877defineMacro("\\Lrarr", "\\Leftrightarrow");878defineMacro("\\Mu", "\\mathrm{M}");879defineMacro("\\natnums", "\\mathbb{N}");880defineMacro("\\Nu", "\\mathrm{N}");881defineMacro("\\Omicron", "\\mathrm{O}");882defineMacro("\\plusmn", "\\pm");883defineMacro("\\rarr", "\\rightarrow");884defineMacro("\\rArr", "\\Rightarrow");885defineMacro("\\Rarr", "\\Rightarrow");886defineMacro("\\real", "\\Re");887defineMacro("\\reals", "\\mathbb{R}");888defineMacro("\\Reals", "\\mathbb{R}");889defineMacro("\\Rho", "\\mathrm{P}");890defineMacro("\\sdot", "\\cdot");891defineMacro("\\sect", "\\S");892defineMacro("\\spades", "\\spadesuit");893defineMacro("\\sub", "\\subset");894defineMacro("\\sube", "\\subseteq");895defineMacro("\\supe", "\\supseteq");896defineMacro("\\Tau", "\\mathrm{T}");897defineMacro("\\thetasym", "\\vartheta");898// TODO: defineMacro("\\varcoppa", "\\\mbox{\\coppa}");899defineMacro("\\weierp", "\\wp");900defineMacro("\\Zeta", "\\mathrm{Z}");901 902//////////////////////////////////////////////////////////////////////903// statmath.sty904// https://ctan.math.illinois.edu/macros/latex/contrib/statmath/statmath.pdf905 906defineMacro("\\argmin", "\\DOTSB\\operatorname*{arg\\,min}");907defineMacro("\\argmax", "\\DOTSB\\operatorname*{arg\\,max}");908defineMacro("\\plim", "\\DOTSB\\mathop{\\operatorname{plim}}\\limits");909 910//////////////////////////////////////////////////////////////////////911// braket.sty912// http://ctan.math.washington.edu/tex-archive/macros/latex/contrib/braket/braket.pdf913 914defineMacro("\\bra", "\\mathinner{\\langle{#1}|}");915defineMacro("\\ket", "\\mathinner{|{#1}\\rangle}");916defineMacro("\\braket", "\\mathinner{\\langle{#1}\\rangle}");917defineMacro("\\Bra", "\\left\\langle#1\\right|");918defineMacro("\\Ket", "\\left|#1\\right\\rangle");919const braketHelper = (one: boolean) => (context: MacroContextInterface) => {920 const left = context.consumeArg().tokens;921 const middle = context.consumeArg().tokens;922 const middleDouble = context.consumeArg().tokens;923 const right = context.consumeArg().tokens;924 const oldMiddle = context.macros.get("|");925 const oldMiddleDouble = context.macros.get("\\|");926 context.macros.beginGroup();927 const midMacro = (double: boolean) => (context: MacroContextInterface) => {928 if (one) {929 // Only modify the first instance of | or \|930 context.macros.set("|", oldMiddle);931 if (middleDouble.length) {932 context.macros.set("\\|", oldMiddleDouble);933 }934 }935 let doubled = double;936 if (!double && middleDouble.length) {937 // Mimic \@ifnextchar938 const nextToken = context.future();939 if (nextToken.text === "|") {940 context.popToken();941 doubled = true;942 }943 }944 return {945 tokens: doubled ? middleDouble : middle,946 numArgs: 0,947 };948 };949 context.macros.set("|", midMacro(false));950 if (middleDouble.length) {951 context.macros.set("\\|", midMacro(true));952 }953 const arg = context.consumeArg().tokens;954 const expanded = context.expandTokens([955 ...right, ...arg, ...left, // reversed956 ]);957 context.macros.endGroup();958 return {959 tokens: expanded.reverse(),960 numArgs: 0,961 };962};963defineMacro("\\bra@ket", braketHelper(false));964defineMacro("\\bra@set", braketHelper(true));965defineMacro("\\Braket", "\\bra@ket{\\left\\langle}" +966 "{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");967defineMacro("\\Set", "\\bra@set{\\left\\{\\:}" +968 "{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");969defineMacro("\\set", "\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");970 // has no support for special || or \|971 972//////////////////////////////////////////////////////////////////////973// actuarialangle.dtx974defineMacro("\\angln", "{\\angl n}");975 976// Custom Khan Academy colors, should be moved to an optional package977defineMacro("\\blue", "\\textcolor{##6495ed}{#1}");978defineMacro("\\orange", "\\textcolor{##ffa500}{#1}");979defineMacro("\\pink", "\\textcolor{##ff00af}{#1}");980defineMacro("\\red", "\\textcolor{##df0030}{#1}");981defineMacro("\\green", "\\textcolor{##28ae7b}{#1}");982defineMacro("\\gray", "\\textcolor{gray}{#1}");983defineMacro("\\purple", "\\textcolor{##9d38bd}{#1}");984defineMacro("\\blueA", "\\textcolor{##ccfaff}{#1}");985defineMacro("\\blueB", "\\textcolor{##80f6ff}{#1}");986defineMacro("\\blueC", "\\textcolor{##63d9ea}{#1}");987defineMacro("\\blueD", "\\textcolor{##11accd}{#1}");988defineMacro("\\blueE", "\\textcolor{##0c7f99}{#1}");989defineMacro("\\tealA", "\\textcolor{##94fff5}{#1}");990defineMacro("\\tealB", "\\textcolor{##26edd5}{#1}");991defineMacro("\\tealC", "\\textcolor{##01d1c1}{#1}");992defineMacro("\\tealD", "\\textcolor{##01a995}{#1}");993defineMacro("\\tealE", "\\textcolor{##208170}{#1}");994defineMacro("\\greenA", "\\textcolor{##b6ffb0}{#1}");995defineMacro("\\greenB", "\\textcolor{##8af281}{#1}");996defineMacro("\\greenC", "\\textcolor{##74cf70}{#1}");997defineMacro("\\greenD", "\\textcolor{##1fab54}{#1}");998defineMacro("\\greenE", "\\textcolor{##0d923f}{#1}");999defineMacro("\\goldA", "\\textcolor{##ffd0a9}{#1}");1000defineMacro("\\goldB", "\\textcolor{##ffbb71}{#1}");1001defineMacro("\\goldC", "\\textcolor{##ff9c39}{#1}");1002defineMacro("\\goldD", "\\textcolor{##e07d10}{#1}");1003defineMacro("\\goldE", "\\textcolor{##a75a05}{#1}");1004defineMacro("\\redA", "\\textcolor{##fca9a9}{#1}");1005defineMacro("\\redB", "\\textcolor{##ff8482}{#1}");1006defineMacro("\\redC", "\\textcolor{##f9685d}{#1}");1007defineMacro("\\redD", "\\textcolor{##e84d39}{#1}");1008defineMacro("\\redE", "\\textcolor{##bc2612}{#1}");1009defineMacro("\\maroonA", "\\textcolor{##ffbde0}{#1}");1010defineMacro("\\maroonB", "\\textcolor{##ff92c6}{#1}");1011defineMacro("\\maroonC", "\\textcolor{##ed5fa6}{#1}");1012defineMacro("\\maroonD", "\\textcolor{##ca337c}{#1}");1013defineMacro("\\maroonE", "\\textcolor{##9e034e}{#1}");1014defineMacro("\\purpleA", "\\textcolor{##ddd7ff}{#1}");1015defineMacro("\\purpleB", "\\textcolor{##c6b9fc}{#1}");1016defineMacro("\\purpleC", "\\textcolor{##aa87ff}{#1}");1017defineMacro("\\purpleD", "\\textcolor{##7854ab}{#1}");1018defineMacro("\\purpleE", "\\textcolor{##543b78}{#1}");1019defineMacro("\\mintA", "\\textcolor{##f5f9e8}{#1}");1020defineMacro("\\mintB", "\\textcolor{##edf2df}{#1}");1021defineMacro("\\mintC", "\\textcolor{##e0e5cc}{#1}");1022defineMacro("\\grayA", "\\textcolor{##f6f7f7}{#1}");1023defineMacro("\\grayB", "\\textcolor{##f0f1f2}{#1}");1024defineMacro("\\grayC", "\\textcolor{##e3e5e6}{#1}");1025defineMacro("\\grayD", "\\textcolor{##d6d8da}{#1}");1026defineMacro("\\grayE", "\\textcolor{##babec2}{#1}");1027defineMacro("\\grayF", "\\textcolor{##888d93}{#1}");1028defineMacro("\\grayG", "\\textcolor{##626569}{#1}");1029defineMacro("\\grayH", "\\textcolor{##3b3e40}{#1}");1030defineMacro("\\grayI", "\\textcolor{##21242c}{#1}");1031defineMacro("\\kaBlue", "\\textcolor{##314453}{#1}");1032defineMacro("\\kaGreen", "\\textcolor{##71B307}{#1}");1033 