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

posted on 2020-05-12 15:22  studyphp  阅读(3335)  评论(1编辑  收藏  举报

导航