如何从 typescript 方法返回 Mathjax 渲染的结果(同步)?

编程入门 行业动态 更新时间:2024-10-03 19:14:51

如何从 typescript <a href=https://www.elefans.com/category/jswz/34/1771314.html style=方法返回 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 渲染的结果(同步)?

本文发布于:2024-05-30 20:49:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1770907.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:方法   typescript   Mathjax

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!