tinymce增加mathjax 支持数学公式录入渲染


tinymce 安装的方法在前文中有说明:

https://www.cnblogs.com/already/p/12012752.html

 

项目中已经安装tinymce

1、先下载 tinymce-mathjax包

https://github.com/dimakorotkov/tinymce-mathjax/archive/master.zip

2、复制tinymce-mathjax包中的min.js 和config 到你的项目中,两个文件要同级

3、下载tex-mml-chtml.js 文件到你的项目中

https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js

4、下载tex-mml-chtml需要的字体

5、配置tinymce

tinymce.init({
  ...
  external_plugins: {'mathjax': '/your-path-to-plugin/@dimakorotkov/tinymce-mathjax/plugin.min.js'},
  toolbar: 'mathjax',
  mathjax: {
    lib: '/path-to-mathjax/es5/tex-mml-chtml.js', //required path to mathjax
    //symbols: {start: '\\(', end: '\\)'}, //optional: mathjax symbols
    //className: "math-tex", //optional: mathjax element class
    //configUrl: '/your-path-to-plugin/@dimakorotkov/tinymce-mathjax/config.js' //optional: mathjax config js
  }
});

项目中就有啦

 

 

 

自己录入吧,公式网上搜吧

 

 

 

mathjax 官网:

https://www.mathjax.org/ 

mathjax github:

https://github.com/mathjax/MathJax-src


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM