# We should have MathJax. What should the escape sequence be?

This site is going to have a lot of math on it. There are going to be questions that are almost purely math.

To me, this is clear: We should have MathJax.

These are the features we would gain.

@rolfl makes a great point... we need to figure out what the escape sequence should be.

• $always means MathJax • Pro • Math puzzles will be a lot less annoying to write. • Con • Questions involving money are more annoying to write • Questions involving certain programming languages are more annoying to write (how common will these be?) • People who don't know TeX could find it frustrating "why can't I write a$?
• Administrative Note: The way to request support for MathJax (LaTeX support) is to demonstrate a need for this in actual practice. So compile a collection of posts below 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! May 14 '14 at 23:25
• @RobertCartaino See the list below. Can we have MathJax yet?
– SQB
May 20 '14 at 20:32
• We now have MathJax. Thank you, @RobertCartaino and everyone involved. The escape sequence is \$for inline and$$for standalone math. – SQB May 23 '14 at 6:41 • @SQB You're welcome. Credit goes to @Jon Ericson for putting all the legwork into this one. May 23 '14 at 13:18 • Thank you @JonEricson ! May 23 '14 at 13:27 ## 6 Answers All right, it's time for everyone's favorite post: the list of posts that would benefit from MathJax! The Stack Exchange team looks for posts that would benefit by having MathJax (they want to make sure it's actually needed), so let's make a list of such posts. As this is a community wiki, feel free to edit in posts that would benefit, but are missing. • TBH, I don't think mathjax would help there. Even mathjax doesn't do tables properly. May 15 '14 at 1:39 • @Kevin Actually, you can get pretty decent tables using MathJax. See my answer on Math.SE for instance. – SQB May 15 '14 at 6:34 • @kevin Have a look here and see how pretty tables can be generated using MathJax. May 15 '14 at 6:57 • My answer to What is the fewest number of filled-in squares required to uniquely define a magic square? is another that would benefit. May 17 '14 at 14:36 # Yes And, the default escape-sequence for MathJax on SE is to use a$, like $log(n)$ ....

Should this be changed (like it is on some other Stack Exchange Sites) to \$(as in \$log(n)\$) ? If the site uses the$ often in regular question text, then it can cause problems with the page parsing.

Will it be common here to have $100 currency values? Or programs in$php? Or a puzzle that discusses Micro$oft? • At first I thought it should be default, escape to use it, but now I'm thinking there could be a lot of questions with money in them... or programming/code puzzles. May 14 '14 at 20:59 •$100 currency values is the only argument for the weird, non-standard \$. Programs in PHP should use code markup and Micro$oft should be spelled correctly. May 14 '14 at 22:31
• I haven't encountered \$as an escape sequence yet. I can see the need for it, since dollar amounts are likely to come up. But how does one escape a dollar sign within MathJax if \$ in this case?
– SQB
May 15 '14 at 6:38
• In fact, most puzzles about money do not improve by knowing what the currency is. You get 100 whatevers and pay 1 whatever is all you need. That said, people often want to use dollars. Coming from math, I agree with using $May 15 '14 at 13:25 • You could use something like € or even ¤ (the generic currency symbol), but it's also a matter of convenience -$ is the only currency symbol that most people have on their keyboards.
– user88
May 15 '14 at 13:49
• @JoeZ. And in ASCII (so supported by literally every font). May 15 '14 at 22:51
• \$might be safer - if we want to to be accessible to as many people as possible, I say we privilege those asking about questions that don't need a working understanding of MathJAX, and simply have those using it type an extra couple of characters. May 17 '14 at 20:46 I didn't even think it would even be an issue, so I didn't post earlier, but… The escape sequence should be$.

$is what people who already know (La)TeX use. Even more importantly,$ is what people who already know how to write math on Stack Exchange use — it's what Mathematics SE uses, and it's what all the MathJax documentation on Stack Exchange (mostly on Math meta) uses. Even the upstream MathJax documentation uses $in its examples (even though the MathJax preprocessor doesn't have$ active by default — it has $$…$$ instead).

Using \$reduces the discoverability of MathJax. If I suspect that MathJax is enabled but am not sure, I'll type$a$— see that it doesn't come out as math, so no, there's no MathJax. It's to be expected that we'll have migrations between Puzzling and Math at some point. Ok, that only concerns a small number of questions, but it would be a gratuitous incompatibility. Still, it's the human dissonance that I'm mostly concerned about, far more than the technical dissonance. In all the posts I've seen during the beta where people assumed that we'd have MathJax, they used$. I didn't see a single post with \$. When MathJax was announced, people even started to edit posts to use$ — because for a few hours, $was what we had. Changing to \$ midstream means even more work.

And what's the point of using \$? To avoid a relatively rare case where two dollar amounts are used in the same paragraph. People already run into trouble when they use an unprotected _ or * and feel safe, and then use a second one and get italics all of a sudden.$ would be no worse than that. It's very visible in the preview, too.

I could see the point of picking \$if there were already many posts using$ (which, as far as I reason why EE.SE uses \$— because it was enabled only after the site had been existing for a few months and the attempt to use$ broke quite a few existing posts). By exactly the same argument — breaking existing posts — this site should use $. Riddle me this: \$ \begin{array}{l|l|l} \text{Site} & \text{Puzzling} & \TeX - \LaTeX & \text{Math} \\ \hline \text{MathJax} & \text{True} & \text{False} & \text{True} \\ \text{Delimiter} & \backslash\text{\$} & \text{NULL} & \text{\$} \\ \end{array} \$• Yay! But could the delimeter be changed to \$, since there might be problems about money? May 21 '14 at 12:15
• @Doorknob: Done. Now... How do I put \$in the table? ;-) May 21 '14 at 16:50 • The escape sequence should be$. And it should definitely not have changed without any public announcement! Changing the delimiter broke a lot of existing posts. May 21 '14 at 18:49
• Well then, I didn't expect the change to be made so... abruptly. I still stand by my decision to make it \$, but I don't think it should have been changed with so little warning. May 22 '14 at 14:24 • I see you've changed posts from$ to \$, but don't forget there are lots of comments too (e.g. here). And we normal users can't fix them. May 22 '14 at 16:21 Even if it isn't necessary, it will be very nice. The symbol I may miss most is the times sign-in my answer here about sudoku, I find 9 x 9 ugly, while$9 \times 9\$ is much more elegant. Yes, you can read the former but lots of puzzles involve grids and it is nice to talk about the dimension this way.

• SQB's answer for my question here asks specifically for MathJax May 15 '14 at 14:38
• Because I read this post, natch.
– SQB
May 16 '14 at 6:31

To be honest, I don't think we're going to need it. The only real use for it I see here is in answers about the probabilities or mathematics underlying different types of puzzles, and I don't think we're going to see nearly enough of those to justify it.

• I would have liked it answering your Sudoku question, just to talk about the size of the grid. May 15 '14 at 14:15