8
$\begingroup$

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.

$\endgroup$

3 Answers 3

8
$\begingroup$

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.

$\endgroup$
2
  • 1
    $\begingroup$ This seems to be a new bug in MathJax and will hopefully be fixed soon. Lots of old answers on other sites may have been broken by this. $\endgroup$
    – Raphael
    Commented Mar 8, 2012 at 18:06
  • $\begingroup$ @Raphael yep, it appears so. I remember writing formulas in cstheory with \{ without having this problem. $\endgroup$
    – Janoma
    Commented Mar 8, 2012 at 18:41
1
$\begingroup$

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 $…$.

$\endgroup$
0
$\begingroup$

MathJax does use $ as delimiters - we can change the default for this site if there is enough community support.

$\endgroup$
2
  • 1
    $\begingroup$ $ 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 ;-) $\endgroup$
    – Janoma
    Commented Mar 9, 2012 at 21:53
  • 1
    $\begingroup$ 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. $\endgroup$ Commented Mar 9, 2012 at 22:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .