使用MathQuill时,需要键入\nsub以获得⊈符号。你得到的乳胶是\not\subset,这很好。
但是,当您尝试将相同的\not\subset表达式设置为MathQuill字段时,您将得到一个不同的结果:\neg\subset,这将转换为不同的呈现。
这个问题可以使用浏览器控制台直接在MathQuill页面(http://mathquill.com/)上再现:

对如何处理或解决这个问题有什么想法吗?
发布于 2022-10-20 02:37:23
MathQuill将在输入时接受\nsub,但也会接受\notsubset,这使我找到了一个简单的查找和替换解决方案,它不需要任何其他代码更改。
不是最好的,但它有效;唯一的缺点是文本替换列表是固定的;set运算符是我找到的;可能更多。
// special math pre-processing
var mathFix = {
"\\not\\subset" : "\\notsubset",
"\\not\\supset" : "\\notsupset"
}
var mathTextFixed = '<your latex here>';
Object.keys(mathFix).forEach(function(t1) {
mathTextFixed = mathTextFixed.replace(t1, mathFix[t1]);
});
mathField.latex(mathTextFixed);https://stackoverflow.com/questions/73844376
复制相似问题