Angular 4.0 npm为node_module安装mathjax,在tsconfig.app.json中添加"scripts": ["./node_modules/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"], to angular-cli.json and add类型“:"mathjax",`
但是错误提示“找不到MathZoom.js和MathMenu.js”。如何处理这个问题......谢谢!
发布于 2017-11-15 19:51:12
要将MathJax添加到Angular 4应用程序中,只需在index.html中添加以下代码行,然后执行以下步骤。
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_HTMLorMML"></script>
<!-- MathJax Implementation -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
showProcessingMessages: false,
tex2jax: { inlineMath: [['$','$'],['\\(','\\)']] }
});
</script>要在其中呈现公式的HTML代码
<div class="mathjax" >{{Formula}}</div>想要应用mathjax的TS文件
let mathjax=document.getElementsByClassName('mathjax');
eval('MathJax.Hub.Queue(["Typeset",MathJax.Hub, mathjax])');
eval('MathJax.Hub.Queue(["Typeset",MathJax.Hub, mathjax])');https://stackoverflow.com/questions/47306527
复制相似问题