There is a problem on the main site with alignment in code blocks that include the dollar sign.

Without $:

Mathematica graphics

With $:

Mathematica graphics

Code is from this post. I will add examples as I find them.

  • Can you link to an example of the problem, or give a sample code block that illustrates it (not just a screenshot but something to test with)? Does it happen in the preview as well, or only after saving the edit? – Szabolcs Jul 4 '12 at 16:48
  • Yes, please give actual text, no screenshots. Images aren't helpful for reproducing, let alone fixing, such issues. – balpha Jul 4 '12 at 16:52
  • @balpha sorry, I don't know what I was thinking. I've seen this happen a couple of times but I can only link to the one answer of mine at this time. I'll look for the other instances. – Mr.Wizard Jul 4 '12 at 16:54
  • That example is enough already, thanks. Reproduced. – balpha Jul 4 '12 at 16:56
  • @balpha okay, great. For reference, is there a way I can search for symbols/strings in a code block? I tried code: but it appears to search strings escaped with backticks rather than indented code blocks. – Mr.Wizard Jul 4 '12 at 16:58
  • 1
    The reason I couldn't reproduce was that I didn't put in a closing $. It is important to have two $ signs in the example and at least one newline. Thanks for taking a look @balpha! – Szabolcs Jul 4 '12 at 16:58
  • @balpha here's another example where the effect occurs. Look at the code block after the edit. – rcollyer Jul 4 '12 at 21:28
  • @balpha Any update on this? – rm -rf Sep 27 '12 at 17:45
  • 1
    This is a currently-unavoidable side-effect of mixing code blocks and MathJax together. Eventually, it should be possible to avoid it, but until then... – Shog9 Feb 15 '13 at 23:06
  • Another example, in the code block for parseBegin and parseExit. Should we respect the alignment in mardown (so in the future when the bug is fixed, the post will be right automatically), or should we respect the alignment in rendered result? – Silvia Jun 17 '13 at 9:43
  • @Silvia I'll leave it to your discretion. I am hoping that "eventually" will be some time soon but it might be years for all I know. – Mr.Wizard Jun 17 '13 at 10:23
  • Years... OK I think I have to reformat it for good looking.. – Silvia Jun 17 '13 at 10:30
  • @Shog9 Any news regarding a fix for this? – Mr.Wizard Aug 26 '13 at 17:04

You must log in to answer this question.

Browse other questions tagged .