• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

348
Views
How to not show parsing error in MathJax?

I am using MathJax for showing equations on my webpage. Using the below config script. But in case of syntax error, I Don't wanna show the exception instead it should show the Jax as it is. Gone through about formatError in here https://docs.mathjax.org/en/latest/options/input/tex.html but How to use it? tried a couple of methods but it does not help.

<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    showMathMenu: false,
    extensions: ["tex2jax.js"],
    messageStyle: "none",
    showProcessingMessages : false,
    jax: ["input/TeX", "output/SVG"],
    tex2jax: {
      inlineMath: [ ['$','$'], ["\\(","\\)"] ],
      displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
      processEscapes: true,
      preview: "none",
      
    },
    processEnvironments: true,
  });
</script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js"></script>

enter image description here

about 3 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You probably want to use the noUndefined and noErrors extensions. The first will cause undefined macros to show as a red version of the macro name, but will typeset the rest of the expression. For example x + \3 would appear as

enter image description here

rather than the undefined control sequence message that you are seeing above.

The second causes any other type of error to just display the original TeX code rather than the error message. So \frac{a}{b with a missing close brace would just display as \frac{a}{b rather than the error message.

To do this, you would add

TeX: {
  extensions: ['noErrors.js', 'noUndefined.js']
},

to your configuration. See the documentation for noUndefined and noErrors for more details.

about 3 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error