gpt4 book ai didi

ionic-framework - 如何将 MathJax 与 Ionic2 集成

转载 作者:行者123 更新时间:2023-12-02 04:37:13 25 4
gpt4 key购买 nike

我在将 MathJax 集成到 Ionic2 中时遇到模板解析错误,请帮助我,

包.json

 "dependencies": {
.....
"mathjax": "^2.7.0"
},

首页.ts

import mj from "mathjax";

主页.html

<ion-card-title> Name </ion-card-title>
<span> When $a \ne 0$, there are two solutions to \(ax^2 + bx + c = 0\) and they are
$$x = {-b \pm \sqrtb^2-4ac \over 2a.}$$</span>
<button (click)= render()> Render Katex</button>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: 'inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async src="../../../node_modules/mathjax/MathJax.js?config=TeX-MML-AM_CHTML"></script>

最佳答案

https://www.npmjs.com/package/@types/mathjax

您需要安装 typescript 声明。尝试

npm install @types/mathjax --save

查看 this question

关于ionic-framework - 如何将 MathJax 与 Ionic2 集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41159763/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com