# Curly brackets not showing in LaTeX display mode

In an answer to this question I wrote the following LaTeX code:

$$L=\{w\in\{0,1\}^*:|w|\geq n\text{ and the n-th symbol from the last one is 1}\}.$$


The output of this code should include four different curly brackets (two opening, two closing), but they are not being rendered.

Inline LaTeX formulae including curly brackets show them correctly, though, at least the ones I wrote in the same answer.

It works if you use two backslashes instead of one (i.e. \\{ and \\}).
One interesting thing to note is that if you type \{ or \} outside any latex environment (and without using code tags around it), it shows up without the backslash: { }. So it seems like for some reason the markdown engine consumes the backslash before MathJaX can get to it.
• @Raphael yep, it appears so. I remember writing formulas in cstheory with \{ without having this problem. Mar 8 '12 at 18:41
This seems to be a nasty interaction between MathJax and markdown. The parser is thrown off by the presence of nested $ signs inside \text and that triggers some markdown expansion which strips one level of \. Normally all markdown expansion is turned off inside MathJax, so the \ signs arrive unmangled to the MathJax interpreter. A possible workaround here is to use $$…$$ instead of $…$. MathJax does use$ as delimiters - we can change the default for this site if there is enough community support.
• $ for inline LaTeX notation and $$ for display mode (centered, different rendering methods for some symbols). I assume most people who use LaTeX feel familiar and comfortable with these delimiters, so I don't think they'll want to change ;-) Mar 9 '12 at 21:53 • What does this have to do with the problem at hand? No one has a problem with the delimiters,  and $$ are the obvious choice. MathJax/markdown seems to be thrown off by the $ inside \text inside math. Mar 9 '12 at 22:32