Script to identify wrong formulas

33 views
Skip to first unread message

vitor hugo costa luz

unread,
Jul 30, 2021, 12:39:21 PM7/30/21
to MathJax Users
Hello, I am developing a script which is able to execute Mathjax, and later identify if there was some rendering error.

For this I made a script using Selenium, where I load a web page containing only the formula that I would like to parse, and then execute Mathjax.

I basically identified that there are two different types of errors: 1) formula structure (for example, missing close brace). 2) Unsupported TeX command.

To reproduce the first case, I entered a formula like (\frac{x}{y) ; to reproduce the second, I introduced a non supported command, something pretty simple like (\k).

For both scenarios I saw that Mathjax generated some specific tags. The first case resulted in a  <mjx-merror>; and in the second case a <mjx-mtext> was produced.

So I have 2 questions related to this:

1) Is there a more appropriate way on doing this (identify if Mathjax fails to render something)

2) In case I'm already doing it the right way, is it trustable assume a Mathjax error if I found one of the following tags? <mjx-merror> or <mjx-mtext>
Reply all
Reply to author
Forward
0 new messages