Write.as: MathJax / Markdown interaction bug

If one has two underscores (subscripts) in a paragraph, mathjax will not work. Here’s a minimal reproducible version:

# Mathjax test with two subscripts in same paragraph

This variable has a subscript $x_0$.

These variables also have subscripts: $y_0$, $y_1$. Math in this paragraph is broken.

It worked for me if you put an \ before each of the underscores, e.g.,

$y\_0$, $y\_1$

I’m aware that this workaround exists. It’s still very confusing that in the first paragraph you don’t have to escape the underscore but you do have to escape it in the second paragraph. I suspect this will catch a lot of people.

I’m tempted to say that if you write a post with more than a couple of math expressions which contain underscores, mathjax is broken for you on write.as.

The behavior of latex math + markdown on write.as is completely different than every other software which supports using latex math and markdown (e.g., pandoc, discourse(!)). No other software requires you to escape underscores in math expressions (enclosed by $ … $).

We opened an issue on the underlying Write.as software about these MathJax bugs here. If you want to add more detail to it @cornell then please do. Once the bugs are fixed then the changes can be pushed on the next Write.as update.

Hope that helps and thanks again for bringing this up again.

1 Like