# Display issue with first $2$ equations in an answer, although they appear fine in Edit mode

The issue is with my second answer to the question at Fastest way to solve congruency equation. This is what I see:





The problem occurs on a Windows $$7$$ machine using FireFox version $$66.0.5$$ and a Windows $$10$$ machine using Microsoft Edge version $$44.17763.1.0$$. I tried a few things, e.g., adding an empty MathJax statement before, but nothing helped. In case it helps, the text is:



using (note: the following $$2$$ equations may not display properly, although they appear to be written correctly & show fine in Edit mode)

$$a + 2n(b - n) = k(b - 2n) \tag{1}\label{eq1}$$

to create a quadratic equation in $$n$$, i.e.,

$$n^2 - (k + b)n + \frac{bk - a}{2} = 0 \tag{2}\label{eq2}$$

which has a discriminant of

$$D = (bk - a)^2 - 2(bk - a) = k^2 + b^2 + 2a \tag{3}\label{eq3}$$



For me at least, this shows properly here.

• Same here, your answer on that post is unclear. But, wouldn't $$a+2n(b-n)=k(b-2n) \tag 1$$ $$a+2n(b-n)=k(b-2n) \tag 1$$ work? Why do you need \label {eq1}? – Mohammad Zuhair Khan May 12 at 9:26
• Noticing that if I link directly the the revision it works fine, a natural question is whether it might clash with \label{eq1} from another answer. Each answer is enclosed in begingroup .. endgroup - I know that this prevents interference between macros defined in various answers. Does somebody know whether begingroup..endgroup also separate labels? – Martin Sleziak May 12 at 9:40
• @MartinSleziak good find! It's near certainly the interference of the labels. If one switches the view to oldest/active so that the two answers change position then the problem 'moves' to the other answer. // [Sidenote: The delete/undelete on one answer is because I wanted to test something. ] – quid May 12 at 10:43
• @MohammadZuhairKhan Thanks for noticing that. You're right that I don't need \label {eq1} on that particular equation. I added it as a habit in case I need to reference it. However, due to the apparent interference of the labels, I'll change it to see what then happens. – John Omielan May 12 at 14:11
• @MartinSleziak It seems that the begingroup..endgroup structure doesn't separate labels. As I explain in my answer, I've changed this by just removing the use of those labels in the second equation as I don't need them there. – John Omielan May 12 at 14:29
• @quid I, too, noticed that the ordering made a difference. In addition, Fabio Somenzi reported the same thing in this comment. However, as explained in my answer, I've removed those tags in the second solution so everything is working properly now. – John Omielan May 12 at 14:31

Thank you to all who commented above, especially Mohammad Zuhair Khan who asked about my use of labels, and Martin Sleziak who found the issue was the interference from my use of the same \label {eq1} and \label {eq2} in $$2$$ different answers. As a habit, I give a label to each equation N in the form of eqN in case I want to reference it later. However, in this case, instead of changing the label names, I just removed them in the second answer as I didn't use them anywhere. The display now works properly.