I am currently developing a web app where users should be able to type math formulas using MathJax and LaTeX commands. I have encountered an issue when typing very long commands within a single pair of delimiters to break the design of my application. So I decided to look up how does math.exchange behave in such scenario. I posted an answer to a random question (which I deleted instantly, of course) containing the \frac{a}{b} command within $$ multiple times and the result I got: enter image description here

I can scroll horizontally till the end of the equation: enter image description here

  • Can you please reproduce it in the sandbox, so that we can see it live? – Shadow The Vaccinated Wizard May 31 '15 at 13:34
  • link here it is, but I can see that others have done similar things already... – Martin Shishkov May 31 '15 at 13:39
  • Thanks, reproduced! :) – Shadow The Vaccinated Wizard May 31 '15 at 13:42
  • 1
    I don't think this is a bug report for SE. All they do is load MathJax script. The script is free to rewrite the whole page in any way, breaking everything in its path. Of course, it tries not to do that... for example, by linebreaking long in-line formulas such as yours. But the line breaks are allowed only in certain places, such as binary relation symbols (I expanded your example to illustrate this). If you give MathJax an insanely long input with no such structure, you get an insane output. – user259867 May 31 '15 at 20:53
  • @HomegrownTomato Yes, of course, but shouldn't this be treated somehow? Isn't that a type of an invalid user input? – Martin Shishkov Jun 2 '15 at 6:30
  • Please let me know if you've found a workaround for this problem :) – Martin Shishkov Jun 2 '15 at 6:30
  • Retagging, as this isn't a bug Stack Exchange can fix... – Oded Jun 9 '15 at 15:17

This seems to be due to a bug in MathJax's line-breaking algorithm.

I've filed a bug upstream at https://github.com/mathjax/MathJax/issues/1198.

  • Will accept answer if something comes up. – Martin Shishkov Jun 3 '15 at 9:01
  • 2
    It is definitely a bug. The question is only if we can fix it easily. FYI I'm on the MathJax team. – Peter Krautzberger Jun 3 '15 at 9:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .