# Doubled MathJax (including in Google search)

I noticed in the past year or so that there was a change in the MathJax that results in every MathJax equation being doubled, one being an image and one being a text-based rendering. Usually one of them is hidden, but sometimes the doubles are positioned corner to corner, as shown here. As was already noted, a hard-refresh (Ctrl-F5) usually resolves the problem, but there is another problem caused by the same issue, which is that Google search has all MathJax appearing twice, such as this. As you can see, this problem did not exist prior to the change in the MathJax renderer. Can this be solved somehow, if not Google will become less useful for searching Math SE?

Below is a screenshot of the link as rendered in my browser (a Firefox derivative). The same thing happens with IE9.

And here is the HTML source for the snippet of the first result in the above:

<span class="st"><span class="f">2 days ago - </span>Let G G be a <em>group of order p2</em> p 2 where p p is a prime. I want to show that either G G is cyclic or is the product of two cyclic <em>groups of order</em> p p&nbsp;...</span>

• Could you please explain better what you mean by "Google search has all MathJax appearing twice" (or maybe add a screenshot)? When I try the link from your post this is what I see: i.stack.imgur.com/pbwpc.png – Martin Sleziak May 8 '16 at 3:38
• @MartinSleziak: Done. Sorry I didn't know it displays differently for different people. What browser are you using? – user21820 May 8 '16 at 4:42
• The screenshot I posted before is from Chrome. But I have now tried it in Firefox and IE and it displayed in the same way. By which I mean that I see "Let G be a group of order p 2 where p is a prime" and not "Let G G be a group" like in your screenshot. I run Windows 8, if that's relevant. – Martin Sleziak May 8 '16 at 5:07
• Another thing which may or may not be relevant is that even though the search result is displayed fine for me, when I try to view the cached version of some page from that search, it is not displayed correctly. The cache version looks like this on my computer: i.stack.imgur.com/SQFS1.png (Again, the screenshot is from Chrome, but it seems to work the same in the other browsers.) – Martin Sleziak May 8 '16 at 5:11
• @MartinSleziak: Very strange! The google search result page shown to me literally has the text "G G" in its HTML source! And the cached page renders the same as yours. – user21820 May 8 '16 at 5:16
• I am glad that I took that screenshot a few hour ago, When I try the same thing now, I get the same problem as you. You can see in your screenshot that this happens only for some posts. For example "I must show that a group with order p 2 with p prime must be a abelian" is displayed correctly in your screenshot. When I check cached version of some "problematic" question like this one it is diplayed incorrectly. Google says that "It is a snapshot of the page as it appeared on... – Martin Sleziak May 8 '16 at 8:15
• ...May 6, 2016 16:11:32 GMT." But this one displays correctly both in cache and in the search results. The date shown when viewing cached version is "May 6, 2016 04:33:58 GMT". – Martin Sleziak May 8 '16 at 8:15
• @MartinSleziak: I don't know why you saw a different page earlier, but this problem is still consistent with my hypothesis that some recent upgrade to MathJax caused the problem. The search result that was cached prior to the upgrade (2012) would display correctly, and the cached page you're looking at is the new one (2016) so it links to the right MathJax script and also renders correctly. The one that was cached recently such as the first in my link (2016) has doubled MathJax due to the upgrade. – user21820 May 8 '16 at 8:38
• When I try your search query, this problem is the most obvious if I restrict search result to past 24 hours. If I try past week or no time restriction, the precentage of problematic questions becomes smaller. – Martin Sleziak May 8 '16 at 9:49
• An educated guess would be that this might be a side effect of the so-called AssistiveMML extension introduced in MathJax 2.6 which adds visually hidden MathML for accessibility purposes. Google runs JavaScript when crawling these days and if its bot just grabs text content then this doubling would be the expected result. Again, just a guess. – Peter Krautzberger May 8 '16 at 11:46
• @PeterKrautzberger: From your description, I'm sure that's a major part of the reason. Thanks for guessing! – user21820 May 8 '16 at 11:47
• To see what @PeterKrautzberger said (I think) in practice: when I copy rendered MJ on the site, I sometimes get the doubled-text on paste. – quid May 8 '16 at 12:57
• @quid yes, MathJax tries to avoid user selection of the hidden content but the relevant CSS is not honored by all browsers. – Peter Krautzberger May 8 '16 at 12:59