# Can we get TeX support?

Like on math.stackexchange, where (for example) I can type $\sqrt{2}$ for square root of 2?

If we want to be able to quote equations from data science research papers, this seems pretty essential.

• I suspect it will be needed here, but the way to request support for MathJax (LaTeX support) is to demonstrate a need for this in actual practice. I would suggest compiling a collection of posts in your answers here which could be substantively improved with TeX support. If the benefit to this site can be demonstrated in actual use, we will bring it up for consideration. Good luck! – Robert Cartaino May 14 '14 at 16:19

I would say that it is a must. Suppose that one is asking how to implement ridge linear regression, using only plain text is scary even to think about it.

Since Robert Cartaino said we need specific examples, here's one. In this answer, I said:

Huang's paper (linked above) also has a section on "k-protoypes" which applies to data with a mix of categorical and numeric features. It uses a distance measure which mixes the Hamming distance for categorical features and the Euclidean distance for numeric features.

I would have liked to have actually included the equation for the distance measure [equation (9) from the paper], but without TeX it would have looked like this:

d_2(X,Y) = Sum_{j=1...p}(x_j - y_j)^2 + gamma Sum_{j=p+1...m} delta(x_j, y_j)


which is pretty much unreadable. Compare to the paper to see what it's supposed to look like.

If I had wanted to be more detailed and include the cost function for k-prototypes (equation 10 in that same paper), it would be even more ridiculous:

P(W, Q) = Sum_{l=1...k}(Sum_{i=1...n} w_{i,l} Sum_{j=1...p} (x_{i,j} - q_{l,j})^2 + gamma Sum_{i=1...n} w_{i,l} Sum_{j=p+1...m} delta(x_{i,j}, q_{l,j}))


Having multiple subscripts and summation over multiple indices is really pretty typical, because you can have indices representing your data points, indices representing the features of each data point, indices representing the range of values of your categorical features, and for clustering problems you have indices representing your clusters as well.

But it's not just clustering problems; any kind of problem which is expressible in terms of vectors in a multidimensional vector space (which includes a great many data science problems) is going to be quite a bit harder to describe without access to something like TeX.

Another specific examples for Tex support:

This answer would be substantially improved with TeX support. Currently, it uses the Google Chart API to generate nicely-formatted equations. This is clearly not ideal, since it relies on an external resource that may not always be available and is not known to all users. These links will inevitably rot and we may not notice when they do. It would be much easier to maintain one standard, built-in resource for creating equations such as these.

In particular, these equations do not lend themselves to regular text formatting, because of the lengths of the numerators and denominators, and the use of multiple-character subscripts.

Here is another post that wants for TeX support. This time, instead of using the Google Chart API, I used a third-party website to generate a PNG image representing the user's desired equation (this is currently a suggested edit). Although the image is now hosted on stack-imgur, generating the image still relies on an external resource, and the post is more difficult to edit and probably fairly opaque to screen readers this way.

And another one. I used the same third-party website as last time to generate an image. This time, I added the code as the image description, which should make it easier to duplicate and edit. However, this equation is significantly more complicated than the previous two, and clearly demonstrates the need for proper formatting tools.

Part way through an answer, and, agree, it is a must. Like Code Review though, I expect there to be many places where there are code-snippets representing algorithms as well.

I suggest using \$ as the MathJax delimiter instead of $ so that people can more freely use the $ in regular typing. • $ only starts Mathjax outside code snippets. Why should this site be different from all the other science sites? The reason \$ was used on CR is that it was added long after the site started and using $ would have broken some existing posts — and even then I'm not convinced that it was worth the incompatibility and syntactic irregularity. – Gilles 'SO- stop being evil' May 29 '14 at 22:14

Clearly LaTeX is need here, so…

$$\Huge MathJax: ACTIVATED$$