Comparing version 0.0.11 to 0.0.12
@@ -6,3 +6,2 @@ "use strict"; | ||
['gets', 'arrow.l'], | ||
['infty', 'infinity'], // infinity | ||
['nonumber', ''], | ||
@@ -48,32 +47,2 @@ ['vec', 'arrow'], | ||
['boxtimes', 'times.square'], | ||
/* symbols in mathematical logic */ | ||
['neg', 'not'], | ||
['land', 'and'], | ||
['lor', 'or'], | ||
['varnothing', 'diameter'], // empty set | ||
/* symbols about comparing numbers */ | ||
// tex: \neq \leq \geq \ll \gg \prec \succ \preceq \succeq | ||
// typst: eq.not lt.eq gt.eq lt.double gt.double prec succ prec.eq succ.eq | ||
['neq', 'eq.not'], | ||
['leq', 'lt.eq'], | ||
['geq', 'gt.eq'], | ||
['ll', 'lt.double'], | ||
['gg', 'gt.double'], | ||
['prec', 'prec'], | ||
['succ', 'succ'], | ||
['preceq', 'prec.eq'], | ||
['succeq', 'succ.eq'], | ||
/* symbols about differential */ | ||
['Delta', 'Delta'], | ||
['nabla', 'nabla'], | ||
['partial', 'diff'], | ||
/* symbols about integral */ | ||
// tex: \int \oint \iint \oiint \iiint \oiiint | ||
// typst: integral integral.cont integral.double integral.surf integral.triple integral.vol | ||
['int', 'integral'], | ||
['oint', 'integral.cont'], | ||
['iint', 'integral.double'], | ||
['oiint', 'integral.surf'], | ||
['iiint', 'integral.triple'], | ||
['oiiint', 'integral.vol'], | ||
/* wave */ | ||
@@ -99,3 +68,2 @@ // tex: \sim \approx \cong \simeq \asymp \equiv \propto | ||
['rightrightarrows', 'arrows.rr'], | ||
['binom', 'binom'], | ||
/* left and right floor,ceil */ | ||
@@ -187,2 +155,3 @@ // tex: \lfloor \rfloor \lceil \rceil | ||
['in', 'in'], | ||
['infty', 'infinity'], | ||
['int', 'integral'], | ||
@@ -194,2 +163,3 @@ ['intercal', 'top'], // 'top' or 'tack.b' | ||
['lambda', 'lambda'], | ||
['land', 'and'], | ||
['langle', 'angle.l'], | ||
@@ -210,2 +180,3 @@ ['lbrace', 'brace.l'], | ||
['longrightarrow', 'arrow.long'], | ||
['lor', 'or'], | ||
['ltimes', 'times.l'], | ||
@@ -224,10 +195,21 @@ ['mapsto', 'arrow.bar'], | ||
['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'], | ||
['nleftarrow', 'arrow.l.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'], | ||
@@ -244,2 +226,3 @@ // ['omicron', 'omicron'], | ||
['pm', 'plus.minus'], | ||
['pounds', 'pound'], | ||
['prec', 'prec'], | ||
@@ -263,5 +246,10 @@ ['preceq', 'prec.eq'], | ||
['simeq', 'tilde.eq'], | ||
['slash', 'slash'], | ||
['smallsetminus', 'without'], | ||
// ['smile', 'paren.b'], | ||
['spadesuit', 'suit.spade'], | ||
['sqcap', 'sect.sq'], | ||
['sqcup', 'union.sq'], | ||
['sqsubseteq', 'subset.eq.sq'], | ||
['sqsupseteq', 'supset.eq.sq'], | ||
['star', 'star'], | ||
@@ -277,2 +265,3 @@ ['subset', 'subset'], | ||
['supsetneq', 'supset.neq'], | ||
['swarrow', 'arrow.bl'], | ||
['tau', 'tau'], | ||
@@ -282,5 +271,8 @@ ['theta', 'theta'], | ||
['to', 'arrow.r'], | ||
['top', 'top'], | ||
['triangle', 'triangle.t'], | ||
['triangledown', 'triangle.b.small'], | ||
['triangleleft', 'triangle.l.small'], | ||
['triangleright', 'triangle.small'], | ||
['triangleright', 'triangle.r.small'], | ||
['twoheadrightarrow', 'arrow.r.twohead'], | ||
['uparrow', 'arrow.t'], | ||
@@ -292,2 +284,3 @@ ['updownarrow', 'arrow.t.b'], | ||
['varepsilon', 'epsilon'], | ||
['varnothing', 'diameter'], // empty set | ||
['varphi', 'phi'], | ||
@@ -304,3 +297,8 @@ ['varpi', 'pi.alt'], | ||
['xi', 'xi'], | ||
['yen', 'yen'], | ||
['zeta', 'zeta'], | ||
// extended | ||
['mathscr', 'scr'], | ||
['LaTeX', '#LaTeX'], | ||
['TeX', '#TeX'], | ||
]); |
@@ -249,3 +249,3 @@ "use strict"; | ||
// KaTeX parse these commands so complicatedly that we need some hacks to keep things simple. | ||
'\\mod': '\\operatorname{SyMb01-mod}', '\\liminf': '\\operatorname{SyMb01-liminf}', '\\limsup': '\\operatorname{SyMb01-limsup}', '\\qquad': '\\operatorname{SyMb01-qquad}', '\\quad': '\\operatorname{SyMb01-quad}', '\\cdots': '\\operatorname{SyMb01-cdots}', '\\colon': '\\operatorname{SyMb01-colon}', '\\imath': '\\operatorname{SyMb01-imath}', '\\\iiiint': '\\operatorname{SyMb01-iiiint}', '\\jmath': '\\operatorname{SyMb01-jmath}', '\\vdots': '\\operatorname{SyMb01-vdots}', '\\notin': '\\operatorname{SyMb01-notin}' }, customTexMacros); | ||
'\\mod': '\\operatorname{SyMb01-mod}', '\\liminf': '\\operatorname{SyMb01-liminf}', '\\limsup': '\\operatorname{SyMb01-limsup}', '\\qquad': '\\operatorname{SyMb01-qquad}', '\\quad': '\\operatorname{SyMb01-quad}', '\\cdots': '\\operatorname{SyMb01-cdots}', '\\colon': '\\operatorname{SyMb01-colon}', '\\imath': '\\operatorname{SyMb01-imath}', '\\\iiiint': '\\operatorname{SyMb01-iiiint}', '\\jmath': '\\operatorname{SyMb01-jmath}', '\\vdots': '\\operatorname{SyMb01-vdots}', '\\notin': '\\operatorname{SyMb01-notin}', '\\slash': '\\operatorname{SyMb01-slash}', '\\LaTeX': '\\operatorname{SyMb01-LaTeX}', '\\TeX': '\\operatorname{SyMb01-TeX}' }, customTexMacros); | ||
const options = { | ||
@@ -252,0 +252,0 @@ macros: macros, |
@@ -324,2 +324,5 @@ "use strict"; | ||
} | ||
else if (['\\$', '\\#', '\\&', '\\_'].includes(token)) { | ||
return token; | ||
} | ||
else if (token.startsWith('\\')) { | ||
@@ -326,0 +329,0 @@ const symbol = token.slice(1); |
{ | ||
"name": "tex2typst", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "JavaScript library for converting TeX code to Typst", | ||
"type": "module", | ||
"main": "dist/index.js", | ||
@@ -6,0 +7,0 @@ "types": "dist/index.d.ts", |
export const symbolMap = new Map<string, string>([ | ||
['gets', 'arrow.l'], | ||
['infty', 'infinity'], // infinity | ||
['nonumber', ''], | ||
@@ -49,37 +48,3 @@ ['vec', 'arrow'], | ||
/* symbols in mathematical logic */ | ||
['neg', 'not'], | ||
['land', 'and'], | ||
['lor', 'or'], | ||
['varnothing', 'diameter'], // empty set | ||
/* symbols about comparing numbers */ | ||
// tex: \neq \leq \geq \ll \gg \prec \succ \preceq \succeq | ||
// typst: eq.not lt.eq gt.eq lt.double gt.double prec succ prec.eq succ.eq | ||
['neq', 'eq.not'], | ||
['leq', 'lt.eq'], | ||
['geq', 'gt.eq'], | ||
['ll', 'lt.double'], | ||
['gg', 'gt.double'], | ||
['prec', 'prec'], | ||
['succ', 'succ'], | ||
['preceq', 'prec.eq'], | ||
['succeq', 'succ.eq'], | ||
/* symbols about differential */ | ||
['Delta', 'Delta'], | ||
['nabla', 'nabla'], | ||
['partial', 'diff'], | ||
/* symbols about integral */ | ||
// tex: \int \oint \iint \oiint \iiint \oiiint | ||
// typst: integral integral.cont integral.double integral.surf integral.triple integral.vol | ||
['int', 'integral'], | ||
['oint', 'integral.cont'], | ||
['iint', 'integral.double'], | ||
['oiint', 'integral.surf'], | ||
['iiint', 'integral.triple'], | ||
['oiiint', 'integral.vol'], | ||
/* wave */ | ||
@@ -107,3 +72,2 @@ // tex: \sim \approx \cong \simeq \asymp \equiv \propto | ||
['binom', 'binom'], | ||
@@ -198,2 +162,3 @@ /* left and right floor,ceil */ | ||
['in', 'in'], | ||
['infty', 'infinity'], | ||
['int', 'integral'], | ||
@@ -205,2 +170,3 @@ ['intercal', 'top'], // 'top' or 'tack.b' | ||
['lambda', 'lambda'], | ||
['land', 'and'], | ||
['langle', 'angle.l'], | ||
@@ -221,2 +187,3 @@ ['lbrace', 'brace.l'], | ||
['longrightarrow', 'arrow.long'], | ||
['lor', 'or'], | ||
['ltimes', 'times.l'], | ||
@@ -235,10 +202,21 @@ ['mapsto', 'arrow.bar'], | ||
['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'], | ||
['nleftarrow', 'arrow.l.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'], | ||
@@ -255,2 +233,3 @@ // ['omicron', 'omicron'], | ||
['pm', 'plus.minus'], | ||
['pounds', 'pound'], | ||
['prec', 'prec'], | ||
@@ -274,5 +253,10 @@ ['preceq', 'prec.eq'], | ||
['simeq', 'tilde.eq'], | ||
['slash', 'slash'], | ||
['smallsetminus', 'without'], | ||
// ['smile', 'paren.b'], | ||
['spadesuit', 'suit.spade'], | ||
['sqcap', 'sect.sq'], | ||
['sqcup', 'union.sq'], | ||
['sqsubseteq', 'subset.eq.sq'], | ||
['sqsupseteq', 'supset.eq.sq'], | ||
['star', 'star'], | ||
@@ -288,2 +272,3 @@ ['subset', 'subset'], | ||
['supsetneq', 'supset.neq'], | ||
['swarrow', 'arrow.bl'], | ||
['tau', 'tau'], | ||
@@ -293,5 +278,8 @@ ['theta', 'theta'], | ||
['to', 'arrow.r'], | ||
['top', 'top'], | ||
['triangle', 'triangle.t'], | ||
['triangledown', 'triangle.b.small'], | ||
['triangleleft', 'triangle.l.small'], | ||
['triangleright', 'triangle.small'], | ||
['triangleright', 'triangle.r.small'], | ||
['twoheadrightarrow', 'arrow.r.twohead'], | ||
['uparrow', 'arrow.t'], | ||
@@ -303,2 +291,3 @@ ['updownarrow', 'arrow.t.b'], | ||
['varepsilon', 'epsilon'], | ||
['varnothing', 'diameter'], // empty set | ||
['varphi', 'phi'], | ||
@@ -315,3 +304,9 @@ ['varpi', 'pi.alt'], | ||
['xi', 'xi'], | ||
['yen', 'yen'], | ||
['zeta', 'zeta'], | ||
// extended | ||
['mathscr', 'scr'], | ||
['LaTeX', '#LaTeX'], | ||
['TeX', '#TeX'], | ||
]); |
@@ -256,2 +256,5 @@ // @ts-ignore | ||
'\\notin': '\\operatorname{SyMb01-notin}', | ||
'\\slash': '\\operatorname{SyMb01-slash}', | ||
'\\LaTeX': '\\operatorname{SyMb01-LaTeX}', | ||
'\\TeX': '\\operatorname{SyMb01-TeX}', | ||
...customTexMacros | ||
@@ -258,0 +261,0 @@ }; |
@@ -325,2 +325,4 @@ import { symbolMap } from "./map"; | ||
return '\\\n'; | ||
} else if (['\\$', '\\#', '\\&', '\\_'].includes(token)) { | ||
return token; | ||
} else if (token.startsWith('\\')) { | ||
@@ -327,0 +329,0 @@ const symbol = token.slice(1); |
Unpublished package
Supply chain riskPackage version was not found on the registry. It may exist on a different registry and need to be configured to pull from that registry.
Found 1 instance in 1 package
Unpopular package
QualityThis package is not very popular.
Found 1 instance in 1 package
87129
20
2022
0
Yes
1