Skip to content

Commit 368d40b

Browse files
committed
feat: fix units and other chars in rendered math
Useless encoding broke stuff. No more. Includes an update to local libraries.
1 parent 9da8dbc commit 368d40b

File tree

3 files changed

+60040
-42731
lines changed

3 files changed

+60040
-42731
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
!function() {
2+
"use strict";
3+
var t, e, a, n = {
4+
667: function(t, e) {
5+
e.q = void 0,
6+
e.q = "3.2.2"
7+
},
8+
376: function(t, e, a) {
9+
var n = this && this.__importDefault || function(t) {
10+
return t && t.__esModule ? t : {
11+
default: t
12+
}
13+
}
14+
;
15+
Object.defineProperty(e, "__esModule", {
16+
value: !0
17+
}),
18+
e.UnicodeConfiguration = e.UnicodeMethods = void 0;
19+
var o = a(251)
20+
, i = n(a(402))
21+
, r = a(871)
22+
, u = n(a(398))
23+
, l = n(a(748))
24+
, c = a(992);
25+
e.UnicodeMethods = {};
26+
var p = {};
27+
e.UnicodeMethods.Unicode = function(t, e) {
28+
var a = t.GetBrackets(e)
29+
, n = null
30+
, o = null;
31+
a && (a.replace(/ /g, "").match(/^(\d+(\.\d*)?|\.\d+),(\d+(\.\d*)?|\.\d+)$/) ? (n = a.replace(/ /g, "").split(/,/),
32+
o = t.GetBrackets(e)) : o = a);
33+
var r = u.default.trimSpaces(t.GetArgument(e)).replace(/^0x/, "x");
34+
if (!r.match(/^(x[0-9A-Fa-f]+|[0-9]+)$/))
35+
throw new i.default("BadUnicode","Argument to \\unicode must be a number");
36+
var d = parseInt(r.match(/^x/) ? "0" + r : r);
37+
p[d] ? o || (o = p[d][2]) : p[d] = [800, 200, o, d],
38+
n && (p[d][0] = Math.floor(1e3 * parseFloat(n[0])),
39+
p[d][1] = Math.floor(1e3 * parseFloat(n[1])));
40+
var M = t.stack.env.font
41+
, s = {};
42+
o ? (p[d][2] = s.fontfamily = o.replace(/'/g, "'"),
43+
M && (M.match(/bold/) && (s.fontweight = "bold"),
44+
M.match(/italic|-mathit/) && (s.fontstyle = "italic"))) : M && (s.mathvariant = M);
45+
var x = t.create("token", "mtext", s, (0,
46+
c.numeric)(r));
47+
l.default.setProperty(x, "unicode", !0),
48+
t.Push(x)
49+
}
50+
,
51+
new r.CommandMap("unicode",{
52+
unicode: "Unicode"
53+
},e.UnicodeMethods),
54+
e.UnicodeConfiguration = o.Configuration.create("unicode", {
55+
handler: {
56+
macro: ["unicode"]
57+
}
58+
})
59+
},
60+
955: function(t, e) {
61+
MathJax._.components.global.isObject,
62+
MathJax._.components.global.combineConfig,
63+
MathJax._.components.global.combineDefaults,
64+
e.r8 = MathJax._.components.global.combineWithMathJax,
65+
MathJax._.components.global.MathJax
66+
},
67+
992: function(t, e) {
68+
Object.defineProperty(e, "__esModule", {
69+
value: !0
70+
}),
71+
e.options = MathJax._.util.Entities.options,
72+
e.entities = MathJax._.util.Entities.entities,
73+
e.add = MathJax._.util.Entities.add,
74+
e.remove = MathJax._.util.Entities.remove,
75+
e.translate = MathJax._.util.Entities.translate,
76+
e.numeric = MathJax._.util.Entities.numeric
77+
},
78+
251: function(t, e) {
79+
Object.defineProperty(e, "__esModule", {
80+
value: !0
81+
}),
82+
e.Configuration = MathJax._.input.tex.Configuration.Configuration,
83+
e.ConfigurationHandler = MathJax._.input.tex.Configuration.ConfigurationHandler,
84+
e.ParserConfiguration = MathJax._.input.tex.Configuration.ParserConfiguration
85+
},
86+
748: function(t, e) {
87+
Object.defineProperty(e, "__esModule", {
88+
value: !0
89+
}),
90+
e.default = MathJax._.input.tex.NodeUtil.default
91+
},
92+
398: function(t, e) {
93+
Object.defineProperty(e, "__esModule", {
94+
value: !0
95+
}),
96+
e.default = MathJax._.input.tex.ParseUtil.default
97+
},
98+
871: function(t, e) {
99+
Object.defineProperty(e, "__esModule", {
100+
value: !0
101+
}),
102+
e.parseResult = MathJax._.input.tex.SymbolMap.parseResult,
103+
e.AbstractSymbolMap = MathJax._.input.tex.SymbolMap.AbstractSymbolMap,
104+
e.RegExpMap = MathJax._.input.tex.SymbolMap.RegExpMap,
105+
e.AbstractParseMap = MathJax._.input.tex.SymbolMap.AbstractParseMap,
106+
e.CharacterMap = MathJax._.input.tex.SymbolMap.CharacterMap,
107+
e.DelimiterMap = MathJax._.input.tex.SymbolMap.DelimiterMap,
108+
e.MacroMap = MathJax._.input.tex.SymbolMap.MacroMap,
109+
e.CommandMap = MathJax._.input.tex.SymbolMap.CommandMap,
110+
e.EnvironmentMap = MathJax._.input.tex.SymbolMap.EnvironmentMap
111+
},
112+
402: function(t, e) {
113+
Object.defineProperty(e, "__esModule", {
114+
value: !0
115+
}),
116+
e.default = MathJax._.input.tex.TexError.default
117+
}
118+
}, o = {};
119+
function i(t) {
120+
var e = o[t];
121+
if (void 0 !== e)
122+
return e.exports;
123+
var a = o[t] = {
124+
exports: {}
125+
};
126+
return n[t].call(a.exports, a, a.exports, i),
127+
a.exports
128+
}
129+
t = i(955),
130+
e = i(667),
131+
a = i(376),
132+
MathJax.loader && MathJax.loader.checkVersion("[tex]/unicode", e.q, "tex-extension"),
133+
(0,
134+
t.r8)({
135+
_: {
136+
input: {
137+
tex: {
138+
unicode: {
139+
UnicodeConfiguration: a
140+
}
141+
}
142+
}
143+
}
144+
})
145+
}();

0 commit comments

Comments
 (0)