awehook 最近的时间轴更新
awehook

awehook

V2EX 第 532332 号会员,加入于 2021-02-06 16:17:29 +08:00
awehook 最近回复了
问题已经解决了,不是通过改字体等手段解决的,katex 导出的更号丢失,可以通过
const svgElements = exportDiv.querySelectorAll('svg');
svgElements.forEach(function(item) {
item.setAttribute('width', item.getBoundingClientRect().width);
item.setAttribute('height', item.getBoundingClientRect().height);
item.style.width = null;
item.style.height = null;
}); 这段代码来解决,但是矩阵的大括号导出时依然会位置错乱。

后来换了个库 mathjax3, 通过 mathjax3 把公式渲染成图片,通过 html2canvas 将带公式的 markdown 导出为图片,解决了上面的问题
@zeromake 问题已经解决了,初次发帖,没有经验
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3251 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 11:43 · PVG 19:43 · LAX 04:43 · JFK 07:43
Developed with CodeLauncher
♥ Do have faith in what you're doing.