Can we enable MathJax on GDSE? (revisited)

This has been discussed before in math markdown on this site, but I'd like to have some fresh discussion of this matter. Circumstances have changed in the meantime. The discussion of 2011 seems to consider it a foregone conclusion GDSE can't & won't get MathJax, but sites such as RPG Stack Exchange and Code Review and Worldbuilding have been granted MathJax, so that's no longer the case. I think it's worth having a fresh discussion of the matter; none has happened since 2011 because each subsequent time the issue has been raised it's been closed as a duplicate of that 2011 discussion. Jeff Atwood called it a heavy dependency, but that was in 2010, and MathJax's client-side performance has improved since then to be pretty smooth.

I believe it would be beneficial for GDSE to have MathJax enabled, and it's likely we could actually get it if we can show we'd benefit from it — which I am sure we can.

As Shog9 said in response to Code Review's request for MathJax:

Unless there's a large population of posts that could benefit extensively from it, there's no need to impose the cost on the rest of the posts. A few subscripts don't really necessitate this.

I believe there may well be such a large population of posts. Game development can get very mathematical: matrices, vectors, quarternions, projections, rotation, probability, physics, and graphics operations, are all mathematical subjects that are standard fare for us.

In one prior meta request, a user expressed they would prefer to use math formula, but used psuedocode because it was all that was available.

As was the case on on RPG Stack Exchange, the standard delimiter of $...$ would be an issue, so we could instead use delimiters of $...$ for inline MathJax, and $$...$$ for block-level MathJax.

• Since all the concerns about this feature are from ancient times (i.e. performance, bandwidth, browser support), I'm absolutely supportive of it. Jun 8, 2017 at 11:01

We're going ahead and enabling this, as you've shown plenty of examples of cases where it'd be useful.

As requested, the inline delimiters will be changed to $...$, and the block-level delimiters are $$...$$ and [...] (which are the defaults, and can't be changed).

Fixed posts broken by this:

• Woohoo! 🎉 Thanks for enabling this! Dec 12, 2017 at 17:37

This is a community wiki post anyone can edit.

Its purpose is to compile a list of Game Dev SE posts that would significantly benefit from MathJax/LaTeX markup, as part of the use-case argument for enabling MathJax here.

We need a decent body of evidence that MathJax would be worthwhile. RPG.SE and CodeReview responded by gathering a list of posts that would benefit significantly from MathJax, and the request was eventually implemented.

I believe such a body of evidence exists to be found. We just need to do the legwork to demonstrate it exists, so I invite others to participate in uncovering it.

This post already includes the posts mentioned in previous community requests for MathJax, which I am listing to ensure coverage and to indicate positive community sentiment for this feature: How can I render math formulas from StackExchange in my web browser?, Latex Integration, TeX should be supported on GameDev, like on Math.SE, Physics, et. al, Why don't we have LaTeX?, Can we have MathJax on gamedev.SE?.

A word on pseudocode

Many GDSE posts use pseudocode to represent maths. That's frequently useful to do when showing how to implement something natively in code.

Sometimes however it's not the most effective means of communicating mathematics, and reading the post it looks like pseudocode has largely been used just because it's the only real option available. Things like saying cross(vector1, vector2) can be simply expressed in either MathJax or pseudocode, and sometimes it's simpler and cleaner as MathJax.

Sometimes pseudocode is expressing how to implement a very complex formula in code form, which is also extremely useful! This stuff should remain as-is. However, often it's difficult to understand what basic mathematical formula is actually happening, when it could be something as simply annotatable as a matrix-on-vector transformation. These pseudocode blocks would greatly benefit from being accompanied by a MathJax representation of what they're implementing.

I can't read into all the cases where an author might've been happier writing out their pseudocode as MathJax, but I'm making an educated guess as to scenarios that would've been better that way, or where it would at least be excellent to have a choice to use MathJax.

List of posts that would improve with MathJax

Pseudocode that is preferable being left as-is and is entirely adequate without a corresponding MathJax formula has not been counted for the purposes of this list. Real code that is used or intended for use in a real codebase is not counted. Deleted posts and posts with trivial uses of mathematical notation (i.e. MathJax would likely not improve clarity) are not counted. Answers to closed questions have been included.

The symbol indicates the post is either already using LaTeX via images, or is using code blocks and/or unicode to represent complex mathematical symbols and/or layout for complex formulae.

Tags of interest

(Note: avoid overlap when searching, e.g. ideally search [matrix] -[mathematics])

• Thanks for including 117 in there. I'll confess I rewrote part of that answer today into a different factorization just because using ^ to show an exponent in a formula doesn't read as well as a proper superscript in math markup (and risks misinterpretation as a bitwise XOR). I still prefer code for writing the actual procedure, but being able to use common math formatting could help with the prose explanations accompanying it (eg. "This method is O(n^2 log(n)) and...")
– DMGregory Mod
Jun 9, 2017 at 22:44
• Fun fact, this answer is nearly at the 30,000-character limit on posts. Jun 10, 2017 at 20:42
• Wow, I didn't realize there was a limit! I wonder if we should prune the duplicate links and just append a note like "Q" "A" or "Q&A" to indicate when multiple posts on the same page demonstrate the issue.
– DMGregory Mod
Jun 10, 2017 at 20:44
• I've opted to use a regex to remove title slugs from the URLs, which ought to free up a lot of characters. :) Jun 10, 2017 at 21:33
• @DMGregory You can do superscript and subscript without MathJax, with the <sub> and <sup> tags, respectively. MathJax may look nicer, but for something like big-O notation it seems a bit overkill. (Not that this is any reason for the site to not have MathJax; there are clearly many reasons.) Jul 14, 2017 at 12:49