# Can we have MathJax back?

It's been a couple years since PPCG voted against MathJax. Since then, the vote ratio has changed significantly, and most seem to be in favor of MathJax. However, it is and no change will be enacted on the current votes.

The issue then was weird-looking search results, odd indentation and broken stack snippets due to $ being used in code. There are solutions to most of these, however. One solution is to escape all instances of $ in code (like it's done with < and >), which sounds fairly tedious but most of the work could automated if TIO were to do it. Not a great solution but some might believe having MathJax outweighs the cons.

We've had a lot of questions (and answers) since and they would greatly benefit from having actual mathematical expressions that look ridiculously better than if they were done with meek markdown formatting.

I'd like to revisit this issue with another vote as opinions and ideas have changed since then.

Should MathJax be enabled again?

Please vote on the answers with approaches, not on the question based on your opinion on Mathjax.

• As for the issue of Mathjax being extremely crappy in some cases, that's a case of a problem in the choice of implementation of Latex. If someone feels strongly enough about this issue, perhaps you could suggest a switch (to Katex, most likely) on meta.SE. – totallyhuman Jan 12 '18 at 22:48
• Why is MathJax interpreting $ in code section at all? – Paŭlo Ebermann Jan 18 '18 at 20:45 • It's worth mentioning that MathJax can be configured not to use $ as a delimiter. (You can use, for example $$ and $$ instead.) – Nathaniel Jan 31 '18 at 13:19
• @Nathaniel This answer covers that. – totallyhuman Jan 31 '18 at 13:22
• @totallyhuman right, sorry, I did look over the answers but managed to miss that. (You totally can have different closing delimiters from the opening ones though. $$ and $$ are the default on a new MathJax installation, in fact.) – Nathaniel Jan 31 '18 at 13:28
• @Nathaniel, $$ and $$ could well be more problematic, not less. – Peter Taylor Jan 31 '18 at 15:10
• Can we have MathJax back (part II) – Mr. Xcoder Feb 27 '18 at 10:19
• As I was updating the list of MathJax-enabled sites over on Meta Stack Exchange, I noticed that MathJax has been enabled here, so this is now status-completed. – gparyani Sep 10 '18 at 4:22

# Yes, bring MathJax back

Advantages of having MathJax on Programming Puzzles & Code Golf:

• A lot of , and challenges and answers (and not only those!) would benefit from having it back. This is a lot – At the time of writing, about 12.19 percent of the challenges are mathematics-related, not to mention that is our third most frequented tag.

• Rather than having to type our maths using third-party services, and then uploading pictures which would clutter the entire page, while still not being completely aesthetically pleasant, we would have a built-in way to use these equations that would overall bring a design improvement to the entire site.

Disadvantages of having MathJax (mostly those that were mentioned in the 2015 post that has disabled it) and their possible solutions (but they no longer seem to apply):

• There are two answers that would need to be fixed when using $, so that won't be a problem at all. – ბიმო May 22 '18 at 13:59 # Add support back, but change the delimiter I think MathJax would be fine, and see Xcoder's answer for more reasons why. However, the reasons it were disabled still stand: • Messed up regexes, since MathJax can trigger inside code blocks for whatever reason • Odd-looking search results (though in general I think this applies to regexes in search results) • Breaks stack snippets that we have, including the leaderboard one. But as far as I can tell, all of these would be fixed by changing the delimiter. Something like $ would work, but I'm open to other suggestions.

• Is it possible to do <mathjax>...</mathjax>? – totallyhuman Jan 12 '18 at 22:30
• @totallyhuman no afaict. Maybe <mathjax> for both but it would definitely need to be the same. – Rɪᴋᴇʀ Jan 12 '18 at 22:34
• @totallyhuman I do not think so. – Mr. Xcoder Jan 12 '18 at 22:34
• How about $? – Beta Decay Jan 16 '18 at 12:45 • This answer should include a link to this answer, which contains some more details as to what is and isn't possible with the delimiters. – Sanchises Jan 16 '18 at 13:36 • @Sanchises that answer says nothing about that. – Rɪᴋᴇʀ Jan 16 '18 at 15:38 • @BetaDecay doesn't that mean something else inside mathjax/latex? – Rɪᴋᴇʀ Jan 16 '18 at 15:38 • @BetaDecay Also, less importantly, Mathjax stuff would look like \[..\[. Something tells me most PPCG users will not be a fan of the asymmetry... – totallyhuman Jan 16 '18 at 21:13 • @totallyhuman Huh? It'd be \[...$ – Beta Decay Jan 17 '18 at 13:06
• @totallyhuman See: en.wikibooks.org/wiki/LaTeX/… – Beta Decay Jan 17 '18 at 13:07
• @BetaDecay I'm fairly certain we have to use the same delimeters for both ends. Not one for each. – Rɪᴋᴇʀ Jan 17 '18 at 17:32
• @BetaDecay I'm guessing both $ and $ are quite common in regex answers – Uriel Jan 31 '18 at 23:39

# Add support back, but make it not trigger in code blocks.

As far as I can see, this is the root of all problems. @200_success on CodeReview Meta says (emphasis mine):

MathJax is currently enabled with $…$ as delimiters. However, that breaks existing posts that contain two dollar signs within the same paragraph, but where the code is not formatted using backticks or a code block.

...which makes me think that this, IMO proper, fix is easily achievable.