# Issue with zoom feature in MathJax

I have noticed a curious bug in the way MathJax is setup on MSE. MathJax has feature to zoom its formulas via "Math Settings -> Zoom Trigger" menu option. I normally use this menu option and set double-click as the Zoom trigger and zoom setting to 200% so that double clicking zooms the content to twice the size (note that double-click opens up a new window where it shows the zoomed content) . It is helpful in viewing formulas having lot of small subscripts or superscripts.

However this zoom splits a single line formula into multiple lines and this makes it difficult to grasp the formula when viewed in zoom mode. I use MathJax in my blog (in the blog the zoom trigger is defaulted to double click) and there I don't see this problem. Probably some settings in MathJax is not proper and should be fixed by modifying the css files.

Image of the formula given by Asaf Karagila in comments is shown below:

Another image showing the same formula in one line (I don't know what triggers the split shown above and BTW split is seen most frequently and one line is rare):

Update: I use the following configuration for mathjax in my blog css and I don't find this issue on my blog. Perhaps that may help:

  <script type='text/x-mathjax-config'>
MathJax.Hub.Config({ messageStyle: "none", TeX: { equationNumbers: { autoNumber: "AMS" }, extensions: ["autobold.js"] }, tex2jax: {inlineMath: [['$','$'], ['$','$']]}, processEscapes: true, menuSettings: { zoom: "Double-Click" }});
</script>
<script src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script>


Further Update: I checked that this issue is specific to MSE only. The MO site does not have this problem. You can see the equation $(1)$ in question on MSE and the same question on MO. This I find very difficult to accept.

• Perhaps it would be wise to add a formula that shows that splitting up. For example: $$\sum x_n=\sum\sum y_{nk} = \iint f(x,y)\operatorname{d}xy=\frac{\aleph_{\omega+1}}{2\pi}=\aleph_{\omega+1}=\aleph_\omega^{\aleph_0}=\infty$$ (Yes, a part of me just died a little for using $\aleph_{\omega+1}$ there!) The code is this: \sum x_n=\sum\sum y_{nk} = \iint f(x,y)\operatorname{d}xy=\frac{\aleph_{\omega+1}}{2\pi}=\aleph_{\omega+1}=\aleph_\omega^{\aleph_0}=\infty – Asaf Karagila Aug 28 '14 at 7:08
• (And apparently, it works just peachy in the comments. So this must be something inherent to the question/answer boxes.) – Asaf Karagila Aug 28 '14 at 7:10
• @AsafKaragila: The formula you gave in comment is a nice example. It shows as split into 4 lines. i will update a screenshot of it. – Paramanand Singh Aug 28 '14 at 7:12
• It actually showed in a single line for me (even with a scrollbar!); but I have seen that problem in some answer (after I tried it when I saw this post). – Asaf Karagila Aug 28 '14 at 7:14
• @AsafKaragila: I have put a screenshot. But you need to believe me. Something even strange happened when I was typing this comment. I just double clicked your formula for zoom and then it showed in one line. And after the comment is done I reload the page fresh it seems to have the same issue. I will post that single line screenshot also. – Paramanand Singh Aug 28 '14 at 7:20
• Thanks @AsafKaragila for the large formula! – Paramanand Singh Aug 28 '14 at 7:24
• Ah, yes, that is the same here. I suspect that when adding a new comment the zoom in the comments gets solved somehow by the addition of content. Perhaps you could add the actual formula to your question, and then we'll see if adding a comment fixes this globally, or locally in the comments. – Asaf Karagila Aug 28 '14 at 7:32

The SE sites have automatic line breaking enabled, whereas your blog doesn't. That setting applies to the zoom box as well as the original expression, and since the zoom box is smaller in width and the font is larger, you will likely get more line breaking in the zoomed version.

The reason that this only happens sometimes is that I think there is a bug with the zoom code that doesn't reset the wrapping width properly after a zoom, and so sometimes you are getting wrapping and sometimes not. There is an open Mathjax issue tracker for this issue. It should set the line breaking width to the scaled size of the original equation's line breaking width, so that the line breaking will be the same in the zoom and the original.

• Let's hope mathjax team fixes the issue soon. – Paramanand Singh Aug 28 '14 at 15:24
• I added further update in question which shows that the issue is specific to MSE. MathOverflow does not have this problem. I wonder what is the real issue. – Paramanand Singh Sep 9 '14 at 16:22
• The issue is as I said it was: the line-breaking width is not being reset properly for the zoom box. The difference between the two sites is the fact that MSE has the "Hot Questions" sidebar, and when there is math in any title there, the line-break width is set to the width of that sidebar. Since that is the last math processed, that is the width left in play when you do the zoom on the main part of the page. In MO, there is no hot question sidebar, and so the line width is left at the width of the main column. – Davide Cervone Sep 9 '14 at 17:01
• @DavideCervone But I observe (empirically) that SE now excludes questions with math in titles from Hot Questions. I have been unable to get them to confirm or deny. – user147263 Sep 9 '14 at 17:18
• Sorry, I miss spoke. It is the related questions, not Hot Questions sidebar that generally includes the math. Either way, the last math processed is in a small container, and that container size is being retained for the zoom window. I have confirmed this in the code, and am in the process of fixing it. I assure you, this is the problem. – Davide Cervone Sep 10 '14 at 10:24

This is a test answer, with a formula, to determine more about the problem: $$\sum x_n=\sum\sum y_{nk} = \iint f(x,y)\operatorname{d}xy=\frac{\aleph_{\omega+1}}{2\pi}=\aleph_{\omega+1}=\aleph‌​_\omega^{\aleph_0}=\infty$$

Conclusions:

When adding a comment, the issue is resolved throughout the page, until the next reload when it breaks down again.

• Okay, so in the preview for the answer, it worked fine, but after posting it didn't work very well. What about comments, then? – Asaf Karagila Aug 28 '14 at 7:33
• Let's try the magic formula again... $$\sum x_n=\sum\sum y_{nk} = \iint f(x,y)\operatorname{d}xy=\frac{\aleph_{\omega+1}}{2\pi}=\aleph_{\omega+1}=\aleph‌​_\omega^{\aleph_0}=\infty$$ – Asaf Karagila Aug 28 '14 at 7:34
• So when I added the comment, it solved the issue in the answer as well. That seems a bit odd. Let's see if it works globally through the entire page, too. EDIT: Yes, adding a comment "fixes" the problem temporarily throughout the page. – Asaf Karagila Aug 28 '14 at 7:35
• My observation is that when you post something then things are OK. But suppose you reload that page (to make it fresh) then the problem appears. – Paramanand Singh Aug 28 '14 at 7:35
• I have updated the question with my mathjax configuration which i use in my blog. – Paramanand Singh Aug 28 '14 at 7:48
• There is an "uncaught error: restart" from MathJax in the Javascript console when I try to zoom. That might be the source of the problem. – user9733 Aug 28 '14 at 10:30
• I added further update in question which shows that the issue is specific to MSE. MathOverflow does not have this problem. I wonder what is the real issue. – Paramanand Singh Sep 9 '14 at 16:23