# What should we do about really long MathJax?

I recently came across this answer, which involved some pretty precise calculations. Here's how it rendered in my browser*:

Two questions arise:

• What is the desired technical behavior? Should the MathJax there really cut off the sidebar?
• What is the desired community behavior? Should users post MathJax this long?

For what it's worth, adding overflow-x: hidden to the div.post-text truncates the output as expected.

* Google Chrome 33.0.1750.149 on Linux Mint 16 Cinnamon ×64

• Ideally I would have like to have put latex inside of scrollbars, does anyone know how to do that? – DanielV May 18 '14 at 0:50
• @DanielV I tried, and gave up. I actually stopped short of throwing the kitchen sink at it, so maybe there is still a way, but I am not so hopeful anymore. – J. W. Perry May 18 '14 at 2:18
• @J.W.Perry Thanks for looking, if you ever find a way, feel free to edit my post (or any post of mine you think you can improve, it is welcome). – DanielV May 18 '14 at 4:36
• @WChagrin In hindsight, now I realize I missed the obvious, since the denominator is a power of 10 the decimal would have been exact...oh well~ – DanielV May 18 '14 at 4:38
• MathJax is able to do automatic line-breaking. This is not active by default. The community could ask stackexchange to modify their MathJax configuration. – Peter Krautzberger May 23 '14 at 12:57
• @DanielV: This inside a stylish script produces the desired behaviour, I believe: .MathJax_Display{overflow: scroll;} – chaosflaws May 29 '14 at 20:34
• @chaosflaws How do you use it? Can put you an example into an answer so I can see it? – DanielV May 29 '14 at 22:54
• @DanielV That would be something the StackExchange developers would have to add; it goes in the CSS stylesheet. – wchargin May 29 '14 at 23:08
• Awww, but maybe we could make a meta thread recommending this. – DanielV May 29 '14 at 23:09
• @DanielV You can try it yourself by right-clicking, pressing "Inspect Element," going into the <head>, and adding the relevant <style>. – wchargin May 29 '14 at 23:10
• See my answer to use it locally. – chaosflaws May 30 '14 at 7:46

For now (until a built-in approach comes along), one can apply the fix that Goos just made by using \atop for fractions. That is, wrap the text as long as the intent is clear from context.

Example of \atop $$\frac{{ 14545454540916238222253308031039403263876427137099 \atop 728738149747953197899302063661139633020606426446001 }}{10^{101}}$$ Code:

$$\frac{{ 14545454540916238222253308031039403263876427137099 \atop 728738149747953197899302063661139633020606426446001 }}{10^{101}}$$

• Does anyone know if there is a way of getting the line break to be automatic? I thought a minipage would work, but alas they seem not to work in mathmode. – user1729 May 22 '14 at 8:27

Temporarily, a solution that creates sidebars is the following. Use an extension for your browser that allows to use user-defined stylesheets (for Firefox, Opera and Chrome this would e. g. be Stylish). Then, add the following code:

@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document domain("stackexchange.com") {
.MathJax_Display {
overflow-x: scroll;
}
}