isaul32 / ckeditor5-math

Math feature for CKEditor 5.
https://www.npmjs.com/package/ckeditor5-math
ISC License
86 stars 39 forks source link

Installing MathJax Engine #51

Closed mohamed-sallam closed 3 years ago

mohamed-sallam commented 3 years ago

I had this warning in my console log math-tex-typesetting-missing: Missing the mathematical typesetting engine (mathjax) for tex., so it's obvious that it tells me to install MathJax, so I tried to install MathJax and KaTeX, but none of them worked.

The method, that I follow to install ckeditor5-math and MathJax, was:- 1) In ckEditor5 folder, I run npm install ckeditor5-math --save-dev, then npm install mathjax. 2) Add import into ckeditor.js file import Mathematics from 'ckeditor5-math/src/math'; 3) Add it to built-in plugins

InlineEditor.builtinPlugins = [
    // ...
    Mathematics
];

4) In ckEditor5 folder, I run npm run-script build.

It worked fine with ckeditor5-math but display mode didn't work, in other words, MathJax didn't work and give me the above-mentioned log, so what is the right way to install MathJax or KaTaX, and how can I solve this problem?

error

P.S: The ckeditor5 was integrated with Angular12 App.

mohamed-sallam commented 3 years ago

I solved this problem using the installation guide in the link below:- mathjax-angular

Kartik4152 commented 11 months ago

For people who come across this, this is what I used in the config.

lazyLoad: async () => {
        return new Promise((resolve, reject) => {
          const script = document.createElement('script');

          script.async = true;
          script.onload = resolve;
          script.onerror = reject;
          script.crossOrigin="anonymous";
          script.integrity="sha384-Wuix6BuhrWbjDBs24bXrjf4ZQ5aFeFWBuKkFekO2t8xFU0iNaLQfp2K6/1Nxveei";

          script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js';

          document.head.appendChild(script);
        })
      }