# Strange layout bug when line breaks at end of LaTeX

In my post here some LaTeX renders ok in the preview but incorrectly renders as "12eeeb8e-4fdb-47bf-abc4-2b56e87c5903" in the posted answer. Does anyone see what's wrong and/or how to workaround it?

Note: the bug seems to be caused by the (markdown) line-breaking two-spaces being immediately after a latex expression. I've whittled it down to a small reproducible example. Thanks much to Moron for his quick help in isolating this bug..

A fix for this will go out in the next deploy.

• I am curious as to what the bug was. Is it possible for you to divulge that? – Aryabhata Dec 4 '10 at 6:06
• @Moron: My guess: the guids are placeholders for LaTeX expressions during markdown, but there's a fencepost bug when they occur at end-of-line. – Gone Dec 4 '10 at 17:07
• @Kevin: Thanks for the quick fix. – Gone Dec 4 '10 at 17:07
• @Moron - Sometimes spaces are significant, and sometimes they're not in markdown. There was a bug in code meant to preserve spaces after markdown-escaped LaTeX sequences. – Kevin Montrose Dec 5 '10 at 6:41
• @Kevin: I am more curious as to how the guids cropped up :-) – Aryabhata Dec 5 '10 at 15:23
• @Moron - GUIDs are used as placeholders for various things (including markdown-escaped LaTeX) in our post rendering pipeline. They can creep up if things get odd, as they did with this bug. – Kevin Montrose Dec 5 '10 at 22:10
• @Kevin: Thanks. Bill's guess was right :-) – Aryabhata Dec 6 '10 at 1:32

I have worked around it in your post. It does not look like a MathJax bug.

1) Right clicking on the 12eee... does not bring up the Mathjax menu.

2) There was a new line before the "then every element", deleting which fixed the issue.

Seems like we have a bug in the SE software.

For a small repro, check out the revisions of this meta answer: Formatting Sandbox

• Thanks Moron, but I do desire the newline at that point. If you can put in the newline I'd appreciate it since more edits by me come close to making it CW. – Gone Dec 2 '10 at 19:29
• @Bill. Sure. Done. If you want to add new lines, you can try using html markup: <br/> – Aryabhata Dec 2 '10 at 19:31
• I've narrowed it down - see the sandbox. – Gone Dec 2 '10 at 19:35
• @Bill: Nice. Now the SE devs have a good repro. I expect this will be fixed soon :-) – Aryabhata Dec 2 '10 at 19:37
• Don't know if it's related, but I've seen text after $\LaTeX$ lines being scrambled (sentences being cut off, and the "tail" comes before the "head"). It disappears upon refreshing, so I wouldn't know how to turn this into a reproducible bug. – J. M. isn't a mathematician Dec 3 '10 at 9:19
• @J.M: That looks like a Mathjax bug. The current one looks to be a bug in the parsing stage. The numbers you see are guids and it seems like we probably uncovered some undocumented 'feature', clashing with latex markup. – Aryabhata Dec 3 '10 at 16:09