MathJax

Show errors for invalid LaTeX - MathJax

Show errors for invalid LaTeX

by mrfrenzy » Mon Jul 20, 2020 1:55 pm

Some users get confused when they write a long Latex expression and it does not render. Perhaps they misspelled a command or used an invalid command. MathJax for example does not support \begin{tabular} like the old latex mod for phpBB 3.0.
As standard MathJax does not display error messages.

Thanks to post by mpaw and MathJax documentation I figured out how to add it to the configuration. I changed overall_footer_after.html to the following:

Code: Select all

<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-MML-AM_CHTML"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: { noErrors: { disabled: true } }
});
</script>
Now the post will display an error message showing what is incorrect.
mrfrenzy
Registered User
Posts: 14
Joined: Thu Jan 22, 2009 10:27 am
Location: Sweden