Physics extension not working
Hi, I use MathJax to render equations in my markdown documents. I use the VSCode Markdown Preview Enhanced extension and have all the settings necessary to process equations using MathJax.
I would like to use the physics.js extension but I cannot make it work. I also tried with the cancel.js extension and it works perfectly.
Note that I am not an expert of MathJax so I apologise if my question is trivial.
Here is my mathjax_config.js file Markdown Preview Enhanced is referring to:
module.exports = { extensions: ['tex2jax.js'], jax: ['input/TeX','output/HTML-CSS'], messageStyle: 'none', tex2jax: { processEnvironments: false, processEscapes: true }, TeX: { extensions: ['AMSmath.js', 'AMSsymbols.js', 'noErrors.js', 'noUndefined.js', 'physics.js', 'cancel.js'], }, 'HTML-CSS': { availableFonts: ['TeX'] } }
Note that the default config file is the same without the physics and the cancel extensions
I hope you can help me Matthieu
The physics extension is part of MathJax v3, but this is a v2 configuration, so I assume you are using version 2. That physics extension has not been back ported to v2, so an official one isn't available for v2. There is a third-party physics v2 extension in the third-party extension repository that you can try. There is documentation on that page about how to do that. If you can, you might want to consider updating to version 3 instead.
Thanks for the reply. Could you point me towards a procedure for upgrading MathJax please? The config file I copied earlier was automatically generated by MarkDown Preview Enhanced so the easiest thing I can do is modify it according to MathJax3 standard.
There is a section in the documentation about converting from v2, and there is a configuration converter referenced there that should help you update your configuration.
Thanks ! This will still be a bit difficult for me though. I tried the converter but it did not work. I think this is because of the module.exports that probably has to be replaced by something else. Anyway this is not so urgent for me. I raised the issue of implementing MathJax3 in Markdown Preview Enhanced extension.
Thanks again for your help
A quick look at the code for the extension suggests that it would require some alteration to the extension to work with version 3. In particular, the way the configuration is handled would need to be changed, as MathJax v3 doesn't use the older MathJax.Hub.Config() approach. So it is not as easy as just changing the mathjax_config.js file.
Thanks for the reply ! I'll just wait... it's OK.