Someone has to ask for an update, what with all this new computing power and bandwidth and CDNs we have nowadays.
Previous request, from 2017: Please revisit MathJax on SO.
The answer given by Nick Craver, at an earlier date, This answer is to specifically address the "it's not a heavy dependency" argument., is now more than six years old, and things could be different now. The test only took a few moments, so perhaps someone at SO could try it again.
The reasons for rejecting it may no longer be valid – from MathJax Frequently Asked Questions:
Will MathJax make my page load slower even if there’s no math?
MathJax loads components only when needed so there is a big difference between what is loaded on a page without mathematics and one that does include mathematics. On a page with no mathematics, loading MathJax requires two files: MathJax.js and a configuration file. If taken from a cdn, the actual (compressed) data transferred for MathJax.js will be about 14.4KB. The configuration file can vary greatly in size depending on what is included; minimal configurations can be as small as 3.7KB, reasonable configurations vary between 25KB and 40KB – bringing us to a total of 18KB to 55KB, i.e., roughly a small to medium sized image.
[Emphasis mine]
The main argument on loading speed was that it was "unlikely to be cached from elsewhere". Even if that's the case, proper caching won't slow down every request to SE. We'll be getting back to CDNs later.
Additionally, it is used whether Stack Overflow supports it or not. Codecogs is just one of many sites used to provide alternatives to Mathjax. All these add images to the size, and these do slow it down. Mathjax is rendered dynamically, which means when the JS and config has been transferred, nothing else needs to be transferred than text. The workarounds, which are used in the wold, seem to scale in size based on how big the input is:
(Data sampled from this question)
These aren't accessible, at all. Aside images not being readable by screenreaders, dark mode has introduced challenges (10k only - screenshot below) with these types of images.
If Codecogs suddenly starts becoming wide-spread, and ends up being used for rendering of bigger things, this adds a hell of a lot more to each page than cached JS and config. As an added bonus, Codecogs doesn't appear to cache anything. The images are loaded from the server every time the page is reloaded.
I also hear MathJax can be modified to easily fit into the light/dark mode scheme SE is using. MathJax supports a lot more accessibility features than images.
However, not all images are sourced from third party sites. Some posters actually use Imgur, or other services. In some or another way, questions are going to use LaTeX, whether through SE or not. Without support on SO, people are going to resort to other ways. This has consequences. We've been over this before. Full MathJax support means we can replace external links and image links with something both more accessible, as well as something that's generally safer and future-proof, and that doesn't cause pain to dark mode users.
That being said, offering accessible math expressions, which will appear whether we have mathjax or not, is arguably the main reason to implement it. Of course, there's the legendary alt text, but I doubt it's widely used properly. I'd show some stats to back this up, but I can't get SEDE queries to run against all the posts (questions and answers, questions, or answers) without timing out.Bonus points for real stats on this
To address some other concerns:
While there are many questions that have no use for LaTeX at all, we for one have a latex tag -- which is on-topic in most cases. Additionally, as programming is linked to path, we do have quite a few questions that actually relate to math. While this may not appear often in a language context (as in questions about a programming language), it can appear a lot more as a useful visualizer of what a function does in machine learning-related contexts, or in questions where geometry is involved. There's probably more usage areas; these are just some. Math is often involved, and a potential use for LaTeX alone doesn't mean it's most likely off-topic.
Here's a few examples. Note that it's not always the question that contains LaTeX images; direct links to the question is a design choice to embed the titles.
- Vectorized matrix manhattan distance in numpy
- How to get the average of several chrono::time_points
- Display frame around an expression in LyX (/LaTeX)
- How do I compute the intersection point of two lines?
- How to resize (control) subscript sizes in MathJax
- Inserting a PDF file in Latex
(Note: most of these contain codecogs links, and that's because they're searchable. Finding all questions with LaTeX embedded as imgur images accurately will take a really long time)
Aside people using alternatives, there are probably people working with LaTeX who want to embed stuff, but decide not to because it isn't built in. If implemented, the usage of LaTeX on-site might go up both related and unrelated to LaTeX questions.
Even if it isn't used for the majority of people, the consequences of that are very small. It adds some page load from time to time depending on cache age limits and updates, after which caching kicks in. SE's compression could also help with the size. As an example, this page (before this expanding edit) was a total of 170 KB. Only 34.74KB were transferred, according to Firefox's Network tab.
Where it is used, however, it could result in a faster load time compared to using non-cached images, it future-proofs it if a third party site is used and it later goes down, it protects users if said site is then repurposed for evil, and it fixes accessibility concerns related, among other things, screen readers, as well as adding an easy fix for accessibility issues introduced by the dark theme.
Also, let's talk CDNs. One of the other rejection posts named beta.mathjax.org as a bad CDN, because "that one's not going to be cached for most Stack Overflow users". How does the recommended CDN being backed by CloudFlare sound? (Direct CDN link). CloudFlare itself is fast, and some stats place CDN market share at 39.5%. Additionally, this answer recommends an alternative that doesn't involve globally loading it, but loading it as necessary.
alt
text is an issue that isn’t exclusive to LaTeX images.