vuepress / vuepress-plugin-mathjax

:page_with_curl: Use TeX in VuePress.
https://vuepress.github.io/plugins/mathjax.html
MIT License
32 stars 10 forks source link

warning An error was encountered in plugin "vuepress-plugin-mathjax" #28

Open mathieunicolas opened 4 years ago

mathieunicolas commented 4 years ago

Hello !

I don't understand why, but I simply added the plugin in the dependancies, added the plugin in the config.js file, and when running vuepress dev or build I got this message :

warning An error was encountered in plugin "vuepress-plugin-mathjax"

I don't know why, nor what I can do, it's the last vuepress version and I run it on a fresh install... clueless I am ! Thanks for helping, because I'm stuck with this one !

davidjpramsay commented 4 years ago

Can someone confirm if this plugin is still working? I am having the same issue as the OP.

apcamargo commented 4 years ago

I'm having the same issue. I'm now using @maginapp/vuepress-plugin-katex.

jlin-vt commented 4 years ago

I have same issue.

cespon commented 4 years ago

Same error here.

foxdie987 commented 2 years ago

I'm having the same issue. I'm now using @maginapp/vuepress-plugin-katex.

I can't make this plugin work and got the same error like mathieunicolas, so I'm using vuepress-plugin-katex too and now the maths are showing properly. As seen here However, KaTeX can't be fully replace mathjax (LaTeX) though, because I've encountered some problem with syntax and extra redundant { } brackets from convert MathType -> LaTeX, and that will stop your (vuepress build) with some red errors, until you clean the formula of extra { } brackets.

There is no option to convert directly MathType to KaTeX, as far as I know. If anyone is an expert of this, please let me know.

daviddekoning commented 2 years ago

Hi all, I wanted to share another method to get MathJax working in Vuepress. After spending an evening struggling to update this plugin to MathJax 3.2 (the current latest version), I found out that you can tell VuePress to use markdown-it extensions:

  1. npm install -D markdown-it-mathjax3
  2. add the following to your config.js
    extendMarkdown: md => {
      md.use(require('markdown-it-mathjax3'), { tex: {tags: 'ams'}})
    }
  }

This fixed a number of bugs I found, including:

  1. single character in-line equations showing up as display
  2. aligned sets of equations not working
  3. matrices not working

VitePress also uses markdown-it, so I suspect this method will work there as well (but I haven't checked)