# PSA: MathJax is for math

The majority of this post was written by bobble and Deusovi.

# When should I use MathJax instead of plain text?

Many people browse the Internet using screen readers, most of which struggle to process MathJax. Only a few expensive ones can handle MathJax directly. Others require a wonky extension which doesn't work sometimes. Some just can’t read it at all.. If you write "$$1$$" instead of "1", there will be people who are unable to read your post as intended.

It’s not just screen readers that have trouble: people with dyslexia can find the fancy cursive script that MathJax uses difficult to read. Switching back and forth between regular text and fancy MathJax variables, for instance, will significantly harm readability.

So, the solution is simple: Only use MathJax when you need its equation formatting. If you could write the same thing in plain text, then use plain text instead.

Lots of math can be represented just fine without MathJax:

MathJax input MathJax Unicode / plain text Markdown input Markdown
Numbers $729,\sqrt{2}, 180^\circ$ $$729, \sqrt{2}, 180^\circ$$ 729, √2, 180°
Variables $a$ $$a$$ 𝑎 _a_ a
Arithmetic $+, -, \div, \times$ $$+,-,\div,\times$$ +,-,÷,×
Inequalities $>, <, \geq, \leq$ $$>,<,\geq,\leq$$ >, <, ≥, ≤
Superscripts and Subscripts $a^b, a_b$ $$a^b, a_b$$ a<sup>b</sup>, a<sub>b</sub> ab, ab
Greek $\pi, \theta, \epsilon$ $$\pi, \theta, \epsilon$$ π, θ, ε

It's true that sometimes, math really is too complicated to write up without MathJax. This is what MathJax was designed for! But you should only use it when it actually improves an equation's readability. If you don't need any fancy math formatting features of MathJax in particular, then use plain text.

MathJax also takes a considerable amount of time to load. The more MathJax on the page, the longer this takes. Also don't use MathJax for $$fancy\ italic\ fonts$$ either; it renders terribly and, simply put, is not math. There's already *markdown* for italics, and sans-serif fonts are easier to read.

• You should also add that MathJax takes up extra time to load the content Dec 10 '20 at 1:01
• @PrinceNorthLæraðr your wish is my edit.
– matt
Dec 10 '20 at 1:08
• Which screen readers did you use to test these? To me it would seem that the mathjax code read aloud should be a lot easier to understand than some unicode character names, so maybe there's an easily fixable bug in the screen readers used?
– Bass
Dec 14 '20 at 7:53
• @Bass could be right, can we have more information about how do the screen readers read matjax? In my browser $\sqrt{2}$ is rendered as the unicode character for the square root followed by a 2, just with another font. There are also many <span>s for positioning, but if the screen reader just ignores them the read part is exactly the same as if it was Markdown. Dec 19 '20 at 22:11

### MathJax shouldn't be used for non-maths purposes like fancy italics ...

I partly agree with your post. Sometimes MathJax is used just to make something look fancy even when it's nothing to do with mathematical notation, e.g. $$fancy\;italic\;fonts$$ which as you say render terribly.

### ... but it SHOULD be used for maths notation, even when other things would also work.

Here's where we disagree. In a question or answer which is about some mathematical stuff and does require MathJax for some complicated formulae, the notation used should be consistent all the way through. Don't use $$a$$ and $$x$$ in a formula and then a and x in text to mean the same thing. Those letters look different from each other; it's inconsistent and potentially confusing.

We were given MathJax for a reason! Let's not hobble ourselves by writing in a way that looks crap (x? is that a times sign or a lower-case x?) when we have the necessary tools at our disposal to make a mathematical discussion look professional. Some of the proposals above would be actively making the site worse, making mathematical things look horribly amateur and ugly and outright ignoring our expressly given ability to make them look as good as they would in a serious mathematical discussion.

I'm speaking from the viewpoint of a professional mathematician, someone who's regularly writing and reviewing mathematical papers. Of course that's a different context from a Stack Exchange Q&A site, but many of the same principles apply. It always annoys me to review papers where the authors seem to have no idea about presentation and how a proper maths paper should look - even if the results are correct, reading a paper that looks like it's been written in Microsoft Word instead of LaTeX is just frustrating.

If we were on a site where MathJax didn't work, then the symbols in Deusovi's answer would be useful in our mathematical puzzle solving, at least to use while we waited for SE to implement our request for having MathJax formatting on this site. But we do already have MathJax here, so we'd be crazy to reject this very useful tool in favour of a hacky workaround.

This doesn't apply to non-mathematical puzzles, of course. For example, in a riddle which has no equations or formulae but for some reason wants to mention $$+$$ or $$=$$ or $$x,y,z$$, then it's OK to write these in an ugly plaintext way since it's a word puzzle not a maths puzzle. But some of our maths puzzles involve some really interesting and high-level discussions; let's continue to present these in a way that would keep the respect of professional mathematicians rather than make them tune out in disgust.

As for people using screen readers, either they have one which can parse MathJax (in which case no problem) or they're probably not going to be reading our maths puzzles anyway. Anyone who wants to read mathematics should equip themselves with what they need to read mathematics. I doubt they're going to care much if their screen reader can parse some a+x in paragraphs of text but still can't parse the MathJaxxed equations in between.

If I see maths puzzles that write "a+2b=3c" in that kind of formatting, I'm going to continue editing those into proper "$$a+2b=3c$$" form. That's how mathematics should look. In real life I spend time training budding mathematicians in the use of LaTeX tools to present mathematics in a professional way; I'm happy to provide the same free services on Stack Exchange to help improve the appearance of formulae here too.

• I have a general policy that if I can't properly replace all of the math in a post with MathJax (so there are some complicated fractions, say) then I don't replace any of the math. This generally means that I leave the more math-intensive posts alone. Dec 10 '20 at 15:35
• @bobble That's a sensible policy, but it's not mentioned in this meta question :-) Dec 10 '20 at 15:43
• But puzzles that don't seem mathematical do sometimes have solutions that require heavy math, no? "They're probably not going to be reading our maths puzzles anyway" is a big assumption. I'm familiar with LaTeX myself, and agree that plain text is not ideal for presenting math. But given that MathJaX text is vertically misaligned (and slightly larger than) its surrounding text, it's ugly that way too. The "interersting and high-level discussions" wouldn't be affected by this anyway, because the PSA is specifically about things that can be represented in plain text without losing readability.
– Deusovi Mod
Dec 10 '20 at 17:23
• I agree with your point on "consistency", and generally agree that variables should look different from their outstanding text. Though I'd say that if a post only has one or two variables, and very few actual mathematical expressions, MathJax should be avoided. (I'm thinking of cases along the lines of "An n-anagrammable word is one that has n different permutations that all form Scrabble-legal words...")
– Deusovi Mod
Dec 10 '20 at 17:28
• @Deusovi Agreed with your last comment, and that's what my third-to-last paragraph is trying to get at. True that MathJax in text stands out and is in a different font, but that's actually somewhat desirable because you want to be able to clearly see the difference between a (indefinite article) and $a$ (mathematical parameter). It's also the way real mathematical texts are written, so admittedly I come from the viewpoint of seeing this every day and I've probably become acclimatised to the drawbacks. But surely we want maths here to be written similarly to maths in the "real" world? Dec 10 '20 at 19:05
• @Randal'Thor MathJax for variable names isn't the only way to do this. Unicode "mathematical alphanumerics" characters do the exact same thing -- I even gave a similar example at the end of my answer. As I mentioned in my previous comment, the aesthetic issue is not just "standing out" (which I agree is the correct way to do things; I have also read a fair amount of mathematical texts, though likely not as much as you). It's that MathJax is misaligned and mis-sized compared to its surrounding text.
– Deusovi Mod
Dec 11 '20 at 5:17

I think @Rand al'Thor answer contains a valid argumentation about the "how mathematics should look" part but I have something to say regarding the dyslectics and screen readers part.

MathJax takes some time to load, that's true, but it is loaded asynchronously so most users will barely notice the delay.

I don't think that screen reader users are not going to read our math puzzles, and anyway they should have the same rights to see these post if they want to. That said, I don't think that the solution is to remove matJax from PSE: I would rather fight my battle to have a screen reader that parses matJax correctly, or even better () to have an "accessibility" version of the website that renders matJax as plain text.

So, can we ask to the stackexchange staff to have this feature implemented? In this way professional mathematicians can still appreciate the beautiful formulae while screen reader users and people with dyslexia can read all the posts.

Why fighting the windmills when we should be fighting the giants?