方法返回 Mathjax 渲染的结果(同步)?"/>
如何从 typescript 方法返回 Mathjax 渲染的结果(同步)?
在全球范围内,我想将带有 asciimath 公式的 HTML 文件转换为文件内部包含 SVG 而不是 asciimath 的其他 HTML 文件。
为此,我尝试在打字稿(运行思想节点)上编写命令行应用程序。
为了将 asciimath 公式转换为 SVG,我想创建一个具有转换方法的类(使用 Mathjax 库):
class AsciimathFormula {
private readonly asciimath: string;
constructor(asciimath: string) {
this.asciimath = asciimath;
}
get svg(): string {
// return svg representation of this.asciimath using mathjax
}
}
Mathjax的文档有回调的例子,但是我想同步得到结果
如何编写 svg 方法的主体?
回答如下:更多推荐
如何从 typescript 方法返回 Mathjax 渲染的结果(同步)?
发布评论