Comparing version 0.2.11 to 0.2.12
@@ -1,1 +0,2 @@ | ||
export declare const symbolMap: Map<string, string>; | ||
declare const symbolMap: Map<string, string>; | ||
export { symbolMap }; |
@@ -1,1 +0,1 @@ | ||
var O=new Map([["nonumber",""],["vec","arrow"],["neq","eq.not"],["dot","dot"],["ddot","dot.double"],["doteq","dot(eq)"],["dots","dots.h"],["ldots","dots.h"],["vdots","dots.v"],["ddots","dots.down"],["widehat","hat"],["widetilde","tilde"],["quad","quad"],["qquad","wide"],["overbrace","overbrace"],["underbrace","underbrace"],["overline","overline"],["underline","underline"],["bar","macron"],["dbinom","binom"],["tbinom","binom"],["dfrac","frac"],["tfrac","frac"],["boldsymbol","bold"],["mathbb","bb"],["mathbf","bold"],["mathcal","cal"],["mathit","italic"],["mathfrak","frak"],["mathrm","upright"],["mathsf","sans"],["mathtt","mono"],["rm","upright"],["pmb","bold"],["pm","plus.minus"],["mp","minus.plus"],["oplus","xor"],["boxplus","plus.square"],["otimes","times.circle"],["boxtimes","times.square"],["sim","tilde"],["approx","approx"],["cong","tilde.equiv"],["simeq","tilde.eq"],["asymp","\u224D"],["equiv","equiv"],["propto","prop"],["lfloor","\u230A"],["rfloor","\u230B"],["lceil","\u2308"],["rceil","\u2309"],["gets","arrow.l"],["hookleftarrow","arrow.l.hook"],["leftharpoonup","harpoon.lt"],["leftharpoondown","harpoon.lb"],["rightleftharpoons","harpoons.rtlb"],["longleftarrow","arrow.l.long"],["longrightarrow","arrow.r.long"],["longleftrightarrow","arrow.l.r.long"],["Longleftarrow","arrow.l.double.long"],["Longrightarrow","arrow.r.double.long"],["Longleftrightarrow","arrow.l.r.double.long"],["longmapsto","arrow.r.bar"],["hookrightarrow","arrow.r.hook"],["rightharpoonup","harpoon.rt"],["rightharpoondown","harpoon.rb"],["iff","arrow.l.r.double.long"],["implies","arrow.r.double.long"],["uparrow","arrow.t"],["downarrow","arrow.b"],["updownarrow","arrow.t.b"],["Uparrow","arrow.t.double"],["Downarrow","arrow.b.double"],["Updownarrow","arrow.t.b.double"],["nearrow","arrow.tr"],["searrow","arrow.br"],["swarrow","arrow.bl"],["nwarrow","arrow.tl"],["leadsto","arrow.squiggly"],["leftleftarrows","arrows.ll"],["rightrightarrows","arrows.rr"],["Cap","sect.double"],["Cup","union.double"],["Delta","Delta"],["Gamma","Gamma"],["Join","join"],["Lambda","Lambda"],["Leftarrow","arrow.l.double"],["Leftrightarrow","arrow.l.r.double"],["Longrightarrow","arrow.r.double.long"],["Omega","Omega"],["P","pilcrow"],["Phi","Phi"],["Pi","Pi"],["Psi","Psi"],["Rightarrow","arrow.r.double"],["S","section"],["Sigma","Sigma"],["Theta","Theta"],["aleph","alef"],["alpha","alpha"],["angle","angle"],["approx","approx"],["approxeq","approx.eq"],["ast","ast"],["beta","beta"],["bigcap","sect.big"],["bigcirc","circle.big"],["bigcup","union.big"],["bigodot","dot.circle.big"],["bigoplus","xor.big"],["bigotimes","times.circle.big"],["bigsqcup","union.sq.big"],["bigtriangledown","triangle.b"],["bigtriangleup","triangle.t"],["biguplus","union.plus.big"],["bigvee","or.big"],["bigwedge","and.big"],["bullet","bullet"],["cap","sect"],["cdot","dot.op"],["cdots","dots.c"],["checkmark","checkmark"],["chi","chi"],["circ","circle.small"],["colon","colon"],["cong","tilde.equiv"],["coprod","product.co"],["copyright","copyright"],["cup","union"],["curlyvee","or.curly"],["curlywedge","and.curly"],["dagger","dagger"],["dashv","tack.l"],["ddagger","dagger.double"],["delta","delta"],["ddots","dots.down"],["diamond","diamond"],["div","div"],["divideontimes","times.div"],["dotplus","plus.dot"],["downarrow","arrow.b"],["ell","ell"],["emptyset","nothing"],["epsilon","epsilon.alt"],["equiv","equiv"],["eta","eta"],["exists","exists"],["forall","forall"],["gamma","gamma"],["ge","gt.eq"],["geq","gt.eq"],["geqslant","gt.eq.slant"],["gg","gt.double"],["hbar","planck.reduce"],["imath","dotless.i"],["iiiint","intgral.quad"],["iiint","integral.triple"],["iint","integral.double"],["in","in"],["infty","infinity"],["int","integral"],["intercal","top"],["iota","iota"],["jmath","dotless.j"],["kappa","kappa"],["lambda","lambda"],["land","and"],["langle","angle.l"],["lbrace","brace.l"],["lbrack","bracket.l"],["ldots","dots.l"],["le","lt.eq"],["leadsto","arrow.squiggly"],["leftarrow","arrow.l"],["leftthreetimes","times.three.l"],["leftrightarrow","arrow.l.r"],["leq","lt.eq"],["leqslant","lt.eq.slant"],["lhd","triangle.l"],["ll","lt.double"],["longmapsto","arrow.bar.long"],["longrightarrow","arrow.long"],["lor","or"],["ltimes","times.l"],["mapsto","arrow.bar"],["measuredangle","angle.arc"],["mid","divides"],["models","models"],["mp","minus.plus"],["mu","mu"],["nRightarrow","arrow.double.not"],["nabla","nabla"],["ncong","tilde.nequiv"],["ne","eq.not"],["neg","not"],["neq","eq.not"],["nexists","exists.not"],["ni","in.rev"],["nleftarrow","arrow.l.not"],["nleq","lt.eq.not"],["nparallel","parallel.not"],["ngeq","gt.eq.not"],["nmid","divides.not"],["notin","in.not"],["nrightarrow","arrow.not"],["nsim","tilde.not"],["nsubseteq","subset.eq.not"],["nu","nu"],["ntriangleleft","lt.tri.not"],["ntriangleright","gt.tri.not"],["nwarrow","arrow.tl"],["odot","dot.circle"],["oint","integral.cont"],["oiint","integral.surf"],["oiiint","integral.vol"],["omega","omega"],["ominus","minus.circle"],["oplus","xor"],["otimes","times.circle"],["parallel","parallel"],["partial","diff"],["perp","perp"],["phi","phi.alt"],["pi","pi"],["pm","plus.minus"],["pounds","pound"],["prec","prec"],["preceq","prec.eq"],["prime","prime"],["prod","product"],["propto","prop"],["psi","psi"],["rangle","angle.r"],["rbrace","brace.r"],["rbrack","bracket.r"],["rhd","triangle"],["rho","rho"],["rightarrow","arrow.r"],["rightthreetimes","times.three.r"],["rtimes","times.r"],["setminus","without"],["sigma","sigma"],["sim","tilde"],["simeq","tilde.eq"],["slash","slash"],["smallsetminus","without"],["spadesuit","suit.spade"],["sqcap","sect.sq"],["sqcup","union.sq"],["sqsubseteq","subset.eq.sq"],["sqsupseteq","supset.eq.sq"],["star","star"],["subset","subset"],["subseteq","subset.eq"],["subsetneq","subset.neq"],["succ","succ"],["succeq","succ.eq"],["sum","sum"],["supset","supset"],["supseteq","supset.eq"],["supsetneq","supset.neq"],["swarrow","arrow.bl"],["tau","tau"],["theta","theta"],["times","times"],["to","arrow.r"],["top","top"],["triangle","triangle.t"],["triangledown","triangle.b.small"],["triangleleft","triangle.l.small"],["triangleright","triangle.r.small"],["twoheadrightarrow","arrow.r.twohead"],["uparrow","arrow.t"],["updownarrow","arrow.t.b"],["upharpoonright","harpoon.tr"],["uplus","union.plus"],["upsilon","upsilon"],["varepsilon","epsilon"],["varnothing","diameter"],["varphi","phi"],["varpi","pi.alt"],["varrho","rho.alt"],["varsigma","sigma.alt"],["vartheta","theta.alt"],["vdash","tack.r"],["vdots","dots.v"],["vee","or"],["wedge","and"],["wr","wreath"],["xi","xi"],["yen","yen"],["zeta","zeta"],["mathscr","scr"],["LaTeX","#LaTeX"],["TeX","#TeX"]]);function F(z,Z=""){if(!z)throw new H(Z)}function l(z){if(x.includes(z))return 1;else if(_.includes(z))return 2;else return 0}function i(z,Z){F(z[Z].eq(D));let J=1,V=Z+1;while(J>0){if(V>=z.length)throw new H("Unmatched curly brackets");if(z[V].eq(D))J+=1;else if(z[V].eq(v))J-=1;V+=1}return V-1}function T(z,Z){F(z[Z].eq(I));let J=1,V=Z+1;while(J>0){if(V>=z.length)throw new H("Unmatched square brackets");if(z[V].eq(I))J+=1;else if(z[V].eq(d))J-=1;V+=1}return V-1}function P(z){return"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".includes(z)}function g(z){return"0123456789".includes(z)}function A(z,Z){let J=Z;while(J<z.length&&[4,5].includes(z[J].type))J++;return z.slice(Z,J)}function C(z,Z){const J=z[Z];if(J.type===0&&["(",")","[","]","|","\\{","\\}"].includes(J.value))return J;else if(J.type===1&&["lfloor","rfloor","lceil","rceil","langle","rangle"].includes(J.value.slice(1)))return J;else return null}function U(z,Z){let J=Z;while(J<z.length&&z[J].eq(new j(0,"'")))J+=1;return J-Z}function p(z,Z){let J=Z;while(J<z.length&&P(z[J]))J+=1;return z.substring(Z,J)}function a(z,Z){let J=1,V=Z;while(J>0){if(V>=z.length)return-1;if(z[V].eq(f))J+=1;else if(z[V].eq(k))J-=1;V+=1}return V-1}function n(z,Z){let J=1,V=Z;while(J>0){if(V>=z.length)return-1;if(z[V].eq(B))J+=1;else if(z[V].eq(r))J-=1;V+=1}return V-1}function t(z,Z){F(z[Z]==="{");let J=1,V=Z+1;while(J>0){if(V>=z.length)throw new H("Unmatched curly brackets");if(V+1<z.length&&["\\{","\\}"].includes(z.substring(V,V+2))){V+=2;continue}if(z[V]==="{")J+=1;else if(z[V]==="}")J-=1;V+=1}return V-1}function L(z){const Z=[];let J=0;while(J<z.length){const V=z[J];let X;switch(V){case"%":{let $=J+1;while($<z.length&&z[$]!=="\n")$+=1;X=new j(3,z.slice(J+1,$)),J=$;break}case"{":case"}":case"_":case"^":case"&":X=new j(6,V),J++;break;case"\n":X=new j(5,V),J++;break;case"\r":{if(J+1<z.length&&z[J+1]==="\n")X=new j(5,"\n"),J+=2;else X=new j(5,"\n"),J++;break}case" ":{let $=J;while($<z.length&&z[$]===" ")$+=1;X=new j(4,z.slice(J,$)),J=$;break}case"\\":{if(J+1>=z.length)throw new H("Expecting command name after \\");const $=z.slice(J,J+2);if(["\\\\","\\,"].includes($))X=new j(6,$);else if(["\\{","\\}","\\%","\\$","\\&","\\#","\\_"].includes($))X=new j(0,$);else{const q=p(z,J+1);X=new j(1,"\\"+q)}J+=X.value.length;break}default:{if(g(V)){let $=J;while($<z.length&&g(z[$]))$+=1;X=new j(0,z.slice(J,$))}else if(P(V))X=new j(0,V);else if("+-*/=\'<>!.,;?()[]|".includes(V))X=new j(0,V);else X=new j(7,V);J+=X.value.length}}if(Z.push(X),X.type===1&&["\\text","\\operatorname","\\begin","\\end"].includes(X.value)){if(J>=z.length||z[J]!=="{")throw new H(`No content for ${X.value} command`);Z.push(new j(6,"{"));const $=t(z,J);J++;let q=z.slice(J,$);const Q=["{","}","\\","$","&","#","_","%"];for(let W of Q)q=q.replaceAll("\\"+W,W);Z.push(new j(2,q)),Z.push(new j(6,"}")),J=$+1}}return Z}function s(z){const Z=(V)=>V.eq(M)||V.eq(h);let J=[];for(let V=0;V<z.length;V++){if(z[V].type===4&&V+1<z.length&&Z(z[V+1]))continue;if(z[V].type===4&&V-1>=0&&Z(z[V-1]))continue;J.push(z[V])}return J}function o(z,Z){let J=[];for(let V of z)if(V.type===1&&Z[V.value]){const X=L(Z[V.value]);J=J.concat(X)}else J.push(V);return J}function u(z,Z){const J=new y;let V=L(z);return V=s(V),V=o(V,Z),J.parse(V)}var x=["sqrt","text","bar","bold","boldsymbol","ddot","dot","hat","mathbb","mathbf","mathcal","mathfrak","mathit","mathrm","mathscr","mathsf","mathtt","operatorname","overbrace","overline","pmb","rm","tilde","underbrace","underline","vec","widehat","widetilde"],_=["frac","tfrac","binom","dbinom","dfrac","tbinom"];class j{type;value;constructor(z,Z){this.type=z,this.value=Z}eq(z){return this.type===z.type&&this.value===z.value}}var N={type:"empty",content:""},D=new j(6,"{"),v=new j(6,"}"),I=new j(0,"["),d=new j(0,"]"),f=new j(1,"\\left"),k=new j(1,"\\right"),B=new j(1,"\\begin"),r=new j(1,"\\end");class H extends Error{constructor(z){super(z);this.name="LatexParserError"}}var M=new j(6,"_"),h=new j(6,"^");class y{space_sensitive;newline_sensitive;constructor(z=!1,Z=!0){this.space_sensitive=z,this.newline_sensitive=Z}parse(z){const Z=[];let J=0;while(J<z.length){const V=[];let X=0;while(X<z.length){const[$,q]=this.parseNextExpr(z,X);if(X=q,!this.space_sensitive&&$.type==="whitespace")continue;if(!this.newline_sensitive&&$.type==="newline")continue;if($.type==="control"&&$.content==="&")throw new H("Unexpected & outside of an alignment");V.push($)}if(V.length===0)return N;else if(V.length===1)return V[0];else return{type:"ordgroup",content:"",args:V}}if(Z.length===0)return N;else if(Z.length===1)return Z[0];else return{type:"ordgroup",content:"",args:Z}}parseNextExpr(z,Z){let[J,V]=this.parseNextExprWithoutSupSub(z,Z),X=null,$=null,q=0;if(q+=U(z,V),V+=q,V<z.length&&z[V].eq(M)){if([X,V]=this.parseNextExprWithoutSupSub(z,V+1),q+=U(z,V),V+=q,V<z.length&&z[V].eq(h)){if([$,V]=this.parseNextExprWithoutSupSub(z,V+1),U(z,V)>0)throw new H("Double superscript")}}else if(V<z.length&&z[V].eq(h)){if([$,V]=this.parseNextExprWithoutSupSub(z,V+1),U(z,V)>0)throw new H("Double superscript");if(V<z.length&&z[V].eq(M)){if([X,V]=this.parseNextExprWithoutSupSub(z,V+1),U(z,V)>0)throw new H("Double superscript")}}if(X!==null||$!==null||q>0){const Q={base:J};if(X)Q.sub=X;if(q>0){Q.sup={type:"ordgroup",content:"",args:[]};for(let W=0;W<q;W++)Q.sup.args.push({type:"element",content:"'"});if($)Q.sup.args.push($);if(Q.sup.args.length===1)Q.sup=Q.sup.args[0]}else if($)Q.sup=$;return[{type:"supsub",content:"",data:Q},V]}else return[J,V]}parseNextExprWithoutSupSub(z,Z){const J=z[Z];switch(J.type){case 0:return[{type:"element",content:J.value},Z+1];case 2:return[{type:"text",content:J.value},Z+1];case 3:return[{type:"comment",content:J.value},Z+1];case 4:return[{type:"whitespace",content:J.value},Z+1];case 5:return[{type:"newline",content:J.value},Z+1];case 1:if(J.eq(B))return this.parseBeginEndExpr(z,Z);else if(J.eq(f))return this.parseLeftRightExpr(z,Z);else return this.parseCommandExpr(z,Z);case 6:switch(J.value){case"{":const $=i(z,Z),q=z.slice(Z+1,$);return[this.parse(q),$+1];case"}":throw new H("Unmatched '}'");case"\\\\":return[{type:"control",content:"\\\\"},Z+1];case"\\,":return[{type:"control",content:"\\,"},Z+1];case"_":return[N,Z];case"^":return[N,Z];case"&":return[{type:"control",content:"&"},Z+1];default:throw new H("Unknown control sequence")}default:throw new H("Unknown token type")}}parseCommandExpr(z,Z){F(z[Z].type===1);const J=z[Z].value;let V=Z+1;if(["left","right","begin","end"].includes(J.slice(1)))throw new H("Unexpected command: "+J);switch(l(J.slice(1))){case 0:if(!O.has(J.slice(1)))return[{type:"unknownMacro",content:J},V];return[{type:"symbol",content:J},V];case 1:{if(J==="\\sqrt"&&V<z.length&&z[V].eq(I)){const Q=V,W=T(z,V),S=z.slice(Q+1,W),R=this.parse(S),[w,c]=this.parseNextExprWithoutSupSub(z,W+1);return[{type:"unaryFunc",content:J,args:[w],data:R},c]}else if(J==="\\text"){if(V+2>=z.length)throw new H("Expecting content for \\text command");return F(z[V].eq(D)),F(z[V+1].type===2),F(z[V+2].eq(v)),[{type:"text",content:z[V+1].value},V+3]}let[$,q]=this.parseNextExprWithoutSupSub(z,V);return[{type:"unaryFunc",content:J,args:[$]},q]}case 2:{const[$,q]=this.parseNextExprWithoutSupSub(z,V),[Q,W]=this.parseNextExprWithoutSupSub(z,q);return[{type:"binaryFunc",content:J,args:[$,Q]},W]}default:throw new Error("Invalid number of parameters")}}parseLeftRightExpr(z,Z){F(z[Z].eq(f));let J=Z+1;if(J+=A(z,J).length,J>=z.length)throw new H("Expecting delimiter after \\left");const V=C(z,J);if(V===null)throw new H("Invalid delimiter after \\left");J++;const X=J,$=a(z,J);if($===-1)throw new H("No matching \\right");const q=$;if(J=$+1,J+=A(z,J).length,J>=z.length)throw new H("Expecting \\right after \\left");const Q=C(z,J);if(Q===null)throw new H("Invalid delimiter after \\right");J++;const W=z.slice(X,q),S=this.parse(W);return[{type:"leftright",content:"",args:[{type:"element",content:V.value},S,{type:"element",content:Q.value}]},J]}parseBeginEndExpr(z,Z){F(z[Z].eq(B));let J=Z+1;F(z[J].eq(D)),F(z[J+1].type===2),F(z[J+2].eq(v));const V=z[J+1].value;J+=3,J+=A(z,J).length;const X=J,$=n(z,J);if($===-1)throw new H("No matching \\end");const q=$;if(J=$+1,F(z[J].eq(D)),F(z[J+1].type===2),F(z[J+2].eq(v)),z[J+1].value!==V)throw new H("Mismatched \\begin and \\end environments");J+=3;const Q=z.slice(X,q);while(Q.length>0&&[4,5].includes(Q[Q.length-1].type))Q.pop();const W=this.parseAligned(Q);return[{type:"beginend",content:V,data:W},J]}parseAligned(z){let Z=0;const J=[];let V=[];J.push(V);let X={type:"ordgroup",content:"",args:[]};V.push(X);while(Z<z.length){const[$,q]=this.parseNextExpr(z,Z);if(Z=q,$.type==="whitespace")continue;else if($.type==="newline"&&!this.newline_sensitive)continue;else if($.type==="control"&&$.content==="\\\\")V=[],X={type:"ordgroup",content:"",args:[]},V.push(X),J.push(V);else if($.type==="control"&&$.content==="&")X={type:"ordgroup",content:"",args:[]},V.push(X);else X.args.push($)}return J}}function m(z){return z.type==="atom"&&["(",")","[","]","{","}","|","\u230A","\u230B","\u2308","\u2309"].includes(z.content)}function G(z){switch(z.type){case"empty":case"whitespace":return{type:"empty",content:""};case"ordgroup":return{type:"group",content:"",args:z.args.map(G)};case"element":return{type:"atom",content:Y(z.content)};case"symbol":return{type:"symbol",content:Y(z.content)};case"text":return{type:"text",content:z.content};case"comment":return{type:"comment",content:z.content};case"supsub":{let{base:Z,sup:J,sub:V}=z.data;if(Z&&Z.type==="unaryFunc"&&Z.content==="\\overbrace"&&J)return{type:"binaryFunc",content:"overbrace",args:[G(Z.args[0]),G(J)]};else if(Z&&Z.type==="unaryFunc"&&Z.content==="\\underbrace"&&V)return{type:"binaryFunc",content:"underbrace",args:[G(Z.args[0]),G(V)]};const X={base:G(Z)};if(X.base.type==="empty")X.base={type:"text",content:""};if(J)X.sup=G(J);if(V)X.sub=G(V);return{type:"supsub",content:"",data:X}}case"leftright":{const[Z,J,V]=z.args,X={type:"group",content:"",args:z.args.map(G)};if(["[]","()","\\{\\}","\\lfloor\\rfloor","\\lceil\\rceil","\\lfloor\\rceil"].includes(Z.content+V.content))return X;return{type:"unaryFunc",content:"lr",args:[X]}}case"binaryFunc":return{type:"binaryFunc",content:Y(z.content),args:z.args.map(G)};case"unaryFunc":{const Z=G(z.args[0]);if(z.content==="\\sqrt"&&z.data)return{type:"binaryFunc",content:"root",args:[G(z.data),Z]};if(z.content==="\\mathbf")return{type:"unaryFunc",content:"upright",args:[{type:"unaryFunc",content:"bold",args:[Z]}]};if(z.content==="\\mathbb"&&Z.type==="atom"&&/^[A-Z]$/.test(Z.content))return{type:"symbol",content:Z.content+Z.content};if(z.content==="\\operatorname"){const J=z.args;if(J.length!==1||J[0].type!=="text")throw new K("Expecting body of \\operatorname to be text but got",z);const V=J[0].content;if(e.includes(V))return{type:"symbol",content:V};else return{type:"unaryFunc",content:"op",args:[{type:"text",content:V}]}}return{type:"unaryFunc",content:Y(z.content),args:z.args.map(G)}}case"newline":return{type:"newline",content:"\n"};case"beginend":{const J=z.data.map((V)=>V.map(G));if(z.content.startsWith("align"))return{type:"align",content:"",data:J};else return{type:"matrix",content:"mat",data:J}}case"unknownMacro":return{type:"unknown",content:Y(z.content)};case"control":if(z.content==="\\\\")return{type:"symbol",content:"\\"};else if(z.content==="\\,")return{type:"symbol",content:"thin"};else throw new K(`Unknown control sequence: ${z.content}`,z);default:throw new K(`Unimplemented node type: ${z.type}`,z)}}function Y(z){if(/^[a-zA-Z0-9]$/.test(z))return z;else if(z==="\\\\")return"\\";else if(z=="/")return"\\/";else if(["\\$","\\#","\\&","\\_"].includes(z))return z;else if(z.startsWith("\\")){const Z=z.slice(1);if(O.has(Z))return O.get(Z);else return Z}return z}var e=["dim","id","im","mod","Pr","sech","csch"];class K extends Error{node;constructor(z,Z){super(z);this.name="TypstWriterError",this.node=Z}}class b{nonStrict;preferTypstIntrinsic;buffer="";queue=[];needSpaceAfterSingleItemScript=!1;insideFunctionDepth=0;constructor(z,Z){this.nonStrict=z,this.preferTypstIntrinsic=Z}writeBuffer(z){if(this.needSpaceAfterSingleItemScript&&/^[0-9a-zA-Z\(]/.test(z))this.buffer+=" ";else{let Z=!1;if(Z||=/[\(\|]$/.test(this.buffer)&&/^\w/.test(z),Z||=/^[}()_^,;!\|]$/.test(z),Z||=z==="'",Z||=/[0-9]$/.test(this.buffer)&&/^[0-9]/.test(z),Z||=/[\(\[{]\s*(-|\+)$/.test(this.buffer)||this.buffer==="-"||this.buffer==="+",Z||=z.startsWith("\n"),Z||=this.buffer==="",Z||=/[\s_^{\(]$/.test(this.buffer),!Z)this.buffer+=" "}if(this.needSpaceAfterSingleItemScript)this.needSpaceAfterSingleItemScript=!1;this.buffer+=z}append(z){switch(z.type){case"empty":break;case"atom":{if(z.content===","&&this.insideFunctionDepth>0)this.queue.push({type:"symbol",content:"comma"});else this.queue.push({type:"atom",content:z.content});break}case"symbol":case"text":case"comment":case"newline":this.queue.push(z);break;case"group":for(let Z of z.args)this.append(Z);break;case"supsub":{let{base:Z,sup:J,sub:V}=z.data;this.appendWithBracketsIfNeeded(Z);let X=!1;const $=J&&J.type==="atom"&&J.content==="\'";if($)this.queue.push({type:"atom",content:"\'"}),X=!1;if(V)this.queue.push({type:"atom",content:"_"}),X=this.appendWithBracketsIfNeeded(V);if(J&&!$)this.queue.push({type:"atom",content:"^"}),X=this.appendWithBracketsIfNeeded(J);if(X)this.queue.push({type:"softSpace",content:""});break}case"binaryFunc":{const Z={type:"symbol",content:z.content},[J,V]=z.args;this.queue.push(Z),this.insideFunctionDepth++,this.queue.push({type:"atom",content:"("}),this.append(J),this.queue.push({type:"atom",content:","}),this.append(V),this.queue.push({type:"atom",content:")"}),this.insideFunctionDepth--;break}case"unaryFunc":{const Z={type:"symbol",content:z.content},J=z.args[0];this.queue.push(Z),this.insideFunctionDepth++,this.queue.push({type:"atom",content:"("}),this.append(J),this.queue.push({type:"atom",content:")"}),this.insideFunctionDepth--;break}case"align":{const Z=z.data;Z.forEach((J,V)=>{if(J.forEach((X,$)=>{if($>0)this.queue.push({type:"atom",content:"&"});this.append(X)}),V<Z.length-1)this.queue.push({type:"symbol",content:"\\"})});break}case"matrix":{const Z=z.data;this.queue.push({type:"symbol",content:"mat"}),this.insideFunctionDepth++,this.queue.push({type:"atom",content:"("}),this.queue.push({type:"symbol",content:"delim: #none, "}),Z.forEach((J,V)=>{J.forEach((X,$)=>{if(this.append(X),$<J.length-1)this.queue.push({type:"atom",content:","});else if(V<Z.length-1)this.queue.push({type:"atom",content:";"})})}),this.queue.push({type:"atom",content:")"}),this.insideFunctionDepth--;break}case"unknown":{if(this.nonStrict)this.queue.push({type:"symbol",content:z.content});else throw new K(`Unknown macro: ${z.content}`,z);break}default:throw new K(`Unimplemented node type to append: ${z.type}`,z)}}appendWithBracketsIfNeeded(z){let Z=["group","supsub","empty"].includes(z.type);if(z.type==="group"){const J=z.args[0],V=z.args[z.args.length-1];if(m(J)&&m(V))Z=!1}if(Z)this.queue.push({type:"atom",content:"("}),this.append(z),this.queue.push({type:"atom",content:")"});else this.append(z);return!Z}flushQueue(){this.queue.forEach((z)=>{let Z="";switch(z.type){case"atom":case"symbol":Z=z.content;break;case"text":Z=`"${z.content}"`;break;case"softSpace":this.needSpaceAfterSingleItemScript=!0,Z="";break;case"comment":Z=`//${z.content}`;break;case"newline":Z="\n";break;default:throw new K(`Unexpected node type to stringify: ${z.type}`,z)}if(Z!=="")this.writeBuffer(Z)}),this.queue=[]}finalize(){this.flushQueue();const V=[function(X){let $=X.replace(/⌊\s*(.*?)\s*⌋/g,"floor($1)");return $=$.replace(/floor\(\)/g,'floor("")'),$},function(X){let $=X.replace(/⌈\s*(.*?)\s*⌉/g,"ceil($1)");return $=$.replace(/ceil\(\)/g,'ceil("")'),$},function(X){let $=X.replace(/⌊\s*(.*?)\s*⌉/g,"round($1)");return $=$.replace(/round\(\)/g,'round("")'),$}];for(let X of V)this.buffer=X(this.buffer);return this.buffer}}function E(z,Z){const J={nonStrict:!0,preferTypstIntrinsic:!0,customTexMacros:{}};if(Z){if(Z.nonStrict)J.nonStrict=Z.nonStrict;if(Z.preferTypstIntrinsic)J.preferTypstIntrinsic=Z.preferTypstIntrinsic;if(Z.customTexMacros)J.customTexMacros=Z.customTexMacros}const V=u(z,J.customTexMacros),X=G(V),$=new b(J.nonStrict,J.preferTypstIntrinsic);return $.append(X),$.finalize()}if(typeof window!=="undefined")window.tex2typst=E; | ||
var K=new Map([["nonumber",""],["vec","arrow"],["neq","eq.not"],["dot","dot"],["ddot","dot.double"],["doteq","dot(eq)"],["dots","dots.h"],["ldots","dots.h"],["vdots","dots.v"],["ddots","dots.down"],["widehat","hat"],["widetilde","tilde"],["quad","quad"],["qquad","wide"],["overbrace","overbrace"],["underbrace","underbrace"],["overline","overline"],["underline","underline"],["bar","macron"],["dbinom","binom"],["tbinom","binom"],["dfrac","frac"],["tfrac","frac"],["boldsymbol","bold"],["mathbb","bb"],["mathbf","bold"],["mathcal","cal"],["mathit","italic"],["mathfrak","frak"],["mathrm","upright"],["mathsf","sans"],["mathtt","mono"],["rm","upright"],["pmb","bold"],["pm","plus.minus"],["mp","minus.plus"],["boxplus","plus.square"],["otimes","times.circle"],["boxtimes","times.square"],["approx","approx"],["cong","tilde.equiv"],["simeq","tilde.eq"],["asymp","\u224D"],["equiv","equiv"],["propto","prop"],["gets","arrow.l"],["hookleftarrow","arrow.l.hook"],["leftharpoonup","harpoon.lt"],["leftharpoondown","harpoon.lb"],["rightleftharpoons","harpoons.rtlb"],["longleftarrow","arrow.l.long"],["longrightarrow","arrow.r.long"],["longleftrightarrow","arrow.l.r.long"],["Longleftarrow","arrow.l.double.long"],["Longrightarrow","arrow.r.double.long"],["Longleftrightarrow","arrow.l.r.double.long"],["hookrightarrow","arrow.r.hook"],["rightharpoonup","harpoon.rt"],["rightharpoondown","harpoon.rb"],["iff","arrow.l.r.double.long"],["implies","arrow.r.double.long"],["uparrow","arrow.t"],["downarrow","arrow.b"],["updownarrow","arrow.t.b"],["Uparrow","arrow.t.double"],["Downarrow","arrow.b.double"],["Updownarrow","arrow.t.b.double"],["nearrow","arrow.tr"],["searrow","arrow.br"],["swarrow","arrow.bl"],["nwarrow","arrow.tl"],["leadsto","arrow.squiggly"],["leftleftarrows","arrows.ll"],["rightrightarrows","arrows.rr"],["Cap","sect.double"],["Cup","union.double"],["Delta","Delta"],["Gamma","Gamma"],["Join","join"],["Lambda","Lambda"],["Leftarrow","arrow.l.double"],["Leftrightarrow","arrow.l.r.double"],["Longrightarrow","arrow.r.double.long"],["Omega","Omega"],["P","pilcrow"],["Phi","Phi"],["Pi","Pi"],["Psi","Psi"],["Rightarrow","arrow.r.double"],["S","section"],["Sigma","Sigma"],["Theta","Theta"],["aleph","alef"],["alpha","alpha"],["angle","angle"],["approx","approx"],["approxeq","approx.eq"],["beta","beta"],["bigcap","sect.big"],["bigcirc","circle.big"],["bigcup","union.big"],["bigodot","dot.circle.big"],["bigotimes","times.circle.big"],["bigsqcup","union.sq.big"],["biguplus","union.plus.big"],["bigvee","or.big"],["bigwedge","and.big"],["bullet","bullet"],["cap","sect"],["cdot","dot.op"],["cdots","dots.c"],["checkmark","checkmark"],["chi","chi"],["circ","circle.small"],["colon","colon"],["cong","tilde.equiv"],["coprod","product.co"],["copyright","copyright"],["cup","union"],["curlyvee","or.curly"],["curlywedge","and.curly"],["dagger","dagger"],["dashv","tack.l"],["ddagger","dagger.double"],["delta","delta"],["ddots","dots.down"],["diamond","diamond"],["div","div"],["divideontimes","times.div"],["dotplus","plus.dot"],["downarrow","arrow.b"],["ell","ell"],["emptyset","nothing"],["epsilon","epsilon.alt"],["equiv","equiv"],["eta","eta"],["exists","exists"],["forall","forall"],["gamma","gamma"],["ge","gt.eq"],["geq","gt.eq"],["geqslant","gt.eq.slant"],["gg","gt.double"],["hbar","planck.reduce"],["imath","dotless.i"],["iiiint","integral.quad"],["iiint","integral.triple"],["iint","integral.double"],["in","in"],["infty","infinity"],["int","integral"],["intercal","top"],["iota","iota"],["jmath","dotless.j"],["kappa","kappa"],["lambda","lambda"],["land","and"],["langle","angle.l"],["lbrace","brace.l"],["lbrack","bracket.l"],["ldots","dots.l"],["le","lt.eq"],["leadsto","arrow.squiggly"],["leftarrow","arrow.l"],["leftthreetimes","times.three.l"],["leftrightarrow","arrow.l.r"],["leq","lt.eq"],["leqslant","lt.eq.slant"],["lhd","triangle.l"],["ll","lt.double"],["lor","or"],["ltimes","times.l"],["measuredangle","angle.arc"],["mid","divides"],["models","models"],["mp","minus.plus"],["mu","mu"],["nabla","nabla"],["ncong","tilde.equiv.not"],["ne","eq.not"],["neg","not"],["neq","eq.not"],["nexists","exists.not"],["ni","in.rev"],["nleftarrow","arrow.l.not"],["nleq","lt.eq.not"],["nparallel","parallel.not"],["ngeq","gt.eq.not"],["nmid","divides.not"],["notin","in.not"],["nsim","tilde.not"],["nsubseteq","subset.eq.not"],["nu","nu"],["ntriangleleft","lt.tri.not"],["ntriangleright","gt.tri.not"],["nwarrow","arrow.tl"],["odot","dot.circle"],["oint","integral.cont"],["oiint","integral.surf"],["oiiint","integral.vol"],["omega","omega"],["ominus","minus.circle"],["otimes","times.circle"],["parallel","parallel"],["partial","diff"],["perp","perp"],["phi","phi.alt"],["pi","pi"],["pm","plus.minus"],["pounds","pound"],["prec","prec"],["preceq","prec.eq"],["prime","prime"],["prod","product"],["propto","prop"],["psi","psi"],["rangle","angle.r"],["rbrace","brace.r"],["rbrack","bracket.r"],["rhd","triangle"],["rho","rho"],["rightarrow","arrow.r"],["rightthreetimes","times.three.r"],["rtimes","times.r"],["setminus","without"],["sigma","sigma"],["sim","tilde.op"],["simeq","tilde.eq"],["slash","slash"],["smallsetminus","without"],["spadesuit","suit.spade"],["sqcap","sect.sq"],["sqcup","union.sq"],["sqsubseteq","subset.eq.sq"],["sqsupseteq","supset.eq.sq"],["subset","subset"],["subseteq","subset.eq"],["subsetneq","subset.neq"],["succ","succ"],["succeq","succ.eq"],["sum","sum"],["supset","supset"],["supseteq","supset.eq"],["supsetneq","supset.neq"],["swarrow","arrow.bl"],["tau","tau"],["theta","theta"],["times","times"],["to","arrow.r"],["top","top"],["triangle","triangle.t"],["twoheadrightarrow","arrow.r.twohead"],["uparrow","arrow.t"],["updownarrow","arrow.t.b"],["upharpoonright","harpoon.tr"],["uplus","union.plus"],["upsilon","upsilon"],["varepsilon","epsilon"],["varnothing","diameter"],["varphi","phi"],["varpi","pi.alt"],["varrho","rho.alt"],["varsigma","sigma.alt"],["vartheta","theta.alt"],["vdash","tack.r"],["vdots","dots.v"],["vee","or"],["wedge","and"],["wr","wreath"],["xi","xi"],["yen","yen"],["zeta","zeta"],["mathscr","scr"],["LaTeX","#LaTeX"],["TeX","#TeX"]]),x=new Map([["lparen","paren.l"],["lParen","paren.l.double"],["rparen","paren.r"],["rParen","paren.r.double"],["overparen","paren.t"],["underparen","paren.b"],["lbrace","brace.l"],["lBrace","brace.l.double"],["rbrace","brace.r"],["rBrace","brace.r.double"],["underbrace","brace.b"],["lbrack","bracket.l"],["lBrack","bracket.l.double"],["rbrack","bracket.r"],["rBrack","bracket.r.double"],["overbracket","bracket.t"],["underbracket","bracket.b"],["lbrbrak","shell.l"],["Lbrbrak","shell.l.double"],["rbrbrak","shell.r"],["Rbrbrak","shell.r.double"],["obrbrak","shell.t"],["ubrbrak","shell.b"],["vert","bar.v"],["Vert","bar.v.double"],["Vvert","bar.v.triple"],["circledvert","bar.v.circle"],["horizbar","bar.h"],["lvzigzag","fence.l"],["Lvzigzag","fence.l.double"],["rvzigzag","fence.r"],["Rvzigzag","fence.r.double"],["fourvdots","fence.dotted"],["angle","angle"],["langle","angle.l"],["lcurvyangle","angle.l.curly"],["langledot","angle.l.dot"],["rangle","angle.r"],["rcurvyangle","angle.r.curly"],["rangledot","angle.r.dot"],["angdnr","angle.acute"],["measuredangle","angle.arc"],["measuredangleleft","angle.arc.rev"],["wideangledown","angle.oblique"],["revangle","angle.rev"],["rightangle","angle.right"],["measuredrightangle","angle.right.arc"],["rightanglemdot","angle.right.dot"],["rightanglesqr","angle.right.sq"],["angles","angle.s"],["threedangle","angle.spatial"],["sphericalangle","angle.spheric"],["gtlpar","angle.spheric.rev"],["sphericalangleup","angle.spheric.top"],["lceil","ceil.l"],["rceil","ceil.r"],["lfloor","floor.l"],["rfloor","floor.r"],["mathampersand","amp"],["upand","amp.inv"],["ast","ast.op"],["circledast","ast.circle"],["boxast","ast.square"],["mathatsign","at"],["backslash","backslash"],["obslash","backslash.circle"],["rsolbar","backslash.not"],["mathcolon","colon"],["Colon","colon.double"],["coloneq","colon.eq"],["Coloneq","colon.double.eq"],["mathcomma","comma"],["dagger","dagger"],["ddagger","dagger.double"],["dashcolon","dash.colon"],["circleddash","dash.circle"],["hzigzag","dash.wave.double"],["cdot","dot.op"],["mathperiod","dot.basic"],["cdotp","dot.c"],["odot","dot.circle"],["bigodot","dot.circle.big"],["boxdot","dot.square"],["dddot","dot.triple"],["ddddot","dot.quad"],["mathexclam","excl"],["Exclam","excl.double"],["mathquestion","quest"],["Question","quest.double"],["mathoctothorpe","hash"],["mathhyphen","hyph"],["mathpercent","percent"],["mathparagraph","pilcrow"],["mathsection","section"],["mathsemicolon","semi"],["mathslash","slash"],["sslash","slash.double"],["trslash","slash.triple"],["xsol","slash.big"],["unicodecdots","dots.h.c"],["unicodeellipsis","dots.h"],["vdots","dots.v"],["ddots","dots.down"],["adots","dots.up"],["sim","tilde.op"],["dotsim","tilde.dot"],["sime","tilde.eq"],["nsimeq","tilde.eq.not"],["backsimeq","tilde.eq.rev"],["cong","tilde.equiv"],["ncong","tilde.equiv.not"],["simneqq","tilde.nequiv"],["nsim","tilde.not"],["backsim","tilde.rev"],["backcong","tilde.rev.equiv"],["approxident","tilde.triple"],["caretinsert","caret"],["prime","prime"],["backprime","prime.rev"],["dprime","prime.double"],["backdprime","prime.double.rev"],["trprime","prime.triple"],["backtrprime","prime.triple.rev"],["qprime","prime.quad"],["mathplus","plus"],["oplus","plus.circle"],["rightarrowonoplus","plus.circle.arrow"],["bigoplus","plus.circle.big"],["dotplus","plus.dot"],["doubleplus","plus.double"],["pm","plus.minus"],["boxplus","plus.square"],["triangleplus","plus.triangle"],["tripleplus","plus.triple"],["minus","minus"],["ominus","minus.circle"],["dotminus","minus.dot"],["mp","minus.plus"],["boxminus","minus.square"],["eqsim","minus.tilde"],["triangleminus","minus.triangle"],["div","div"],["odiv","div.circle"],["times","times"],["bigtimes","times.big"],["otimes","times.circle"],["bigotimes","times.circle.big"],["divideontimes","times.div"],["leftthreetimes","times.three.l"],["rightthreetimes","times.three.r"],["ltimes","times.l"],["rtimes","times.r"],["boxtimes","times.square"],["triangletimes","times.triangle"],["mathratio","ratio"],["equal","eq"],["stareq","eq.star"],["circledequal","eq.circle"],["eqcolon","eq.colon"],["eqdef","eq.def"],["triangleq","eq.delta"],["veeeq","eq.equi"],["wedgeq","eq.est"],["eqgtr","eq.gt"],["eqless","eq.lt"],["measeq","eq.m"],["ne","eq.not"],["curlyeqprec","eq.prec"],["questeq","eq.quest"],["curlyeqsucc","eq.succ"],["equiv","eq.triple"],["Equiv","eq.quad"],["greater","gt"],["ogreaterthan","gt.circle"],["gtrdot","gt.dot"],["gtrapprox","gt.approx"],["gg","gt.double"],["geq","gt.eq"],["geqslant","gt.eq.slant"],["gtreqless","gt.eq.lt"],["ngeq","gt.eq.not"],["geqq","gt.equiv"],["gtrless","gt.lt"],["ngtrless","gt.lt.not"],["gneq","gt.neq"],["gnapprox","gt.napprox"],["gneqq","gt.nequiv"],["ngtr","gt.not"],["gnsim","gt.ntilde"],["gtrsim","gt.tilde"],["ngtrsim","gt.tilde.not"],["vartriangleright","gt.tri"],["trianglerighteq","gt.tri.eq"],["ntrianglerighteq","gt.tri.eq.not"],["nvartriangleright","gt.tri.not"],["ggg","gt.triple"],["gggnest","gt.triple.nested"],["less","lt"],["olessthan","lt.circle"],["lessdot","lt.dot"],["lessapprox","lt.approx"],["ll","lt.double"],["leq","lt.eq"],["leqslant","lt.eq.slant"],["lesseqgtr","lt.eq.gt"],["nleq","lt.eq.not"],["leqq","lt.equiv"],["lessgtr","lt.gt"],["nlessgtr","lt.gt.not"],["lneq","lt.neq"],["lnapprox","lt.napprox"],["lneqq","lt.nequiv"],["nless","lt.not"],["lnsim","lt.ntilde"],["lesssim","lt.tilde"],["nlesssim","lt.tilde.not"],["vartriangleleft","lt.tri"],["trianglelefteq","lt.tri.eq"],["ntrianglelefteq","lt.tri.eq.not"],["nvartriangleleft","lt.tri.not"],["lll","lt.triple"],["lllnest","lt.triple.nested"],["approx","approx"],["approxeq","approx.eq"],["napprox","approx.not"],["prec","prec"],["precapprox","prec.approx"],["preccurlyeq","prec.curly.eq"],["npreccurlyeq","prec.curly.eq.not"],["Prec","prec.double"],["preceq","prec.eq"],["preceqq","prec.equiv"],["precnapprox","prec.napprox"],["precneq","prec.neq"],["precneqq","prec.nequiv"],["nprec","prec.not"],["precnsim","prec.ntilde"],["precsim","prec.tilde"],["succ","succ"],["succapprox","succ.approx"],["succcurlyeq","succ.curly.eq"],["nsucccurlyeq","succ.curly.eq.not"],["Succ","succ.double"],["succeq","succ.eq"],["succeqq","succ.equiv"],["succnapprox","succ.napprox"],["succneq","succ.neq"],["succneqq","succ.nequiv"],["nsucc","succ.not"],["succnsim","succ.ntilde"],["succsim","succ.tilde"],["nequiv","equiv.not"],["propto","prop"],["origof","original"],["imageof","image"],["varnothing","emptyset"],["emptysetoarr","emptyset.arrow.r"],["emptysetoarrl","emptyset.arrow.l"],["emptysetobar","emptyset.bar"],["emptysetocirc","emptyset.circle"],["revemptyset","emptyset.rev"],["setminus","without"],["complement","complement"],["in","in"],["notin","in.not"],["ni","in.rev"],["nni","in.rev.not"],["smallni","in.rev.small"],["smallin","in.small"],["subset","subset"],["subsetdot","subset.dot"],["Subset","subset.double"],["subseteq","subset.eq"],["nsubseteq","subset.eq.not"],["sqsubseteq","subset.eq.sq"],["nsqsubseteq","subset.eq.sq.not"],["subsetneq","subset.neq"],["nsubset","subset.not"],["sqsubset","subset.sq"],["sqsubsetneq","subset.sq.neq"],["supset","supset"],["supsetdot","supset.dot"],["Supset","supset.double"],["supseteq","supset.eq"],["nsupseteq","supset.eq.not"],["sqsupseteq","supset.eq.sq"],["nsqsupseteq","supset.eq.sq.not"],["supsetneq","supset.neq"],["nsupset","supset.not"],["sqsupset","supset.sq"],["sqsupsetneq","supset.sq.neq"],["cup","union"],["cupleftarrow","union.arrow"],["bigcup","union.big"],["cupdot","union.dot"],["bigcupdot","union.dot.big"],["Cup","union.double"],["uminus","union.minus"],["cupvee","union.or"],["uplus","union.plus"],["biguplus","union.plus.big"],["sqcup","union.sq"],["bigsqcup","union.sq.big"],["Sqcup","union.sq.double"],["cap","sect"],["capwedge","sect.and"],["bigcap","sect.big"],["capdot","sect.dot"],["Cap","sect.double"],["sqcap","sect.sq"],["bigsqcap","sect.sq.big"],["Sqcap","sect.sq.double"],["infty","infinity"],["nvinfty","infinity.bar"],["iinfin","infinity.incomplete"],["tieinfty","infinity.tie"],["partial","diff"],["nabla","gradient"],["sum","sum"],["sumint","sum.integral"],["prod","product"],["coprod","product.co"],["int","integral"],["intlarhk","integral.arrow.hook"],["awint","integral.ccw"],["oint","integral.cont"],["ointctrclockwise","integral.cont.ccw"],["varointclockwise","integral.cont.cw"],["intclockwise","integral.cw"],["intbar","integral.dash"],["intBar","integral.dash.double"],["iint","integral.double"],["iiiint","integral.quad"],["intcap","integral.sect"],["fint","integral.slash"],["sqint","integral.square"],["oiint","integral.surf"],["intx","integral.times"],["iiint","integral.triple"],["intcup","integral.union"],["oiiint","integral.vol"],["increment","laplace"],["forall","forall"],["exists","exists"],["nexists","exists.not"],["top","top"],["bot","bot"],["neg","not"],["wedge","and"],["bigwedge","and.big"],["curlywedge","and.curly"],["wedgedot","and.dot"],["Wedge","and.double"],["vee","or"],["bigvee","or.big"],["curlyvee","or.curly"],["veedot","or.dot"],["Vee","or.double"],["models","models"],["Vdash","forces"],["nVdash","forces.not"],["therefore","therefore"],["because","because"],["QED","qed"],["vysmwhtcircle","compose"],["multimap","multimap"],["dualmap","multimap.double"],["tplus","tiny"],["tminus","miny"],["mid","divides"],["nmid","divides.not"],["wr","wreath"],["parallel","parallel"],["nhpar","parallel.struck"],["circledparallel","parallel.circle"],["equalparallel","parallel.eq"],["equivVert","parallel.equiv"],["nparallel","parallel.not"],["eparsl","parallel.slanted.eq"],["smeparsl","parallel.slanted.eq.tilde"],["eqvparsl","parallel.slanted.equiv"],["parsim","parallel.tilde"],["perp","perp"],["operp","perp.circle"],["diameter","diameter"],["Join","join"],["rightouterjoin","join.r"],["leftouterjoin","join.l"],["fullouterjoin","join.l.r"],["smashtimes","smash"],["mathdollar","dollar"],["euro","euro"],["mathsterling","pound"],["mathyen","yen"],["checkmark","checkmark"],["maltese","maltese"],["clubsuit","suit.club.filled"],["varclubsuit","suit.club.stroked"],["vardiamondsuit","suit.diamond.filled"],["diamondsuit","suit.diamond.stroked"],["varheartsuit","suit.heart.filled"],["heartsuit","suit.heart.stroked"],["spadesuit","suit.spade.filled"],["varspadesuit","suit.spade.stroked"],["quarternote","note.quarter.alt"],["eighthnote","note.eighth.alt"],["twonotes","note.eighth.beamed"],["natural","natural"],["flat","flat"],["sharp","sharp"],["smblkcircle","bullet"],["mdlgwhtcircle","circle.stroked"],["mdsmwhtcircle","circle.stroked.small"],["lgwhtcircle","circle.stroked.big"],["mdlgblkcircle","circle.filled"],["mdsmblkcircle","circle.filled.tiny"],["vysmblkcircle","circle.filled.small"],["lgblkcircle","circle.filled.big"],["dottedcircle","circle.dotted"],["circledcirc","circle.nested"],["whthorzoval","ellipse.stroked.h"],["whtvertoval","ellipse.stroked.v"],["blkhorzoval","ellipse.filled.h"],["blkvertoval","ellipse.filled.v"],["bigtriangleup","triangle.stroked.t"],["bigtriangledown","triangle.stroked.b"],["triangleright","triangle.stroked.r"],["triangleleft","triangle.stroked.l"],["lltriangle","triangle.stroked.bl"],["lrtriangle","triangle.stroked.br"],["ultriangle","triangle.stroked.tl"],["urtriangle","triangle.stroked.tr"],["vartriangle","triangle.stroked.small.t"],["triangledown","triangle.stroked.small.b"],["smalltriangleright","triangle.stroked.small.r"],["smalltriangleleft","triangle.stroked.small.l"],["whiteinwhitetriangle","triangle.stroked.nested"],["trianglecdot","triangle.stroked.dot"],["bigblacktriangleup","triangle.filled.t"],["bigblacktriangledown","triangle.filled.b"],["blacktriangleright","triangle.filled.r"],["blacktriangleleft","triangle.filled.l"],["llblacktriangle","triangle.filled.bl"],["lrblacktriangle","triangle.filled.br"],["ulblacktriangle","triangle.filled.tl"],["urblacktriangle","triangle.filled.tr"],["blacktriangle","triangle.filled.small.t"],["blacktriangledown","triangle.filled.small.b"],["smallblacktriangleright","triangle.filled.small.r"],["smallblacktriangleleft","triangle.filled.small.l"],["mdlgwhtsquare","square.stroked"],["smwhtsquare","square.stroked.tiny"],["mdsmwhtsquare","square.stroked.small"],["mdwhtsquare","square.stroked.medium"],["lgwhtsquare","square.stroked.big"],["dottedsquare","square.stroked.dotted"],["squoval","square.stroked.rounded"],["mdlgblksquare","square.filled"],["smblksquare","square.filled.tiny"],["mdsmblksquare","square.filled.small"],["mdblksquare","square.filled.medium"],["lgblksquare","square.filled.big"],["hrectangle","rect.stroked.h"],["vrectangle","rect.stroked.v"],["hrectangleblack","rect.filled.h"],["vrectangleblack","rect.filled.v"],["pentagon","penta.stroked"],["pentagonblack","penta.filled"],["varhexagon","hexa.stroked"],["varhexagonblack","hexa.filled"],["mdlgwhtdiamond","diamond.stroked"],["smwhtdiamond","diamond.stroked.small"],["mdwhtdiamond","diamond.stroked.medium"],["diamondcdot","diamond.stroked.dot"],["mdlgblkdiamond","diamond.filled"],["mdblkdiamond","diamond.filled.medium"],["smblkdiamond","diamond.filled.small"],["mdlgwhtlozenge","lozenge.stroked"],["smwhtlozenge","lozenge.stroked.small"],["mdwhtlozenge","lozenge.stroked.medium"],["mdlgblklozenge","lozenge.filled"],["smblklozenge","lozenge.filled.small"],["mdblklozenge","lozenge.filled.medium"],["parallelogram","parallelogram.stroked"],["parallelogramblack","parallelogram.filled"],["star","star.op"],["bigwhitestar","star.stroked"],["bigstar","star.filled"],["rightarrow","arrow.r"],["longmapsto","arrow.r.long.bar"],["mapsto","arrow.r.bar"],["rightdowncurvedarrow","arrow.r.curve"],["rightdasharrow","arrow.r.dashed"],["rightdotarrow","arrow.r.dotted"],["Rightarrow","arrow.r.double"],["Mapsto","arrow.r.double.bar"],["Longrightarrow","arrow.r.double.long"],["Longmapsto","arrow.r.double.long.bar"],["nRightarrow","arrow.r.double.not"],["hookrightarrow","arrow.r.hook"],["longrightarrow","arrow.r.long"],["longrightsquigarrow","arrow.r.long.squiggly"],["looparrowright","arrow.r.loop"],["nrightarrow","arrow.r.not"],["RRightarrow","arrow.r.quad"],["rightsquigarrow","arrow.r.squiggly"],["rightarrowbar","arrow.r.stop"],["rightwhitearrow","arrow.r.stroked"],["rightarrowtail","arrow.r.tail"],["similarrightarrow","arrow.r.tilde"],["Rrightarrow","arrow.r.triple"],["twoheadmapsto","arrow.r.twohead.bar"],["twoheadrightarrow","arrow.r.twohead"],["rightwavearrow","arrow.r.wave"],["leftarrow","arrow.l"],["mapsfrom","arrow.l.bar"],["leftdowncurvedarrow","arrow.l.curve"],["leftdasharrow","arrow.l.dashed"],["leftdotarrow","arrow.l.dotted"],["Leftarrow","arrow.l.double"],["Mapsfrom","arrow.l.double.bar"],["Longleftarrow","arrow.l.double.long"],["Longmapsfrom","arrow.l.double.long.bar"],["nLeftarrow","arrow.l.double.not"],["hookleftarrow","arrow.l.hook"],["longleftarrow","arrow.l.long"],["longmapsfrom","arrow.l.long.bar"],["longleftsquigarrow","arrow.l.long.squiggly"],["looparrowleft","arrow.l.loop"],["nleftarrow","arrow.l.not"],["LLeftarrow","arrow.l.quad"],["leftsquigarrow","arrow.l.squiggly"],["barleftarrow","arrow.l.stop"],["leftwhitearrow","arrow.l.stroked"],["leftarrowtail","arrow.l.tail"],["similarleftarrow","arrow.l.tilde"],["Lleftarrow","arrow.l.triple"],["twoheadmapsfrom","arrow.l.twohead.bar"],["twoheadleftarrow","arrow.l.twohead"],["leftwavearrow","arrow.l.wave"],["uparrow","arrow.t"],["mapsup","arrow.t.bar"],["uprightcurvearrow","arrow.t.curve"],["updasharrow","arrow.t.dashed"],["Uparrow","arrow.t.double"],["UUparrow","arrow.t.quad"],["baruparrow","arrow.t.stop"],["upwhitearrow","arrow.t.stroked"],["Uuparrow","arrow.t.triple"],["twoheaduparrow","arrow.t.twohead"],["downarrow","arrow.b"],["mapsdown","arrow.b.bar"],["downrightcurvedarrow","arrow.b.curve"],["downdasharrow","arrow.b.dashed"],["Downarrow","arrow.b.double"],["DDownarrow","arrow.b.quad"],["downarrowbar","arrow.b.stop"],["downwhitearrow","arrow.b.stroked"],["Ddownarrow","arrow.b.triple"],["twoheaddownarrow","arrow.b.twohead"],["leftrightarrow","arrow.l.r"],["Leftrightarrow","arrow.l.r.double"],["Longleftrightarrow","arrow.l.r.double.long"],["nLeftrightarrow","arrow.l.r.double.not"],["longleftrightarrow","arrow.l.r.long"],["nleftrightarrow","arrow.l.r.not"],["leftrightsquigarrow","arrow.l.r.wave"],["updownarrow","arrow.t.b"],["Updownarrow","arrow.t.b.double"],["nearrow","arrow.tr"],["Nearrow","arrow.tr.double"],["hknearrow","arrow.tr.hook"],["searrow","arrow.br"],["Searrow","arrow.br.double"],["hksearrow","arrow.br.hook"],["nwarrow","arrow.tl"],["Nwarrow","arrow.tl.double"],["hknwarrow","arrow.tl.hook"],["swarrow","arrow.bl"],["Swarrow","arrow.bl.double"],["hkswarrow","arrow.bl.hook"],["nwsearrow","arrow.tl.br"],["neswarrow","arrow.tr.bl"],["acwopencirclearrow","arrow.ccw"],["curvearrowleft","arrow.ccw.half"],["cwopencirclearrow","arrow.cw"],["curvearrowright","arrow.cw.half"],["downzigzagarrow","arrow.zigzag"],["rightrightarrows","arrows.rr"],["leftleftarrows","arrows.ll"],["upuparrows","arrows.tt"],["downdownarrows","arrows.bb"],["leftrightarrows","arrows.lr"],["barleftarrowrightarrowbar","arrows.lr.stop"],["rightleftarrows","arrows.rl"],["updownarrows","arrows.tb"],["downuparrows","arrows.bt"],["rightthreearrows","arrows.rrr"],["leftthreearrows","arrows.lll"],["rightharpoonup","harpoon.rt"],["barrightharpoonup","harpoon.rt.bar"],["rightharpoonupbar","harpoon.rt.stop"],["rightharpoondown","harpoon.rb"],["barrightharpoondown","harpoon.rb.bar"],["rightharpoondownbar","harpoon.rb.stop"],["leftharpoonup","harpoon.lt"],["leftharpoonupbar","harpoon.lt.bar"],["barleftharpoonup","harpoon.lt.stop"],["leftharpoondown","harpoon.lb"],["leftharpoondownbar","harpoon.lb.bar"],["barleftharpoondown","harpoon.lb.stop"],["upharpoonleft","harpoon.tl"],["upharpoonleftbar","harpoon.tl.bar"],["barupharpoonleft","harpoon.tl.stop"],["upharpoonright","harpoon.tr"],["upharpoonrightbar","harpoon.tr.bar"],["barupharpoonright","harpoon.tr.stop"],["downharpoonleft","harpoon.bl"],["bardownharpoonleft","harpoon.bl.bar"],["downharpoonleftbar","harpoon.bl.stop"],["downharpoonright","harpoon.br"],["bardownharpoonright","harpoon.br.bar"],["downharpoonrightbar","harpoon.br.stop"],["leftrightharpoonupup","harpoon.lt.rt"],["leftrightharpoondowndown","harpoon.lb.rb"],["leftrightharpoondownup","harpoon.lb.rt"],["leftrightharpoonupdown","harpoon.lt.rb"],["updownharpoonleftleft","harpoon.tl.bl"],["updownharpoonrightright","harpoon.tr.br"],["updownharpoonleftright","harpoon.tl.br"],["updownharpoonrightleft","harpoon.tr.bl"],["rightharpoonsupdown","harpoons.rtrb"],["downharpoonsleftright","harpoons.blbr"],["downupharpoonsleftright","harpoons.bltr"],["leftrightharpoonsdown","harpoons.lbrb"],["leftharpoonsupdown","harpoons.ltlb"],["leftrightharpoons","harpoons.ltrb"],["leftrightharpoonsup","harpoons.ltrt"],["rightleftharpoonsdown","harpoons.rblb"],["rightleftharpoons","harpoons.rtlb"],["rightleftharpoonsup","harpoons.rtlt"],["updownharpoonsleftright","harpoons.tlbr"],["upharpoonsleftright","harpoons.tltr"],["vdash","tack.r"],["nvdash","tack.r.not"],["vlongdash","tack.r.long"],["assert","tack.r.short"],["vDash","tack.r.double"],["nvDash","tack.r.double.not"],["dashv","tack.l"],["longdashv","tack.l.long"],["shortlefttack","tack.l.short"],["Dashv","tack.l.double"],["bigbot","tack.t.big"],["Vbar","tack.t.double"],["shortuptack","tack.t.short"],["bigtop","tack.b.big"],["barV","tack.b.double"],["shortdowntack","tack.b.short"],["dashVdash","tack.l.r"],["mupalpha","alpha"],["mupbeta","beta"],["mupchi","chi"],["mupdelta","delta"],["mupvarepsilon","epsilon"],["mupepsilon","epsilon.alt"],["mupeta","eta"],["mupgamma","gamma"],["mupiota","iota"],["mupkappa","kappa"],["mupvarkappa","kappa.alt"],["muplambda","lambda"],["mupmu","mu"],["mupnu","nu"],["mho","ohm.inv"],["mupomega","omega"],["mupomicron","omicron"],["mupvarphi","phi"],["mupphi","phi.alt"],["muppi","pi"],["mupvarpi","pi.alt"],["muppsi","psi"],["muprho","rho"],["mupvarrho","rho.alt"],["mupsigma","sigma"],["mupvarsigma","sigma.alt"],["muptau","tau"],["muptheta","theta"],["mupvartheta","theta.alt"],["mupupsilon","upsilon"],["mupxi","xi"],["mupzeta","zeta"],["mupAlpha","Alpha"],["mupBeta","Beta"],["mupChi","Chi"],["mupDelta","Delta"],["mupEpsilon","Epsilon"],["mupEta","Eta"],["mupGamma","Gamma"],["mupIota","Iota"],["mupKappa","Kappa"],["mupLambda","Lambda"],["mupMu","Mu"],["mupNu","Nu"],["mupOmega","Omega"],["mupOmicron","Omicron"],["mupPhi","Phi"],["mupPi","Pi"],["mupPsi","Psi"],["mupRho","Rho"],["mupSigma","Sigma"],["mupTau","Tau"],["mupTheta","Theta"],["mupUpsilon","Upsilon"],["mupXi","Xi"],["mupZeta","Zeta"],["BbbA","AA"],["BbbB","BB"],["BbbC","CC"],["BbbD","DD"],["BbbE","EE"],["BbbF","FF"],["BbbG","GG"],["BbbH","HH"],["BbbI","II"],["BbbJ","JJ"],["BbbK","KK"],["BbbL","LL"],["BbbM","MM"],["BbbN","NN"],["BbbO","OO"],["BbbP","PP"],["BbbQ","QQ"],["BbbR","RR"],["BbbS","SS"],["BbbT","TT"],["BbbU","UU"],["BbbV","VV"],["BbbW","WW"],["BbbX","XX"],["BbbY","YY"],["BbbZ","ZZ"],["ell","ell"],["Planckconst","planck"],["hslash","planck.reduce"],["Angstrom","angstrom"],["Re","Re"],["Im","Im"],["imath","dotless.i"],["jmath","dotless.j"]]);for(let[z,V]of x)if(!K.has(z))K.set(z,V);function F(z,V=""){if(!z)throw new H(V)}function i(z){if(l.includes(z))return 1;else if(_.includes(z))return 2;else return 0}function d(z,V){F(z[V].eq(D));let J=1,X=V+1;while(J>0){if(X>=z.length)throw new H("Unmatched curly brackets");if(z[X].eq(D))J+=1;else if(z[X].eq(v))J-=1;X+=1}return X-1}function p(z,V){F(z[V].eq(I));let J=1,X=V+1;while(J>0){if(X>=z.length)throw new H("Unmatched square brackets");if(z[X].eq(I))J+=1;else if(z[X].eq(T))J-=1;X+=1}return X-1}function P(z){return"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".includes(z)}function g(z){return"0123456789".includes(z)}function A(z,V){let J=V;while(J<z.length&&[4,5].includes(z[J].type))J++;return z.slice(V,J)}function C(z,V){const J=z[V];if(J.type===0&&["(",")","[","]","|","\\{","\\}"].includes(J.value))return J;else if(J.type===1&&["lfloor","rfloor","lceil","rceil","langle","rangle"].includes(J.value.slice(1)))return J;else return null}function U(z,V){let J=V;while(J<z.length&&z[J].eq(new j(0,"'")))J+=1;return J-V}function k(z,V){let J=V;while(J<z.length&&P(z[J]))J+=1;return z.substring(V,J)}function r(z,V){let J=1,X=V;while(J>0){if(X>=z.length)return-1;if(z[X].eq(f))J+=1;else if(z[X].eq(a))J-=1;X+=1}return X-1}function t(z,V){let J=1,X=V;while(J>0){if(X>=z.length)return-1;if(z[X].eq(B))J+=1;else if(z[X].eq(n))J-=1;X+=1}return X-1}function s(z,V){F(z[V]==="{");let J=1,X=V+1;while(J>0){if(X>=z.length)throw new H("Unmatched curly brackets");if(X+1<z.length&&["\\{","\\}"].includes(z.substring(X,X+2))){X+=2;continue}if(z[X]==="{")J+=1;else if(z[X]==="}")J-=1;X+=1}return X-1}function L(z){const V=[];let J=0;while(J<z.length){const X=z[J];let $;switch(X){case"%":{let Z=J+1;while(Z<z.length&&z[Z]!=="\n")Z+=1;$=new j(3,z.slice(J+1,Z)),J=Z;break}case"{":case"}":case"_":case"^":case"&":$=new j(6,X),J++;break;case"\n":$=new j(5,X),J++;break;case"\r":{if(J+1<z.length&&z[J+1]==="\n")$=new j(5,"\n"),J+=2;else $=new j(5,"\n"),J++;break}case" ":{let Z=J;while(Z<z.length&&z[Z]===" ")Z+=1;$=new j(4,z.slice(J,Z)),J=Z;break}case"\\":{if(J+1>=z.length)throw new H("Expecting command name after \\");const Z=z.slice(J,J+2);if(["\\\\","\\,"].includes(Z))$=new j(6,Z);else if(["\\{","\\}","\\%","\\$","\\&","\\#","\\_"].includes(Z))$=new j(0,Z);else{const q=k(z,J+1);$=new j(1,"\\"+q)}J+=$.value.length;break}default:{if(g(X)){let Z=J;while(Z<z.length&&g(z[Z]))Z+=1;$=new j(0,z.slice(J,Z))}else if(P(X))$=new j(0,X);else if("+-*/=\'<>!.,;?()[]|".includes(X))$=new j(0,X);else $=new j(7,X);J+=$.value.length}}if(V.push($),$.type===1&&["\\text","\\operatorname","\\begin","\\end"].includes($.value)){if(J>=z.length||z[J]!=="{")throw new H(`No content for ${$.value} command`);V.push(new j(6,"{"));const Z=s(z,J);J++;let q=z.slice(J,Z);const Q=["{","}","\\","$","&","#","_","%"];for(let W of Q)q=q.replaceAll("\\"+W,W);V.push(new j(2,q)),V.push(new j(6,"}")),J=Z+1}}return V}function o(z){const V=(X)=>X.eq(M)||X.eq(h);let J=[];for(let X=0;X<z.length;X++){if(z[X].type===4&&X+1<z.length&&V(z[X+1]))continue;if(z[X].type===4&&X-1>=0&&V(z[X-1]))continue;J.push(z[X])}return J}function e(z,V){let J=[];for(let X of z)if(X.type===1&&V[X.value]){const $=L(V[X.value]);J=J.concat($)}else J.push(X);return J}function u(z,V){const J=new y;let X=L(z);return X=o(X),X=e(X,V),J.parse(X)}var l=["sqrt","text","bar","bold","boldsymbol","ddot","dot","hat","mathbb","mathbf","mathcal","mathfrak","mathit","mathrm","mathscr","mathsf","mathtt","operatorname","overbrace","overline","pmb","rm","tilde","underbrace","underline","vec","widehat","widetilde"],_=["frac","tfrac","binom","dbinom","dfrac","tbinom"];class j{type;value;constructor(z,V){this.type=z,this.value=V}eq(z){return this.type===z.type&&this.value===z.value}}var N={type:"empty",content:""},D=new j(6,"{"),v=new j(6,"}"),I=new j(0,"["),T=new j(0,"]"),f=new j(1,"\\left"),a=new j(1,"\\right"),B=new j(1,"\\begin"),n=new j(1,"\\end");class H extends Error{constructor(z){super(z);this.name="LatexParserError"}}var M=new j(6,"_"),h=new j(6,"^");class y{space_sensitive;newline_sensitive;constructor(z=!1,V=!0){this.space_sensitive=z,this.newline_sensitive=V}parse(z){const V=[];let J=0;while(J<z.length){const X=[];let $=0;while($<z.length){const[Z,q]=this.parseNextExpr(z,$);if($=q,!this.space_sensitive&&Z.type==="whitespace")continue;if(!this.newline_sensitive&&Z.type==="newline")continue;if(Z.type==="control"&&Z.content==="&")throw new H("Unexpected & outside of an alignment");X.push(Z)}if(X.length===0)return N;else if(X.length===1)return X[0];else return{type:"ordgroup",content:"",args:X}}if(V.length===0)return N;else if(V.length===1)return V[0];else return{type:"ordgroup",content:"",args:V}}parseNextExpr(z,V){let[J,X]=this.parseNextExprWithoutSupSub(z,V),$=null,Z=null,q=0;if(q+=U(z,X),X+=q,X<z.length&&z[X].eq(M)){if([$,X]=this.parseNextExprWithoutSupSub(z,X+1),q+=U(z,X),X+=q,X<z.length&&z[X].eq(h)){if([Z,X]=this.parseNextExprWithoutSupSub(z,X+1),U(z,X)>0)throw new H("Double superscript")}}else if(X<z.length&&z[X].eq(h)){if([Z,X]=this.parseNextExprWithoutSupSub(z,X+1),U(z,X)>0)throw new H("Double superscript");if(X<z.length&&z[X].eq(M)){if([$,X]=this.parseNextExprWithoutSupSub(z,X+1),U(z,X)>0)throw new H("Double superscript")}}if($!==null||Z!==null||q>0){const Q={base:J};if($)Q.sub=$;if(q>0){Q.sup={type:"ordgroup",content:"",args:[]};for(let W=0;W<q;W++)Q.sup.args.push({type:"element",content:"'"});if(Z)Q.sup.args.push(Z);if(Q.sup.args.length===1)Q.sup=Q.sup.args[0]}else if(Z)Q.sup=Z;return[{type:"supsub",content:"",data:Q},X]}else return[J,X]}parseNextExprWithoutSupSub(z,V){const J=z[V];switch(J.type){case 0:return[{type:"element",content:J.value},V+1];case 2:return[{type:"text",content:J.value},V+1];case 3:return[{type:"comment",content:J.value},V+1];case 4:return[{type:"whitespace",content:J.value},V+1];case 5:return[{type:"newline",content:J.value},V+1];case 1:if(J.eq(B))return this.parseBeginEndExpr(z,V);else if(J.eq(f))return this.parseLeftRightExpr(z,V);else return this.parseCommandExpr(z,V);case 6:switch(J.value){case"{":const Z=d(z,V),q=z.slice(V+1,Z);return[this.parse(q),Z+1];case"}":throw new H("Unmatched '}'");case"\\\\":return[{type:"control",content:"\\\\"},V+1];case"\\,":return[{type:"control",content:"\\,"},V+1];case"_":return[N,V];case"^":return[N,V];case"&":return[{type:"control",content:"&"},V+1];default:throw new H("Unknown control sequence")}default:throw new H("Unknown token type")}}parseCommandExpr(z,V){F(z[V].type===1);const J=z[V].value;let X=V+1;if(["left","right","begin","end"].includes(J.slice(1)))throw new H("Unexpected command: "+J);switch(i(J.slice(1))){case 0:if(!K.has(J.slice(1)))return[{type:"unknownMacro",content:J},X];return[{type:"symbol",content:J},X];case 1:{if(J==="\\sqrt"&&X<z.length&&z[X].eq(I)){const Q=X,W=p(z,X),Y=z.slice(Q+1,W),b=this.parse(Y),[w,c]=this.parseNextExprWithoutSupSub(z,W+1);return[{type:"unaryFunc",content:J,args:[w],data:b},c]}else if(J==="\\text"){if(X+2>=z.length)throw new H("Expecting content for \\text command");return F(z[X].eq(D)),F(z[X+1].type===2),F(z[X+2].eq(v)),[{type:"text",content:z[X+1].value},X+3]}let[Z,q]=this.parseNextExprWithoutSupSub(z,X);return[{type:"unaryFunc",content:J,args:[Z]},q]}case 2:{const[Z,q]=this.parseNextExprWithoutSupSub(z,X),[Q,W]=this.parseNextExprWithoutSupSub(z,q);return[{type:"binaryFunc",content:J,args:[Z,Q]},W]}default:throw new Error("Invalid number of parameters")}}parseLeftRightExpr(z,V){F(z[V].eq(f));let J=V+1;if(J+=A(z,J).length,J>=z.length)throw new H("Expecting delimiter after \\left");const X=C(z,J);if(X===null)throw new H("Invalid delimiter after \\left");J++;const $=J,Z=r(z,J);if(Z===-1)throw new H("No matching \\right");const q=Z;if(J=Z+1,J+=A(z,J).length,J>=z.length)throw new H("Expecting \\right after \\left");const Q=C(z,J);if(Q===null)throw new H("Invalid delimiter after \\right");J++;const W=z.slice($,q),Y=this.parse(W);return[{type:"leftright",content:"",args:[{type:"element",content:X.value},Y,{type:"element",content:Q.value}]},J]}parseBeginEndExpr(z,V){F(z[V].eq(B));let J=V+1;F(z[J].eq(D)),F(z[J+1].type===2),F(z[J+2].eq(v));const X=z[J+1].value;J+=3,J+=A(z,J).length;const $=J,Z=t(z,J);if(Z===-1)throw new H("No matching \\end");const q=Z;if(J=Z+1,F(z[J].eq(D)),F(z[J+1].type===2),F(z[J+2].eq(v)),z[J+1].value!==X)throw new H("Mismatched \\begin and \\end environments");J+=3;const Q=z.slice($,q);while(Q.length>0&&[4,5].includes(Q[Q.length-1].type))Q.pop();const W=this.parseAligned(Q);return[{type:"beginend",content:X,data:W},J]}parseAligned(z){let V=0;const J=[];let X=[];J.push(X);let $={type:"ordgroup",content:"",args:[]};X.push($);while(V<z.length){const[Z,q]=this.parseNextExpr(z,V);if(V=q,Z.type==="whitespace")continue;else if(Z.type==="newline"&&!this.newline_sensitive)continue;else if(Z.type==="control"&&Z.content==="\\\\")X=[],$={type:"ordgroup",content:"",args:[]},X.push($),J.push(X);else if(Z.type==="control"&&Z.content==="&")$={type:"ordgroup",content:"",args:[]},X.push($);else $.args.push(Z)}return J}}function m(z){return z.type==="atom"&&["(",")","[","]","{","}","|","\u230A","\u230B","\u2308","\u2309"].includes(z.content)}function G(z){switch(z.type){case"empty":case"whitespace":return{type:"empty",content:""};case"ordgroup":return{type:"group",content:"",args:z.args.map(G)};case"element":return{type:"atom",content:S(z.content)};case"symbol":return{type:"symbol",content:S(z.content)};case"text":return{type:"text",content:z.content};case"comment":return{type:"comment",content:z.content};case"supsub":{let{base:V,sup:J,sub:X}=z.data;if(V&&V.type==="unaryFunc"&&V.content==="\\overbrace"&&J)return{type:"binaryFunc",content:"overbrace",args:[G(V.args[0]),G(J)]};else if(V&&V.type==="unaryFunc"&&V.content==="\\underbrace"&&X)return{type:"binaryFunc",content:"underbrace",args:[G(V.args[0]),G(X)]};const $={base:G(V)};if($.base.type==="empty")$.base={type:"text",content:""};if(J)$.sup=G(J);if(X)$.sub=G(X);return{type:"supsub",content:"",data:$}}case"leftright":{const[V,J,X]=z.args,$={type:"group",content:"",args:z.args.map(G)};if(["[]","()","\\{\\}","\\lfloor\\rfloor","\\lceil\\rceil","\\lfloor\\rceil"].includes(V.content+X.content))return $;return{type:"unaryFunc",content:"lr",args:[$]}}case"binaryFunc":return{type:"binaryFunc",content:S(z.content),args:z.args.map(G)};case"unaryFunc":{const V=G(z.args[0]);if(z.content==="\\sqrt"&&z.data)return{type:"binaryFunc",content:"root",args:[G(z.data),V]};if(z.content==="\\mathbf")return{type:"unaryFunc",content:"upright",args:[{type:"unaryFunc",content:"bold",args:[V]}]};if(z.content==="\\mathbb"&&V.type==="atom"&&/^[A-Z]$/.test(V.content))return{type:"symbol",content:V.content+V.content};if(z.content==="\\operatorname"){const J=z.args;if(J.length!==1||J[0].type!=="text")throw new O("Expecting body of \\operatorname to be text but got",z);const X=J[0].content;if(z2.includes(X))return{type:"symbol",content:X};else return{type:"unaryFunc",content:"op",args:[{type:"text",content:X}]}}return{type:"unaryFunc",content:S(z.content),args:z.args.map(G)}}case"newline":return{type:"newline",content:"\n"};case"beginend":{const J=z.data.map((X)=>X.map(G));if(z.content.startsWith("align"))return{type:"align",content:"",data:J};else return{type:"matrix",content:"mat",data:J}}case"unknownMacro":return{type:"unknown",content:S(z.content)};case"control":if(z.content==="\\\\")return{type:"symbol",content:"\\"};else if(z.content==="\\,")return{type:"symbol",content:"thin"};else throw new O(`Unknown control sequence: ${z.content}`,z);default:throw new O(`Unimplemented node type: ${z.type}`,z)}}function S(z){if(/^[a-zA-Z0-9]$/.test(z))return z;else if(z==="\\\\")return"\\";else if(z=="/")return"\\/";else if(["\\$","\\#","\\&","\\_"].includes(z))return z;else if(z.startsWith("\\")){const V=z.slice(1);if(K.has(V))return K.get(V);else return V}return z}var z2=["dim","id","im","mod","Pr","sech","csch"];class O extends Error{node;constructor(z,V){super(z);this.name="TypstWriterError",this.node=V}}class R{nonStrict;preferTypstIntrinsic;buffer="";queue=[];needSpaceAfterSingleItemScript=!1;insideFunctionDepth=0;constructor(z,V){this.nonStrict=z,this.preferTypstIntrinsic=V}writeBuffer(z){if(this.needSpaceAfterSingleItemScript&&/^[0-9a-zA-Z\(]/.test(z))this.buffer+=" ";else{let V=!1;if(V||=/[\(\|]$/.test(this.buffer)&&/^\w/.test(z),V||=/^[}()_^,;!\|]$/.test(z),V||=z==="'",V||=/[0-9]$/.test(this.buffer)&&/^[0-9]/.test(z),V||=/[\(\[{]\s*(-|\+)$/.test(this.buffer)||this.buffer==="-"||this.buffer==="+",V||=z.startsWith("\n"),V||=this.buffer==="",V||=/[\s_^{\(]$/.test(this.buffer),!V)this.buffer+=" "}if(this.needSpaceAfterSingleItemScript)this.needSpaceAfterSingleItemScript=!1;this.buffer+=z}append(z){switch(z.type){case"empty":break;case"atom":{if(z.content===","&&this.insideFunctionDepth>0)this.queue.push({type:"symbol",content:"comma"});else this.queue.push({type:"atom",content:z.content});break}case"symbol":case"text":case"comment":case"newline":this.queue.push(z);break;case"group":for(let V of z.args)this.append(V);break;case"supsub":{let{base:V,sup:J,sub:X}=z.data;this.appendWithBracketsIfNeeded(V);let $=!1;const Z=J&&J.type==="atom"&&J.content==="\'";if(Z)this.queue.push({type:"atom",content:"\'"}),$=!1;if(X)this.queue.push({type:"atom",content:"_"}),$=this.appendWithBracketsIfNeeded(X);if(J&&!Z)this.queue.push({type:"atom",content:"^"}),$=this.appendWithBracketsIfNeeded(J);if($)this.queue.push({type:"softSpace",content:""});break}case"binaryFunc":{const V={type:"symbol",content:z.content},[J,X]=z.args;this.queue.push(V),this.insideFunctionDepth++,this.queue.push({type:"atom",content:"("}),this.append(J),this.queue.push({type:"atom",content:","}),this.append(X),this.queue.push({type:"atom",content:")"}),this.insideFunctionDepth--;break}case"unaryFunc":{const V={type:"symbol",content:z.content},J=z.args[0];this.queue.push(V),this.insideFunctionDepth++,this.queue.push({type:"atom",content:"("}),this.append(J),this.queue.push({type:"atom",content:")"}),this.insideFunctionDepth--;break}case"align":{const V=z.data;V.forEach((J,X)=>{if(J.forEach(($,Z)=>{if(Z>0)this.queue.push({type:"atom",content:"&"});this.append($)}),X<V.length-1)this.queue.push({type:"symbol",content:"\\"})});break}case"matrix":{const V=z.data;this.queue.push({type:"symbol",content:"mat"}),this.insideFunctionDepth++,this.queue.push({type:"atom",content:"("}),this.queue.push({type:"symbol",content:"delim: #none, "}),V.forEach((J,X)=>{J.forEach(($,Z)=>{if(this.append($),Z<J.length-1)this.queue.push({type:"atom",content:","});else if(X<V.length-1)this.queue.push({type:"atom",content:";"})})}),this.queue.push({type:"atom",content:")"}),this.insideFunctionDepth--;break}case"unknown":{if(this.nonStrict)this.queue.push({type:"symbol",content:z.content});else throw new O(`Unknown macro: ${z.content}`,z);break}default:throw new O(`Unimplemented node type to append: ${z.type}`,z)}}appendWithBracketsIfNeeded(z){let V=["group","supsub","empty"].includes(z.type);if(z.type==="group"){const J=z.args[0],X=z.args[z.args.length-1];if(m(J)&&m(X))V=!1}if(V)this.queue.push({type:"atom",content:"("}),this.append(z),this.queue.push({type:"atom",content:")"});else this.append(z);return!V}flushQueue(){this.queue.forEach((z)=>{let V="";switch(z.type){case"atom":case"symbol":V=z.content;break;case"text":V=`"${z.content}"`;break;case"softSpace":this.needSpaceAfterSingleItemScript=!0,V="";break;case"comment":V=`//${z.content}`;break;case"newline":V="\n";break;default:throw new O(`Unexpected node type to stringify: ${z.type}`,z)}if(V!=="")this.writeBuffer(V)}),this.queue=[]}finalize(){this.flushQueue();const X=[function($){let Z=$.replace(/floor\.l\s*(.*?)\s*floor\.r/g,"floor($1)");return Z=Z.replace(/floor\(\)/g,'floor("")'),Z},function($){let Z=$.replace(/ceil\.l\s*(.*?)\s*ceil\.r/g,"ceil($1)");return Z=Z.replace(/ceil\(\)/g,'ceil("")'),Z},function($){let Z=$.replace(/floor\.l\s*(.*?)\s*ceil\.r/g,"round($1)");return Z=Z.replace(/round\(\)/g,'round("")'),Z}];for(let $ of X)this.buffer=$(this.buffer);return this.buffer}}function E(z,V){const J={nonStrict:!0,preferTypstIntrinsic:!0,customTexMacros:{}};if(V){if(V.nonStrict)J.nonStrict=V.nonStrict;if(V.preferTypstIntrinsic)J.preferTypstIntrinsic=V.preferTypstIntrinsic;if(V.customTexMacros)J.customTexMacros=V.customTexMacros}const X=u(z,J.customTexMacros),$=G(X),Z=new R(J.nonStrict,J.preferTypstIntrinsic);return Z.append($),Z.finalize()}if(typeof window!=="undefined")window.tex2typst=E; |
{ | ||
"name": "tex2typst", | ||
"version": "0.2.11", | ||
"version": "0.2.12", | ||
"description": "JavaScript library for converting TeX code to Typst", | ||
@@ -22,3 +22,4 @@ "type": "module", | ||
"build": "npm run build:node && npm run build:browser && npm run build:types", | ||
"test": "vitest run" | ||
"test": "vitest run", | ||
"publish": "npm run build && npm run test && npm publish" | ||
}, | ||
@@ -25,0 +26,0 @@ "devDependencies": { |
815
src/map.ts
@@ -1,2 +0,2 @@ | ||
export const symbolMap = new Map<string, string>([ | ||
const symbolMap = new Map<string, string>([ | ||
['nonumber', ''], | ||
@@ -44,3 +44,2 @@ ['vec', 'arrow'], | ||
['mp', 'minus.plus'], | ||
['oplus', 'xor'], // \oplus and also be plus.circle | ||
['boxplus', 'plus.square'], | ||
@@ -53,4 +52,3 @@ ['otimes', 'times.circle'], | ||
// tex: \sim \approx \cong \simeq \asymp \equiv \propto | ||
// typst: tilde approx tilde.equiv tilde.eq ≍ equiv prop | ||
['sim', 'tilde'], | ||
// typst: tilde.op approx tilde.equiv tilde.eq ≍ equiv prop | ||
['approx', 'approx'], | ||
@@ -63,12 +61,2 @@ ['cong', 'tilde.equiv'], | ||
/* left and right floor,ceil */ | ||
// tex: \lfloor \rfloor \lceil \rceil | ||
// typst: ⌊ ⌋ ⌈ ⌉ | ||
// TODO: Ideally, \lfloor x \rfloor should be translated to floor(x) but it is not implemented now. | ||
// The KaTeX parser parses it as \lfloor x \rfloor. So it would take some effort to implement it. | ||
['lfloor', '⌊'], | ||
['rfloor', '⌋'], | ||
['lceil', '⌈'], | ||
['rceil', '⌉'], | ||
/* arrows */ | ||
@@ -86,3 +74,3 @@ ['gets', 'arrow.l'], | ||
['Longleftrightarrow', 'arrow.l.r.double.long'], | ||
['longmapsto', 'arrow.r.bar'], | ||
// ['longmapsto', 'arrow.r.bar'], | ||
['hookrightarrow', 'arrow.r.hook'], | ||
@@ -133,3 +121,3 @@ ['rightharpoonup', 'harpoon.rt'], | ||
['approxeq', 'approx.eq'], | ||
['ast', 'ast'], | ||
// ['ast', 'ast'], | ||
['beta', 'beta'], | ||
@@ -140,7 +128,7 @@ ['bigcap', 'sect.big'], | ||
['bigodot', 'dot.circle.big'], | ||
['bigoplus', 'xor.big'], // or "plus.circle.big" | ||
// ['bigoplus', 'xor.big'], // or "plus.circle.big" | ||
['bigotimes', 'times.circle.big'], | ||
['bigsqcup', 'union.sq.big'], | ||
['bigtriangledown', 'triangle.b'], | ||
['bigtriangleup', 'triangle.t'], | ||
// ['bigtriangledown', 'triangle.b'], | ||
// ['bigtriangleup', 'triangle.t'], | ||
['biguplus', 'union.plus.big'], | ||
@@ -189,3 +177,3 @@ ['bigvee', 'or.big'], | ||
['imath', 'dotless.i'], | ||
['iiiint', 'intgral.quad'], | ||
['iiiint', 'integral.quad'], | ||
['iiint', 'integral.triple'], | ||
@@ -215,7 +203,7 @@ ['iint', 'integral.double'], | ||
['ll', 'lt.double'], | ||
['longmapsto', 'arrow.bar.long'], | ||
['longrightarrow', 'arrow.long'], | ||
// ['longmapsto', 'arrow.bar.long'], | ||
// ['longrightarrow', 'arrow.long'], | ||
['lor', 'or'], | ||
['ltimes', 'times.l'], | ||
['mapsto', 'arrow.bar'], | ||
// ['mapsto', 'arrow.bar'], | ||
['measuredangle', 'angle.arc'], | ||
@@ -226,5 +214,5 @@ ['mid', 'divides'], | ||
['mu', 'mu'], | ||
['nRightarrow', 'arrow.double.not'], | ||
// ['nRightarrow', 'arrow.double.not'], | ||
['nabla', 'nabla'], | ||
['ncong', 'tilde.nequiv'], | ||
['ncong', 'tilde.equiv.not'], | ||
['ne', 'eq.not'], | ||
@@ -241,3 +229,3 @@ ['neg', 'not'], | ||
['notin', 'in.not'], | ||
['nrightarrow', 'arrow.not'], | ||
// ['nrightarrow', 'arrow.not'], | ||
['nsim', 'tilde.not'], | ||
@@ -256,3 +244,3 @@ ['nsubseteq', 'subset.eq.not'], | ||
['ominus', 'minus.circle'], | ||
['oplus', 'xor'], // or 'plus.circle' | ||
// ['oplus', 'xor'], // or 'plus.circle' | ||
['otimes', 'times.circle'], | ||
@@ -282,3 +270,3 @@ ['parallel', 'parallel'], | ||
['sigma', 'sigma'], | ||
['sim', 'tilde'], | ||
['sim', 'tilde.op'], | ||
['simeq', 'tilde.eq'], | ||
@@ -293,3 +281,3 @@ ['slash', 'slash'], | ||
['sqsupseteq', 'supset.eq.sq'], | ||
['star', 'star'], | ||
// ['star', 'star'], | ||
['subset', 'subset'], | ||
@@ -311,5 +299,5 @@ ['subseteq', 'subset.eq'], | ||
['triangle', 'triangle.t'], | ||
['triangledown', 'triangle.b.small'], | ||
['triangleleft', 'triangle.l.small'], | ||
['triangleright', 'triangle.r.small'], | ||
// ['triangledown', 'triangle.b.small'], | ||
// ['triangleleft', 'triangle.l.small'], | ||
// ['triangleright', 'triangle.r.small'], | ||
['twoheadrightarrow', 'arrow.r.twohead'], | ||
@@ -342,1 +330,764 @@ ['uparrow', 'arrow.t'], | ||
]); | ||
// The following are from Typst documentation website, augo-generated by the script | ||
const map_from_official_docs: Map<string, string> = new Map([ | ||
['lparen', 'paren.l'], | ||
['lParen', 'paren.l.double'], | ||
['rparen', 'paren.r'], | ||
['rParen', 'paren.r.double'], | ||
['overparen', 'paren.t'], | ||
['underparen', 'paren.b'], | ||
['lbrace', 'brace.l'], | ||
['lBrace', 'brace.l.double'], | ||
['rbrace', 'brace.r'], | ||
['rBrace', 'brace.r.double'], | ||
// ['overbrace', 'brace.t'], | ||
['underbrace', 'brace.b'], | ||
['lbrack', 'bracket.l'], | ||
['lBrack', 'bracket.l.double'], | ||
['rbrack', 'bracket.r'], | ||
['rBrack', 'bracket.r.double'], | ||
['overbracket', 'bracket.t'], | ||
['underbracket', 'bracket.b'], | ||
['lbrbrak', 'shell.l'], | ||
['Lbrbrak', 'shell.l.double'], | ||
['rbrbrak', 'shell.r'], | ||
['Rbrbrak', 'shell.r.double'], | ||
['obrbrak', 'shell.t'], | ||
['ubrbrak', 'shell.b'], | ||
['vert', 'bar.v'], | ||
['Vert', 'bar.v.double'], | ||
['Vvert', 'bar.v.triple'], | ||
['circledvert', 'bar.v.circle'], | ||
['horizbar', 'bar.h'], | ||
['lvzigzag', 'fence.l'], | ||
['Lvzigzag', 'fence.l.double'], | ||
['rvzigzag', 'fence.r'], | ||
['Rvzigzag', 'fence.r.double'], | ||
['fourvdots', 'fence.dotted'], | ||
['angle', 'angle'], | ||
['langle', 'angle.l'], | ||
['lcurvyangle', 'angle.l.curly'], | ||
['langledot', 'angle.l.dot'], | ||
['rangle', 'angle.r'], | ||
['rcurvyangle', 'angle.r.curly'], | ||
['rangledot', 'angle.r.dot'], | ||
['angdnr', 'angle.acute'], | ||
['measuredangle', 'angle.arc'], | ||
['measuredangleleft', 'angle.arc.rev'], | ||
['wideangledown', 'angle.oblique'], | ||
['revangle', 'angle.rev'], | ||
['rightangle', 'angle.right'], | ||
['measuredrightangle', 'angle.right.arc'], | ||
['rightanglemdot', 'angle.right.dot'], | ||
['rightanglesqr', 'angle.right.sq'], | ||
['angles', 'angle.s'], | ||
['threedangle', 'angle.spatial'], | ||
['sphericalangle', 'angle.spheric'], | ||
['gtlpar', 'angle.spheric.rev'], | ||
['sphericalangleup', 'angle.spheric.top'], | ||
['lceil', 'ceil.l'], | ||
['rceil', 'ceil.r'], | ||
['lfloor', 'floor.l'], | ||
['rfloor', 'floor.r'], | ||
['mathampersand', 'amp'], | ||
['upand', 'amp.inv'], | ||
['ast', 'ast.op'], | ||
['circledast', 'ast.circle'], | ||
['boxast', 'ast.square'], | ||
['mathatsign', 'at'], | ||
['backslash', 'backslash'], | ||
['obslash', 'backslash.circle'], | ||
['rsolbar', 'backslash.not'], | ||
['mathcolon', 'colon'], | ||
['Colon', 'colon.double'], | ||
['coloneq', 'colon.eq'], | ||
['Coloneq', 'colon.double.eq'], | ||
['mathcomma', 'comma'], | ||
['dagger', 'dagger'], | ||
['ddagger', 'dagger.double'], | ||
['dashcolon', 'dash.colon'], | ||
['circleddash', 'dash.circle'], | ||
['hzigzag', 'dash.wave.double'], | ||
['cdot', 'dot.op'], | ||
['mathperiod', 'dot.basic'], | ||
['cdotp', 'dot.c'], | ||
['odot', 'dot.circle'], | ||
['bigodot', 'dot.circle.big'], | ||
['boxdot', 'dot.square'], | ||
['dddot', 'dot.triple'], | ||
['ddddot', 'dot.quad'], | ||
['mathexclam', 'excl'], | ||
['Exclam', 'excl.double'], | ||
['mathquestion', 'quest'], | ||
['Question', 'quest.double'], | ||
['mathoctothorpe', 'hash'], | ||
['mathhyphen', 'hyph'], | ||
['mathpercent', 'percent'], | ||
['mathparagraph', 'pilcrow'], | ||
['mathsection', 'section'], | ||
['mathsemicolon', 'semi'], | ||
['mathslash', 'slash'], | ||
['sslash', 'slash.double'], | ||
['trslash', 'slash.triple'], | ||
['xsol', 'slash.big'], | ||
['unicodecdots', 'dots.h.c'], | ||
['unicodeellipsis', 'dots.h'], | ||
['vdots', 'dots.v'], | ||
['ddots', 'dots.down'], | ||
['adots', 'dots.up'], | ||
['sim', 'tilde.op'], | ||
['dotsim', 'tilde.dot'], | ||
['sime', 'tilde.eq'], | ||
['nsimeq', 'tilde.eq.not'], | ||
['backsimeq', 'tilde.eq.rev'], | ||
['cong', 'tilde.equiv'], | ||
['ncong', 'tilde.equiv.not'], | ||
['simneqq', 'tilde.nequiv'], | ||
['nsim', 'tilde.not'], | ||
['backsim', 'tilde.rev'], | ||
['backcong', 'tilde.rev.equiv'], | ||
['approxident', 'tilde.triple'], | ||
['caretinsert', 'caret'], | ||
['prime', 'prime'], | ||
['backprime', 'prime.rev'], | ||
['dprime', 'prime.double'], | ||
['backdprime', 'prime.double.rev'], | ||
['trprime', 'prime.triple'], | ||
['backtrprime', 'prime.triple.rev'], | ||
['qprime', 'prime.quad'], | ||
['mathplus', 'plus'], | ||
['oplus', 'plus.circle'], | ||
['rightarrowonoplus', 'plus.circle.arrow'], | ||
['bigoplus', 'plus.circle.big'], | ||
['dotplus', 'plus.dot'], | ||
['doubleplus', 'plus.double'], | ||
['pm', 'plus.minus'], | ||
['boxplus', 'plus.square'], | ||
['triangleplus', 'plus.triangle'], | ||
['tripleplus', 'plus.triple'], | ||
['minus', 'minus'], | ||
['ominus', 'minus.circle'], | ||
['dotminus', 'minus.dot'], | ||
['mp', 'minus.plus'], | ||
['boxminus', 'minus.square'], | ||
['eqsim', 'minus.tilde'], | ||
['triangleminus', 'minus.triangle'], | ||
['div', 'div'], | ||
['odiv', 'div.circle'], | ||
['times', 'times'], | ||
['bigtimes', 'times.big'], | ||
['otimes', 'times.circle'], | ||
['bigotimes', 'times.circle.big'], | ||
['divideontimes', 'times.div'], | ||
['leftthreetimes', 'times.three.l'], | ||
['rightthreetimes', 'times.three.r'], | ||
['ltimes', 'times.l'], | ||
['rtimes', 'times.r'], | ||
['boxtimes', 'times.square'], | ||
['triangletimes', 'times.triangle'], | ||
['mathratio', 'ratio'], | ||
['equal', 'eq'], | ||
['stareq', 'eq.star'], | ||
['circledequal', 'eq.circle'], | ||
['eqcolon', 'eq.colon'], | ||
['eqdef', 'eq.def'], | ||
['triangleq', 'eq.delta'], | ||
['veeeq', 'eq.equi'], | ||
['wedgeq', 'eq.est'], | ||
['eqgtr', 'eq.gt'], | ||
['eqless', 'eq.lt'], | ||
['measeq', 'eq.m'], | ||
['ne', 'eq.not'], | ||
['curlyeqprec', 'eq.prec'], | ||
['questeq', 'eq.quest'], | ||
['curlyeqsucc', 'eq.succ'], | ||
['equiv', 'eq.triple'], | ||
['Equiv', 'eq.quad'], | ||
['greater', 'gt'], | ||
['ogreaterthan', 'gt.circle'], | ||
['gtrdot', 'gt.dot'], | ||
['gtrapprox', 'gt.approx'], | ||
['gg', 'gt.double'], | ||
['geq', 'gt.eq'], | ||
['geqslant', 'gt.eq.slant'], | ||
['gtreqless', 'gt.eq.lt'], | ||
['ngeq', 'gt.eq.not'], | ||
['geqq', 'gt.equiv'], | ||
['gtrless', 'gt.lt'], | ||
['ngtrless', 'gt.lt.not'], | ||
['gneq', 'gt.neq'], | ||
['gnapprox', 'gt.napprox'], | ||
['gneqq', 'gt.nequiv'], | ||
['ngtr', 'gt.not'], | ||
['gnsim', 'gt.ntilde'], | ||
['gtrsim', 'gt.tilde'], | ||
['ngtrsim', 'gt.tilde.not'], | ||
['vartriangleright', 'gt.tri'], | ||
['trianglerighteq', 'gt.tri.eq'], | ||
['ntrianglerighteq', 'gt.tri.eq.not'], | ||
['nvartriangleright', 'gt.tri.not'], | ||
['ggg', 'gt.triple'], | ||
['gggnest', 'gt.triple.nested'], | ||
['less', 'lt'], | ||
['olessthan', 'lt.circle'], | ||
['lessdot', 'lt.dot'], | ||
['lessapprox', 'lt.approx'], | ||
['ll', 'lt.double'], | ||
['leq', 'lt.eq'], | ||
['leqslant', 'lt.eq.slant'], | ||
['lesseqgtr', 'lt.eq.gt'], | ||
['nleq', 'lt.eq.not'], | ||
['leqq', 'lt.equiv'], | ||
['lessgtr', 'lt.gt'], | ||
['nlessgtr', 'lt.gt.not'], | ||
['lneq', 'lt.neq'], | ||
['lnapprox', 'lt.napprox'], | ||
['lneqq', 'lt.nequiv'], | ||
['nless', 'lt.not'], | ||
['lnsim', 'lt.ntilde'], | ||
['lesssim', 'lt.tilde'], | ||
['nlesssim', 'lt.tilde.not'], | ||
['vartriangleleft', 'lt.tri'], | ||
['trianglelefteq', 'lt.tri.eq'], | ||
['ntrianglelefteq', 'lt.tri.eq.not'], | ||
['nvartriangleleft', 'lt.tri.not'], | ||
['lll', 'lt.triple'], | ||
['lllnest', 'lt.triple.nested'], | ||
['approx', 'approx'], | ||
['approxeq', 'approx.eq'], | ||
['napprox', 'approx.not'], | ||
['prec', 'prec'], | ||
['precapprox', 'prec.approx'], | ||
['preccurlyeq', 'prec.curly.eq'], | ||
['npreccurlyeq', 'prec.curly.eq.not'], | ||
['Prec', 'prec.double'], | ||
['preceq', 'prec.eq'], | ||
['preceqq', 'prec.equiv'], | ||
['precnapprox', 'prec.napprox'], | ||
['precneq', 'prec.neq'], | ||
['precneqq', 'prec.nequiv'], | ||
['nprec', 'prec.not'], | ||
['precnsim', 'prec.ntilde'], | ||
['precsim', 'prec.tilde'], | ||
['succ', 'succ'], | ||
['succapprox', 'succ.approx'], | ||
['succcurlyeq', 'succ.curly.eq'], | ||
['nsucccurlyeq', 'succ.curly.eq.not'], | ||
['Succ', 'succ.double'], | ||
['succeq', 'succ.eq'], | ||
['succeqq', 'succ.equiv'], | ||
['succnapprox', 'succ.napprox'], | ||
['succneq', 'succ.neq'], | ||
['succneqq', 'succ.nequiv'], | ||
['nsucc', 'succ.not'], | ||
['succnsim', 'succ.ntilde'], | ||
['succsim', 'succ.tilde'], | ||
['nequiv', 'equiv.not'], | ||
['propto', 'prop'], | ||
['origof', 'original'], | ||
['imageof', 'image'], | ||
['varnothing', 'emptyset'], | ||
['emptysetoarr', 'emptyset.arrow.r'], | ||
['emptysetoarrl', 'emptyset.arrow.l'], | ||
['emptysetobar', 'emptyset.bar'], | ||
['emptysetocirc', 'emptyset.circle'], | ||
['revemptyset', 'emptyset.rev'], | ||
['setminus', 'without'], | ||
['complement', 'complement'], | ||
['in', 'in'], | ||
['notin', 'in.not'], | ||
['ni', 'in.rev'], | ||
['nni', 'in.rev.not'], | ||
['smallni', 'in.rev.small'], | ||
['smallin', 'in.small'], | ||
['subset', 'subset'], | ||
['subsetdot', 'subset.dot'], | ||
['Subset', 'subset.double'], | ||
['subseteq', 'subset.eq'], | ||
['nsubseteq', 'subset.eq.not'], | ||
['sqsubseteq', 'subset.eq.sq'], | ||
['nsqsubseteq', 'subset.eq.sq.not'], | ||
['subsetneq', 'subset.neq'], | ||
['nsubset', 'subset.not'], | ||
['sqsubset', 'subset.sq'], | ||
['sqsubsetneq', 'subset.sq.neq'], | ||
['supset', 'supset'], | ||
['supsetdot', 'supset.dot'], | ||
['Supset', 'supset.double'], | ||
['supseteq', 'supset.eq'], | ||
['nsupseteq', 'supset.eq.not'], | ||
['sqsupseteq', 'supset.eq.sq'], | ||
['nsqsupseteq', 'supset.eq.sq.not'], | ||
['supsetneq', 'supset.neq'], | ||
['nsupset', 'supset.not'], | ||
['sqsupset', 'supset.sq'], | ||
['sqsupsetneq', 'supset.sq.neq'], | ||
['cup', 'union'], | ||
['cupleftarrow', 'union.arrow'], | ||
['bigcup', 'union.big'], | ||
['cupdot', 'union.dot'], | ||
['bigcupdot', 'union.dot.big'], | ||
['Cup', 'union.double'], | ||
['uminus', 'union.minus'], | ||
['cupvee', 'union.or'], | ||
['uplus', 'union.plus'], | ||
['biguplus', 'union.plus.big'], | ||
['sqcup', 'union.sq'], | ||
['bigsqcup', 'union.sq.big'], | ||
['Sqcup', 'union.sq.double'], | ||
['cap', 'sect'], | ||
['capwedge', 'sect.and'], | ||
['bigcap', 'sect.big'], | ||
['capdot', 'sect.dot'], | ||
['Cap', 'sect.double'], | ||
['sqcap', 'sect.sq'], | ||
['bigsqcap', 'sect.sq.big'], | ||
['Sqcap', 'sect.sq.double'], | ||
['infty', 'infinity'], | ||
['nvinfty', 'infinity.bar'], | ||
['iinfin', 'infinity.incomplete'], | ||
['tieinfty', 'infinity.tie'], | ||
['partial', 'diff'], | ||
['nabla', 'gradient'], | ||
['sum', 'sum'], | ||
['sumint', 'sum.integral'], | ||
['prod', 'product'], | ||
['coprod', 'product.co'], | ||
['int', 'integral'], | ||
['intlarhk', 'integral.arrow.hook'], | ||
['awint', 'integral.ccw'], | ||
['oint', 'integral.cont'], | ||
['ointctrclockwise', 'integral.cont.ccw'], | ||
['varointclockwise', 'integral.cont.cw'], | ||
['intclockwise', 'integral.cw'], | ||
['intbar', 'integral.dash'], | ||
['intBar', 'integral.dash.double'], | ||
['iint', 'integral.double'], | ||
['iiiint', 'integral.quad'], | ||
['intcap', 'integral.sect'], | ||
['fint', 'integral.slash'], | ||
['sqint', 'integral.square'], | ||
['oiint', 'integral.surf'], | ||
['intx', 'integral.times'], | ||
['iiint', 'integral.triple'], | ||
['intcup', 'integral.union'], | ||
['oiiint', 'integral.vol'], | ||
['increment', 'laplace'], | ||
['forall', 'forall'], | ||
['exists', 'exists'], | ||
['nexists', 'exists.not'], | ||
['top', 'top'], | ||
['bot', 'bot'], | ||
['neg', 'not'], | ||
['wedge', 'and'], | ||
['bigwedge', 'and.big'], | ||
['curlywedge', 'and.curly'], | ||
['wedgedot', 'and.dot'], | ||
['Wedge', 'and.double'], | ||
['vee', 'or'], | ||
['bigvee', 'or.big'], | ||
['curlyvee', 'or.curly'], | ||
['veedot', 'or.dot'], | ||
['Vee', 'or.double'], | ||
['models', 'models'], | ||
['Vdash', 'forces'], | ||
['nVdash', 'forces.not'], | ||
['therefore', 'therefore'], | ||
['because', 'because'], | ||
['QED', 'qed'], | ||
['vysmwhtcircle', 'compose'], | ||
['multimap', 'multimap'], | ||
['dualmap', 'multimap.double'], | ||
['tplus', 'tiny'], | ||
['tminus', 'miny'], | ||
['mid', 'divides'], | ||
['nmid', 'divides.not'], | ||
['wr', 'wreath'], | ||
['parallel', 'parallel'], | ||
['nhpar', 'parallel.struck'], | ||
['circledparallel', 'parallel.circle'], | ||
['equalparallel', 'parallel.eq'], | ||
['equivVert', 'parallel.equiv'], | ||
['nparallel', 'parallel.not'], | ||
['eparsl', 'parallel.slanted.eq'], | ||
['smeparsl', 'parallel.slanted.eq.tilde'], | ||
['eqvparsl', 'parallel.slanted.equiv'], | ||
['parsim', 'parallel.tilde'], | ||
['perp', 'perp'], | ||
['operp', 'perp.circle'], | ||
['diameter', 'diameter'], | ||
['Join', 'join'], | ||
['rightouterjoin', 'join.r'], | ||
['leftouterjoin', 'join.l'], | ||
['fullouterjoin', 'join.l.r'], | ||
['smashtimes', 'smash'], | ||
['mathdollar', 'dollar'], | ||
['euro', 'euro'], | ||
['mathsterling', 'pound'], | ||
['mathyen', 'yen'], | ||
['checkmark', 'checkmark'], | ||
['maltese', 'maltese'], | ||
['clubsuit', 'suit.club.filled'], | ||
['varclubsuit', 'suit.club.stroked'], | ||
['vardiamondsuit', 'suit.diamond.filled'], | ||
['diamondsuit', 'suit.diamond.stroked'], | ||
['varheartsuit', 'suit.heart.filled'], | ||
['heartsuit', 'suit.heart.stroked'], | ||
['spadesuit', 'suit.spade.filled'], | ||
['varspadesuit', 'suit.spade.stroked'], | ||
['quarternote', 'note.quarter.alt'], | ||
['eighthnote', 'note.eighth.alt'], | ||
['twonotes', 'note.eighth.beamed'], | ||
['natural', 'natural'], | ||
['flat', 'flat'], | ||
['sharp', 'sharp'], | ||
['smblkcircle', 'bullet'], | ||
['mdlgwhtcircle', 'circle.stroked'], | ||
['mdsmwhtcircle', 'circle.stroked.small'], | ||
['lgwhtcircle', 'circle.stroked.big'], | ||
['mdlgblkcircle', 'circle.filled'], | ||
['mdsmblkcircle', 'circle.filled.tiny'], | ||
['vysmblkcircle', 'circle.filled.small'], | ||
['lgblkcircle', 'circle.filled.big'], | ||
['dottedcircle', 'circle.dotted'], | ||
['circledcirc', 'circle.nested'], | ||
['whthorzoval', 'ellipse.stroked.h'], | ||
['whtvertoval', 'ellipse.stroked.v'], | ||
['blkhorzoval', 'ellipse.filled.h'], | ||
['blkvertoval', 'ellipse.filled.v'], | ||
['bigtriangleup', 'triangle.stroked.t'], | ||
['bigtriangledown', 'triangle.stroked.b'], | ||
['triangleright', 'triangle.stroked.r'], | ||
['triangleleft', 'triangle.stroked.l'], | ||
['lltriangle', 'triangle.stroked.bl'], | ||
['lrtriangle', 'triangle.stroked.br'], | ||
['ultriangle', 'triangle.stroked.tl'], | ||
['urtriangle', 'triangle.stroked.tr'], | ||
['vartriangle', 'triangle.stroked.small.t'], | ||
['triangledown', 'triangle.stroked.small.b'], | ||
['smalltriangleright', 'triangle.stroked.small.r'], | ||
['smalltriangleleft', 'triangle.stroked.small.l'], | ||
['whiteinwhitetriangle', 'triangle.stroked.nested'], | ||
['trianglecdot', 'triangle.stroked.dot'], | ||
['bigblacktriangleup', 'triangle.filled.t'], | ||
['bigblacktriangledown', 'triangle.filled.b'], | ||
['blacktriangleright', 'triangle.filled.r'], | ||
['blacktriangleleft', 'triangle.filled.l'], | ||
['llblacktriangle', 'triangle.filled.bl'], | ||
['lrblacktriangle', 'triangle.filled.br'], | ||
['ulblacktriangle', 'triangle.filled.tl'], | ||
['urblacktriangle', 'triangle.filled.tr'], | ||
['blacktriangle', 'triangle.filled.small.t'], | ||
['blacktriangledown', 'triangle.filled.small.b'], | ||
['smallblacktriangleright', 'triangle.filled.small.r'], | ||
['smallblacktriangleleft', 'triangle.filled.small.l'], | ||
['mdlgwhtsquare', 'square.stroked'], | ||
['smwhtsquare', 'square.stroked.tiny'], | ||
['mdsmwhtsquare', 'square.stroked.small'], | ||
['mdwhtsquare', 'square.stroked.medium'], | ||
['lgwhtsquare', 'square.stroked.big'], | ||
['dottedsquare', 'square.stroked.dotted'], | ||
['squoval', 'square.stroked.rounded'], | ||
['mdlgblksquare', 'square.filled'], | ||
['smblksquare', 'square.filled.tiny'], | ||
['mdsmblksquare', 'square.filled.small'], | ||
['mdblksquare', 'square.filled.medium'], | ||
['lgblksquare', 'square.filled.big'], | ||
['hrectangle', 'rect.stroked.h'], | ||
['vrectangle', 'rect.stroked.v'], | ||
['hrectangleblack', 'rect.filled.h'], | ||
['vrectangleblack', 'rect.filled.v'], | ||
['pentagon', 'penta.stroked'], | ||
['pentagonblack', 'penta.filled'], | ||
['varhexagon', 'hexa.stroked'], | ||
['varhexagonblack', 'hexa.filled'], | ||
['mdlgwhtdiamond', 'diamond.stroked'], | ||
['smwhtdiamond', 'diamond.stroked.small'], | ||
['mdwhtdiamond', 'diamond.stroked.medium'], | ||
['diamondcdot', 'diamond.stroked.dot'], | ||
['mdlgblkdiamond', 'diamond.filled'], | ||
['mdblkdiamond', 'diamond.filled.medium'], | ||
['smblkdiamond', 'diamond.filled.small'], | ||
['mdlgwhtlozenge', 'lozenge.stroked'], | ||
['smwhtlozenge', 'lozenge.stroked.small'], | ||
['mdwhtlozenge', 'lozenge.stroked.medium'], | ||
['mdlgblklozenge', 'lozenge.filled'], | ||
['smblklozenge', 'lozenge.filled.small'], | ||
['mdblklozenge', 'lozenge.filled.medium'], | ||
['parallelogram', 'parallelogram.stroked'], | ||
['parallelogramblack', 'parallelogram.filled'], | ||
['star', 'star.op'], | ||
['bigwhitestar', 'star.stroked'], | ||
['bigstar', 'star.filled'], | ||
['rightarrow', 'arrow.r'], | ||
['longmapsto', 'arrow.r.long.bar'], | ||
['mapsto', 'arrow.r.bar'], | ||
['rightdowncurvedarrow', 'arrow.r.curve'], | ||
['rightdasharrow', 'arrow.r.dashed'], | ||
['rightdotarrow', 'arrow.r.dotted'], | ||
['Rightarrow', 'arrow.r.double'], | ||
['Mapsto', 'arrow.r.double.bar'], | ||
['Longrightarrow', 'arrow.r.double.long'], | ||
['Longmapsto', 'arrow.r.double.long.bar'], | ||
['nRightarrow', 'arrow.r.double.not'], | ||
['hookrightarrow', 'arrow.r.hook'], | ||
['longrightarrow', 'arrow.r.long'], | ||
['longrightsquigarrow', 'arrow.r.long.squiggly'], | ||
['looparrowright', 'arrow.r.loop'], | ||
['nrightarrow', 'arrow.r.not'], | ||
['RRightarrow', 'arrow.r.quad'], | ||
['rightsquigarrow', 'arrow.r.squiggly'], | ||
['rightarrowbar', 'arrow.r.stop'], | ||
['rightwhitearrow', 'arrow.r.stroked'], | ||
['rightarrowtail', 'arrow.r.tail'], | ||
['similarrightarrow', 'arrow.r.tilde'], | ||
['Rrightarrow', 'arrow.r.triple'], | ||
['twoheadmapsto', 'arrow.r.twohead.bar'], | ||
['twoheadrightarrow', 'arrow.r.twohead'], | ||
['rightwavearrow', 'arrow.r.wave'], | ||
['leftarrow', 'arrow.l'], | ||
['mapsfrom', 'arrow.l.bar'], | ||
['leftdowncurvedarrow', 'arrow.l.curve'], | ||
['leftdasharrow', 'arrow.l.dashed'], | ||
['leftdotarrow', 'arrow.l.dotted'], | ||
['Leftarrow', 'arrow.l.double'], | ||
['Mapsfrom', 'arrow.l.double.bar'], | ||
['Longleftarrow', 'arrow.l.double.long'], | ||
['Longmapsfrom', 'arrow.l.double.long.bar'], | ||
['nLeftarrow', 'arrow.l.double.not'], | ||
['hookleftarrow', 'arrow.l.hook'], | ||
['longleftarrow', 'arrow.l.long'], | ||
['longmapsfrom', 'arrow.l.long.bar'], | ||
['longleftsquigarrow', 'arrow.l.long.squiggly'], | ||
['looparrowleft', 'arrow.l.loop'], | ||
['nleftarrow', 'arrow.l.not'], | ||
['LLeftarrow', 'arrow.l.quad'], | ||
['leftsquigarrow', 'arrow.l.squiggly'], | ||
['barleftarrow', 'arrow.l.stop'], | ||
['leftwhitearrow', 'arrow.l.stroked'], | ||
['leftarrowtail', 'arrow.l.tail'], | ||
['similarleftarrow', 'arrow.l.tilde'], | ||
['Lleftarrow', 'arrow.l.triple'], | ||
['twoheadmapsfrom', 'arrow.l.twohead.bar'], | ||
['twoheadleftarrow', 'arrow.l.twohead'], | ||
['leftwavearrow', 'arrow.l.wave'], | ||
['uparrow', 'arrow.t'], | ||
['mapsup', 'arrow.t.bar'], | ||
['uprightcurvearrow', 'arrow.t.curve'], | ||
['updasharrow', 'arrow.t.dashed'], | ||
['Uparrow', 'arrow.t.double'], | ||
['UUparrow', 'arrow.t.quad'], | ||
['baruparrow', 'arrow.t.stop'], | ||
['upwhitearrow', 'arrow.t.stroked'], | ||
['Uuparrow', 'arrow.t.triple'], | ||
['twoheaduparrow', 'arrow.t.twohead'], | ||
['downarrow', 'arrow.b'], | ||
['mapsdown', 'arrow.b.bar'], | ||
['downrightcurvedarrow', 'arrow.b.curve'], | ||
['downdasharrow', 'arrow.b.dashed'], | ||
['Downarrow', 'arrow.b.double'], | ||
['DDownarrow', 'arrow.b.quad'], | ||
['downarrowbar', 'arrow.b.stop'], | ||
['downwhitearrow', 'arrow.b.stroked'], | ||
['Ddownarrow', 'arrow.b.triple'], | ||
['twoheaddownarrow', 'arrow.b.twohead'], | ||
['leftrightarrow', 'arrow.l.r'], | ||
['Leftrightarrow', 'arrow.l.r.double'], | ||
['Longleftrightarrow', 'arrow.l.r.double.long'], | ||
['nLeftrightarrow', 'arrow.l.r.double.not'], | ||
['longleftrightarrow', 'arrow.l.r.long'], | ||
['nleftrightarrow', 'arrow.l.r.not'], | ||
['leftrightsquigarrow', 'arrow.l.r.wave'], | ||
['updownarrow', 'arrow.t.b'], | ||
['Updownarrow', 'arrow.t.b.double'], | ||
['nearrow', 'arrow.tr'], | ||
['Nearrow', 'arrow.tr.double'], | ||
['hknearrow', 'arrow.tr.hook'], | ||
['searrow', 'arrow.br'], | ||
['Searrow', 'arrow.br.double'], | ||
['hksearrow', 'arrow.br.hook'], | ||
['nwarrow', 'arrow.tl'], | ||
['Nwarrow', 'arrow.tl.double'], | ||
['hknwarrow', 'arrow.tl.hook'], | ||
['swarrow', 'arrow.bl'], | ||
['Swarrow', 'arrow.bl.double'], | ||
['hkswarrow', 'arrow.bl.hook'], | ||
['nwsearrow', 'arrow.tl.br'], | ||
['neswarrow', 'arrow.tr.bl'], | ||
['acwopencirclearrow', 'arrow.ccw'], | ||
['curvearrowleft', 'arrow.ccw.half'], | ||
['cwopencirclearrow', 'arrow.cw'], | ||
['curvearrowright', 'arrow.cw.half'], | ||
['downzigzagarrow', 'arrow.zigzag'], | ||
['rightrightarrows', 'arrows.rr'], | ||
['leftleftarrows', 'arrows.ll'], | ||
['upuparrows', 'arrows.tt'], | ||
['downdownarrows', 'arrows.bb'], | ||
['leftrightarrows', 'arrows.lr'], | ||
['barleftarrowrightarrowbar', 'arrows.lr.stop'], | ||
['rightleftarrows', 'arrows.rl'], | ||
['updownarrows', 'arrows.tb'], | ||
['downuparrows', 'arrows.bt'], | ||
['rightthreearrows', 'arrows.rrr'], | ||
['leftthreearrows', 'arrows.lll'], | ||
['rightharpoonup', 'harpoon.rt'], | ||
['barrightharpoonup', 'harpoon.rt.bar'], | ||
['rightharpoonupbar', 'harpoon.rt.stop'], | ||
['rightharpoondown', 'harpoon.rb'], | ||
['barrightharpoondown', 'harpoon.rb.bar'], | ||
['rightharpoondownbar', 'harpoon.rb.stop'], | ||
['leftharpoonup', 'harpoon.lt'], | ||
['leftharpoonupbar', 'harpoon.lt.bar'], | ||
['barleftharpoonup', 'harpoon.lt.stop'], | ||
['leftharpoondown', 'harpoon.lb'], | ||
['leftharpoondownbar', 'harpoon.lb.bar'], | ||
['barleftharpoondown', 'harpoon.lb.stop'], | ||
['upharpoonleft', 'harpoon.tl'], | ||
['upharpoonleftbar', 'harpoon.tl.bar'], | ||
['barupharpoonleft', 'harpoon.tl.stop'], | ||
['upharpoonright', 'harpoon.tr'], | ||
['upharpoonrightbar', 'harpoon.tr.bar'], | ||
['barupharpoonright', 'harpoon.tr.stop'], | ||
['downharpoonleft', 'harpoon.bl'], | ||
['bardownharpoonleft', 'harpoon.bl.bar'], | ||
['downharpoonleftbar', 'harpoon.bl.stop'], | ||
['downharpoonright', 'harpoon.br'], | ||
['bardownharpoonright', 'harpoon.br.bar'], | ||
['downharpoonrightbar', 'harpoon.br.stop'], | ||
['leftrightharpoonupup', 'harpoon.lt.rt'], | ||
['leftrightharpoondowndown', 'harpoon.lb.rb'], | ||
['leftrightharpoondownup', 'harpoon.lb.rt'], | ||
['leftrightharpoonupdown', 'harpoon.lt.rb'], | ||
['updownharpoonleftleft', 'harpoon.tl.bl'], | ||
['updownharpoonrightright', 'harpoon.tr.br'], | ||
['updownharpoonleftright', 'harpoon.tl.br'], | ||
['updownharpoonrightleft', 'harpoon.tr.bl'], | ||
['rightharpoonsupdown', 'harpoons.rtrb'], | ||
['downharpoonsleftright', 'harpoons.blbr'], | ||
['downupharpoonsleftright', 'harpoons.bltr'], | ||
['leftrightharpoonsdown', 'harpoons.lbrb'], | ||
['leftharpoonsupdown', 'harpoons.ltlb'], | ||
['leftrightharpoons', 'harpoons.ltrb'], | ||
['leftrightharpoonsup', 'harpoons.ltrt'], | ||
['rightleftharpoonsdown', 'harpoons.rblb'], | ||
['rightleftharpoons', 'harpoons.rtlb'], | ||
['rightleftharpoonsup', 'harpoons.rtlt'], | ||
['updownharpoonsleftright', 'harpoons.tlbr'], | ||
['upharpoonsleftright', 'harpoons.tltr'], | ||
['vdash', 'tack.r'], | ||
['nvdash', 'tack.r.not'], | ||
['vlongdash', 'tack.r.long'], | ||
['assert', 'tack.r.short'], | ||
['vDash', 'tack.r.double'], | ||
['nvDash', 'tack.r.double.not'], | ||
['dashv', 'tack.l'], | ||
['longdashv', 'tack.l.long'], | ||
['shortlefttack', 'tack.l.short'], | ||
['Dashv', 'tack.l.double'], | ||
['bigbot', 'tack.t.big'], | ||
['Vbar', 'tack.t.double'], | ||
['shortuptack', 'tack.t.short'], | ||
['bigtop', 'tack.b.big'], | ||
['barV', 'tack.b.double'], | ||
['shortdowntack', 'tack.b.short'], | ||
['dashVdash', 'tack.l.r'], | ||
['mupalpha', 'alpha'], | ||
['mupbeta', 'beta'], | ||
['mupchi', 'chi'], | ||
['mupdelta', 'delta'], | ||
['mupvarepsilon', 'epsilon'], | ||
['mupepsilon', 'epsilon.alt'], | ||
['mupeta', 'eta'], | ||
['mupgamma', 'gamma'], | ||
['mupiota', 'iota'], | ||
['mupkappa', 'kappa'], | ||
['mupvarkappa', 'kappa.alt'], | ||
['muplambda', 'lambda'], | ||
['mupmu', 'mu'], | ||
['mupnu', 'nu'], | ||
['mho', 'ohm.inv'], | ||
['mupomega', 'omega'], | ||
['mupomicron', 'omicron'], | ||
['mupvarphi', 'phi'], | ||
['mupphi', 'phi.alt'], | ||
['muppi', 'pi'], | ||
['mupvarpi', 'pi.alt'], | ||
['muppsi', 'psi'], | ||
['muprho', 'rho'], | ||
['mupvarrho', 'rho.alt'], | ||
['mupsigma', 'sigma'], | ||
['mupvarsigma', 'sigma.alt'], | ||
['muptau', 'tau'], | ||
['muptheta', 'theta'], | ||
['mupvartheta', 'theta.alt'], | ||
['mupupsilon', 'upsilon'], | ||
['mupxi', 'xi'], | ||
['mupzeta', 'zeta'], | ||
['mupAlpha', 'Alpha'], | ||
['mupBeta', 'Beta'], | ||
['mupChi', 'Chi'], | ||
['mupDelta', 'Delta'], | ||
['mupEpsilon', 'Epsilon'], | ||
['mupEta', 'Eta'], | ||
['mupGamma', 'Gamma'], | ||
['mupIota', 'Iota'], | ||
['mupKappa', 'Kappa'], | ||
['mupLambda', 'Lambda'], | ||
['mupMu', 'Mu'], | ||
['mupNu', 'Nu'], | ||
['mupOmega', 'Omega'], | ||
['mupOmicron', 'Omicron'], | ||
['mupPhi', 'Phi'], | ||
['mupPi', 'Pi'], | ||
['mupPsi', 'Psi'], | ||
['mupRho', 'Rho'], | ||
['mupSigma', 'Sigma'], | ||
['mupTau', 'Tau'], | ||
['mupTheta', 'Theta'], | ||
['mupUpsilon', 'Upsilon'], | ||
['mupXi', 'Xi'], | ||
['mupZeta', 'Zeta'], | ||
['BbbA', 'AA'], | ||
['BbbB', 'BB'], | ||
['BbbC', 'CC'], | ||
['BbbD', 'DD'], | ||
['BbbE', 'EE'], | ||
['BbbF', 'FF'], | ||
['BbbG', 'GG'], | ||
['BbbH', 'HH'], | ||
['BbbI', 'II'], | ||
['BbbJ', 'JJ'], | ||
['BbbK', 'KK'], | ||
['BbbL', 'LL'], | ||
['BbbM', 'MM'], | ||
['BbbN', 'NN'], | ||
['BbbO', 'OO'], | ||
['BbbP', 'PP'], | ||
['BbbQ', 'QQ'], | ||
['BbbR', 'RR'], | ||
['BbbS', 'SS'], | ||
['BbbT', 'TT'], | ||
['BbbU', 'UU'], | ||
['BbbV', 'VV'], | ||
['BbbW', 'WW'], | ||
['BbbX', 'XX'], | ||
['BbbY', 'YY'], | ||
['BbbZ', 'ZZ'], | ||
['ell', 'ell'], | ||
['Planckconst', 'planck'], | ||
['hslash', 'planck.reduce'], | ||
['Angstrom', 'angstrom'], | ||
['Re', 'Re'], | ||
['Im', 'Im'], | ||
['imath', 'dotless.i'], | ||
['jmath', 'dotless.j'], | ||
]); | ||
for(const [key, value] of map_from_official_docs) { | ||
if(!symbolMap.has(key)) { | ||
symbolMap.set(key, value); | ||
} | ||
} | ||
export {symbolMap}; |
@@ -270,4 +270,4 @@ import { symbolMap } from "./map"; | ||
const smartFloorPass = function (input: string): string { | ||
// Use regex to replace all "⌊ xxx ⌋" with "floor(xxx)" | ||
let res = input.replace(/⌊\s*(.*?)\s*⌋/g, "floor($1)"); | ||
// Use regex to replace all "floor.l xxx floor.r" with "floor(xxx)" | ||
let res = input.replace(/floor\.l\s*(.*?)\s*floor\.r/g, "floor($1)"); | ||
// Typst disallow "floor()" with empty argument, so add am empty string inside if it's empty. | ||
@@ -278,4 +278,4 @@ res = res.replace(/floor\(\)/g, 'floor("")'); | ||
const smartCeilPass = function (input: string): string { | ||
// Use regex to replace all "⌈ xxx ⌉" with "ceil(xxx)" | ||
let res = input.replace(/⌈\s*(.*?)\s*⌉/g, "ceil($1)"); | ||
// Use regex to replace all "ceil.l xxx ceil.r" with "ceil(xxx)" | ||
let res = input.replace(/ceil\.l\s*(.*?)\s*ceil\.r/g, "ceil($1)"); | ||
// Typst disallow "ceil()" with empty argument, so add an empty string inside if it's empty. | ||
@@ -286,4 +286,4 @@ res = res.replace(/ceil\(\)/g, 'ceil("")'); | ||
const smartRoundPass = function (input: string): string { | ||
// Use regex to replace all "⌊ xxx ⌉" with "round(xxx)" | ||
let res = input.replace(/⌊\s*(.*?)\s*⌉/g, "round($1)"); | ||
// Use regex to replace all "floor.l xxx ceil.r" with "round(xxx)" | ||
let res = input.replace(/floor\.l\s*(.*?)\s*ceil\.r/g, "round($1)"); | ||
// Typst disallow "round()" with empty argument, so add an empty string inside if it's empty. | ||
@@ -290,0 +290,0 @@ res = res.replace(/round\(\)/g, 'round("")'); |
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
244696
18
4740
0