2
$\begingroup$

I am not sure if this is the right place to post this question. I recently began getting a problem with writing latex expressions in math mode. Before I post the answer, the preview and expressions look fine, but after posting or editing the answer, the expressions appear vertically. See the attached screenshots below. I got this issue recently here and here.

Here is what I get in the preview while editing:

expression while editing the answer

Yet, here is what I get after editing and posting the answer:

expression after editing and posting the answer

$\endgroup$

2 Answers 2

4
$\begingroup$

This is a good place to post this. It looks like the markdown renderer of the post is overeager in escaping and behaves unexpectedly near the symbols $ and \. I would like to say that it replaces \\\$ by \\\\\$, but it seems the markdown renderer (even the preview) insists on adding an additional backslash twice in the previous sentence.

This is a bug. Note that the markdown in the post is parsed by a different method for performance reasons (which may explain why the preview parses it correctly).

One work-around would be to avoid the symbol $.

Another idea is to use display mathmode ($$) and don't escape the dollar symbol. $$ \Psi_1 = (\neg$)U($\wedge X((0\lor 1)∧X((0\lor1)\ldots $$

$\endgroup$
2
  • $\begingroup$ Thanks, that was helpful. BTW, who can fix this bug? I have found another way around. See my answer. $\endgroup$ Commented Aug 7 at 12:50
  • 1
    $\begingroup$ @BaderAbuRadi I've added the status-review tag. This will bring it to the attention to the SE (the company), such that their development team can eventually fix the bug. It is hard to tell when they are able to do so, however. $\endgroup$
    – Discrete lizard Mod
    Commented Aug 7 at 13:24
1
$\begingroup$

In addition to @Discrete lizard's answer, the following is another way around the issue that does not require using display mathmode(\$\$) -- meaning it allows writing an expression containing \$'s without centering it: we can replace every "\\$" that lies between two dollars with "\text{\$\\$$}". For example:

$ \Psi_1 = (\neg\text{$\\\$$})U(\text{$\\\$$}\wedge X((0\lor 1)∧X((0\lor1)\ldots $.

$\endgroup$

You must log in to answer this question.

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