ฉันกำลังพยายามใช้ mathjax-node ใน javascript
อย่างที่คุณเห็นในภาพ ฉันต้องการทำให้ข้อความอยู่ตรงกลางโดยไม่เหลือ
มีการกำหนดค่าใด ๆ บน mathjax-node หรือไม่?
ฉันลองจัดแนวข้อความและแสดงจัดตำแหน่งให้อยู่กึ่งกลาง แต่ก็ไม่ได้ผล
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 และ config