【发布时间】:2021-04-12 22:24:24
【问题描述】:
我正在尝试在 javascript 中使用 mathjax-node。
正如你在图片中看到的,我想让 tex 居中而不是左边。
mathjax-node 上有配置吗?
我尝试了 text-align 和 displayAlign to center,但没有成功。
function convert(tex, options, callback) {
mathjax.typeset({
width: options.width,
ex: 10,
math: tex,
format: "TeX",
// style: "text-align: center;",
svg: true, // SVG output
linebreaks: true,
}, function (data) {
if (data.errors) return callback(data.errors);
callback(undefined, data.svg);
});
}
const mathjax = require('mathjax-node');
mathjax.config({
TeX: {
extensions: ["color.js"]
},
MathJax: {
displayAlign: "center",
// 'text-align': "center"
extensions: ["TeX/color.js"],
'fast-preview':{disabled:false}
},
});
mathjax.start();
这是 mathjax.typeset 和配置的代码
【问题讨论】:
-
你希望 TeX 是内联的还是阻塞的?
-
嗯,有区别吗?
-
这是乳胶到 svg 的步骤
标签: javascript mathjax