# Misplaced hyphen and period appearing at the end of comments

There seems to a small issue with rendering latex maths formulas in the comments area. When entering a formula that spans more than one line, a '. -' appears after the first line. It clearly should not be there, rather it should be further down just before the author name. See this post for an example:

Proof that a $\sigma$-field contains the sets $A \cap B$, $A \setminus B$, and $A \triangle B$.

• I took the liberty of editing your question to include the specification that it is a problem with Google Chrome and also added a screen shot. – Willie Wong Feb 18 '14 at 12:06
• From the source, it appears that SE correctly placed a non-breaking space between the dash and the user name in the "signature" portion of the comment. The fact that Chrome chooses to ignore the &nbsp; and insert a line-break between the - and the user name seems to me to be a Chrome bug. – Willie Wong Feb 18 '14 at 12:10
• Retagged as support - it does appear to be a bug, but as @Willie posted, a Chrome bug, so not something that SE can fix. – Oded Feb 18 '14 at 13:00
• The dash is an en-dash, and that is a valid break point. So the question is, which takes precedence, the en-dash that allows a break after it, or the non-breaking space that prevents one before it? I tried reading the Unicode standard for this, but was not willing to put in the time that it would really take to figure it out. The en-dash is class BA, and the nbsp is GL, if I understand correctly, so the table suggests a break is allowed (but the whole this is pretty hairy, and I may not have read it right). – Davide Cervone Feb 18 '14 at 22:30
• But Willie Wong is right, the real issue is using in-line math mode for what should be a display equation. – Davide Cervone Feb 18 '14 at 22:31
• One issue with deciding whether to use an in-line math mode or the multi-line mode is that you don't know before submitting the comment which one you will need. That is, you don't before hand how far the equation is going to span before submitting if the equation is not that long. – M.K. Feb 19 '14 at 12:46
• @IftikharKhan, one should be able to make a reasonable guess as to which mode to use, and if it turns out not to be correct, you have something like 5 minutes to edit a comment before it becomes permanent, so you can still fix it if it is wrong. – Davide Cervone Feb 20 '14 at 10:49

If in your comment, your meant this comment, here's what I see (Firefox 13):

In particular I don't see any spurious hyphens.

There is an extra period at the end of the first line. But that is because you typed a period after the extra long equation. It may be slightly misplaced, but certainly not spurious.

To put the period at the correct place, you should really not use the in-line math environment $...$ for such long expressions, and instead use the displayed math environment $$...$$. In my two comments below I showed what it would look like if you used the double dollar sign instead of the single. The first comment puts the trailing period outside the Math environment, so it now appears right in front of the signature line. And the second comment puts the trailing period inside the math environment, so now it appears at the end of the math expression.

Edit in response to comment: There is a trailing period. This is what you typed:

Edit in response to other comment: Okay, on Chrome there's a period and a hyphen. Again, they may be misplaced, but they are not spurious. But the solution I gave above (and the comments shown below) works for both firefox and chrome.

Let me cook up the expression a little bit to show more clearly what MathJax is doing. By rewriting your expression somewhat I can force MathJax to break the line only at certain spots. And now you see that if I write ${x\in A \triangle B \iff x \in [(A \cup B) \setminus (A \cap B)]} \iff {x \in [(A \setminus B) \cup (B \setminus A)] \iff x \in (A \setminus B) \cup x \in (B \setminus A)} \iff {(x \in A \land x \notin B) \cup (x \in B \land x \notin A) \iff (x \in A \land x \in B^c) \cup (x \in B \land x \in A^c)} \iff {x \in (A \cap B^c) \cup x \in (B \cap A^c) \iff x \in [(A \cap B^c) \cup (B \cap A^c)]} \iff {x \in [(A^c \cup B)^c \cup (B^c \cup A)^c)] \in \mathcal{F}}$, it renders like this because the entire in-line math expression is treated as one unit to be stuffed into the line.

• $$x \in A \triangle B \iff x \in [(A \cup B) \setminus (A \cap B)] \iff x \in [(A \setminus B) \cup (B \setminus A)] \iff x \in (A \setminus B) \cup x \in (B \setminus A) \iff (x \in A \land x \notin B) \cup (x \in B \land x \notin A) \iff (x \in A \land x \in B^c) \cup (x \in B \land x \in A^c) \iff x \in (A \cap B^c) \cup x \in (B \cap A^c) \iff x \in [(A \cap B^c) \cup (B \cap A^c)] \iff x \in [(A^c \cup B)^c \cup (B^c \cup A)^c)] \in \mathcal{F}$$. – Willie Wong Feb 18 '14 at 11:54
• $$x \in A \triangle B \iff x \in [(A \cup B) \setminus (A \cap B)] \iff x \in [(A \setminus B) \cup (B \setminus A)] \iff x \in (A \setminus B) \cup x \in (B \setminus A) \iff (x \in A \land x \notin B) \cup (x \in B \land x \notin A) \iff (x \in A \land x \in B^c) \cup (x \in B \land x \in A^c) \iff x \in (A \cap B^c) \cup x \in (B \cap A^c) \iff x \in [(A \cap B^c) \cup (B \cap A^c)] \iff x \in [(A^c \cup B)^c \cup (B^c \cup A)^c)] \in \mathcal{F}.$$ – Willie Wong Feb 18 '14 at 11:54
• Nope, I did not type any period; here is the exact latex script, look no periods Ma!: x \in A \triangle B \iff x \in [(A \cup B) \setminus (A \cap B)] \iff x \in [(A \setminus B) \cup (B \setminus A)] \iff x \in (A \setminus B) \cup x \in (B \setminus A) \iff (x \in A \land x \notin B) \cup (x \in B \land x \notin A) \iff (x \in A \land x \in B^c) \cup (x \in B \land x \in A^c) \iff x \in (A \cap B^c) \cup x \in (B \cap A^c) \iff x \in [(A \cap B^c) \cup (B \cap A^c)]. Btw, what browser are you using? I'm using Google Chrome – M.K. Feb 18 '14 at 11:56
• @IftikharKhan: there is a period in your comment. I copied those two expressions directly from your comment (one of the magically things that diamond-mods can do). – Willie Wong Feb 18 '14 at 11:57
• Thanks! So I should use  for multi-line formulas in the comments area. – M.K. Feb 18 '14 at 12:01
• I still don't understand why you can't see it. I can see and so can support. – M.K. Feb 18 '14 at 12:02
• Similar problem on Firefox; the hyphen is in the right place but the period is not (when using in-line math env.) – M.K. Feb 18 '14 at 12:11
• From the point of the computer, the period is placed at the right place for the in-line environment. You give the computer an inline math environment, and tell it to break lines automatically when it is too long. So what it does is it breaks the lines, boxes it up, and inserts the entire thing back into the line as one "extra thick line". (Imagine the entire mathematical expression being a picture. You told the computer to treat this picture as "inline" so it did as requested: put the picture in the line, placed a period after it, and let the picture descend beneath the line as needed.) – Willie Wong Feb 18 '14 at 12:15
• So it is not a bug then? You have tagged it as a bug. – M.K. Feb 18 '14 at 12:53
• The period is not a bug. The hyphen is. (At least in my opinion.) – Willie Wong Feb 18 '14 at 12:55
• Why is the hyphen bug, in your opinion? – M.K. Feb 18 '14 at 13:27
• meta.math.stackexchange.com/questions/12785/… – Willie Wong Feb 18 '14 at 13:47