# Cumulative misalignment in fractions in comments

In this comment, the fraction $\frac{(2n+2)!}{(n+1)!}$ is misaligned. I repeated the same input in a second comment underneath the first, and the alignment gets even worse there. Here's a screenshot from my browser (Firefox $44.0.2$, Mac OS $10.5.5$):

Here's the input for the affected equation:

\binom{2n}n=\frac{(2n)!}{n!^2}=\frac{(n+1)^2}{(2n+1)(2n+2)}\frac{(2n+2)!}{(n+1)!‌​‌​}=\frac{(n+1)^2}{(2n+1)(2n+2)}\binom{2(n+1)}{n+1}

This is the only related question I could find; as far as I can tell, that was a different issue that was resolved.

• Is this specific to comments, or does it behave the same way in questions/answers. – Martin Sleziak Mar 6 '16 at 8:37
• Test: $$\binom{2n}n=\frac{(2n)!}{n!^2}=\frac{(n+1)^2}{(2n+1)(2n+2)}\frac{(2n+2)!}{(n+1)!‌​‌​}=\frac{(n+1)^2}{(2n+1)(2n+2)}\binom{2(n+1)}{n+1}$$ \binom{2n}n=\frac{(2n)!}{n!^2}=\frac{(n+1)^2}{(2n+1)(2n+2)}\frac{(2n+2)!}{(n+1)!‌​‌​}=\frac{(n+1)^2}{(2n+1)(2n+2)}\binom{2(n+1)}{n+1} – Jyrki Lahtonen Mar 6 '16 at 8:45
• Test: $\binom{2n}n= \frac{(2n)!}{n!^2}= \frac{(n+1)^2}{(2n+1)(2n+2)}\frac{(2n+2)!}{(n+1)!} = \frac{(n+1)^2}{(2n+1)(2n+2)} \binom{2(n+1)}{n+1}$ $\binom{2n}n= \frac{(2n)!}{n!^2}= \frac{(n+1)^2}{(2n+1)(2n+2)}\frac{(2n+2)!}{(n+1)!} = \frac{(n+1)^2}{(2n+1)(2n+2)} \binom{2(n+1)}{n+1}$ I have reposted the same thing but added spaces in some places. Is it possible that this is caused by an added invisible character as explained here? – Martin Sleziak Mar 6 '16 at 8:54
• The screenshot looks like the FastPreview output. Do you see this if you disable the FastPreview via the MathJax menu? I.e. does either CommonHTML, HTML-CSS, or SVG output exhibit the problem? – Peter Krautzberger Mar 6 '16 at 12:34
• @PeterKrautzberger: Yes, I disabled FastPreview and cycled through all the renderers; the problem always occurs (except of course for plain source). I think Martin's idea about the invisible character makes sense. – joriki Mar 6 '16 at 12:52
• Thanks, @joriki. Will take a closer look when I get the chance. – Peter Krautzberger Mar 6 '16 at 13:00
• The comment you linked to now seems ok, so probably some of the moderators has edited it. (So thanks to our moderators team.) – Martin Sleziak Mar 11 '16 at 10:26

There are several invisible characters in the input, and that is causing the unexpected alignment. The characters are U+200B (ZERO WIDTH SPACE) and U+200C (ZERO WIDTH NON-JOINER). These are the characters that the comment code inserts into long runs of characters that have no spaces. There several copies of them, so it may be that you edited the comment several times?

You can see the characters in the MathML output. If you use the MathJax contextual menu to Show Math As MathML (on the example in Jyrki's comment for example), then you should see

      ...
<mn>2</mn>
<mo stretchy="false">)</mo>
<mo>!</mo>
</mrow>
<mrow>
<mo stretchy="false">(</mo>
<mi>n</mi>
<mo>+</mo>
<mn>1</mn>
<mo>&#x200C;</mo>
<mo>&#x200B;</mo>
<mo stretchy="false">)</mo>
<mo>!</mo>
<mo>&#x200C;</mo>
<mo>&#x200B;</mo>
<mo>&#x200C;</mo>
<mo>&#x200B;</mo>
</mrow>
</mfrac>
<mo>=</mo>
<mfrac>
...


where you can see the &#x200C; and &#x200B; in several places. These are throwing off the width of the denominator.

• Yes, it may be that I edited the comment several times. Do additional space characters get inserted every time I edit it, and accumulate across edits? – joriki Mar 6 '16 at 22:29
• I would expect the answer to be yes, though I haven't tested it. – Davide Cervone Mar 6 '16 at 23:53

A strange thing. In case it helps tracing the problem here's what it looks like if you insert a \qquad in front of the offending denominator. Posting this as an answer instead of a comment so that A) anyone so inclined can tinker with it more, B) the output won't be disturbed by the known 80-character feature preventing parsing of long TeX-snippets inside a comment.

Code snippet/output pairs follow

\binom{2n}n=\frac{(2n)!}{n!^2}=\frac{(n+1)^2}{(2n+1)(2n+2)}\frac{(2n+2)!}{\qquad(n+1)!} =\frac{(n+1)^2}{(2n+1)(2n+2)}\binom{2(n+1)}{n+1} $$\binom{2n}n=\frac{(2n)!}{n!^2}=\frac{(n+1)^2}{(2n+1)(2n+2)}\frac{(2n+2)!}{\qquad(n+1)!} =\frac{(n+1)^2}{(2n+1)(2n+2)}\binom{2(n+1)}{n+1}$$

\binom{2n}n=\frac{(2n)!}{n!^2}=\frac{(n+1)^2}{(2n+1)(2n+2)} \frac{(2n+2)!}{\qquad(n+1)​‌​!}=\frac{(n+1)^2}{(2n+1)(2n+2)}\binom{2(n+1)}{n+1} $$\binom{2n}n=\frac{(2n)!}{n!^2}=\frac{(n+1)^2}{(2n+1)(2n+2)} \frac{(2n+2)!}{\qquad(n+1)!​‌​}=\frac{(n+1)^2}{(2n+1)(2n+2)}\binom{2(n+1)}{n+1}$$

• This is not an answer. I know :-/ – Jyrki Lahtonen Mar 6 '16 at 8:45
• Even stranger is that the behavior has changed since I first posted this. And after previewing it. I swear, when I first posted this the first displayed formula in my answer looked exactly like the second with the factorial sign added in place. In other words, adding \qquad had the effect of adding extra whitespace both to the left and to the right of the numerator/denominator AND also centering both the numerator and the denominatore within their respective boxes. Trying reloading the page... – Jyrki Lahtonen Mar 6 '16 at 8:51
• And now i get two different outputs with the same code! – Jyrki Lahtonen Mar 6 '16 at 9:10
• I think someone is trying to tell you not to divide $(2n+2)!$ by $(n+1)!$. – Gerry Myerson Mar 6 '16 at 11:49